Render layer of item on ground

Place to get help with not working mods / modding interface.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1759
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Render layer of item on ground

Post by Pi-C »

The Maps mod rewards players for killing trees, spawners, or worms by adding loot to those entities: "maps" that will reveal the area around the player in a certain radius. Now I've got a report that those maps (prototype "item-entity") are hidden by the corpses of worms and biters/spitters.

For testing, I've set the probability of entities dropping loot to 100%. This is what a defeated base of the native fauna looks like:
maps.png
maps.png (2.61 MiB) Viewed 536 times
Notice the different maps on top of the spawners, and the absence of maps on the corpses of the worms.

Is there any way to render an "item-entity" above the corpse layer?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Render layer of item on ground

Post by darkfrei »

Something like on_entity_died if biter corps and if near item-on-ground "map" then remove corpse.

Or somehow replace biter corpse with player corpse, it can have loot inventory.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1759
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Render layer of item on ground

Post by Pi-C »

darkfrei wrote: Thu Jul 09, 2020 4:36 pm Something like on_entity_died if biter corps and if near item-on-ground "map" then remove corpse.
Yikes, that sounds expensive! :mrgreen:
Or somehow replace biter corpse with player corpse, it can have loot inventory.
I don't even need that. As you can see on the screenshot in my last post, the loot was picked up although it was invisible. The problem is making it visible, so people know they should walk over to a dead worm to pick it up. But changing the corpse is not a bad idea! I think it could work if I'd add a second layer with the map to the last frame of the corpse.animation to all turrets during the data stage because there is a visual indicator. That way, I could ignore worms in on_entity_died.

For biters/spitters, on_entity_died could still be costly. Perhaps it would be easier to considerably reduce the time they need to rot away. This is also required just during the data stage, and it could even help with UPS if enemy corpses expire faster. Thanks a lot for the idea! :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Post Reply

Return to “Modding help”