LuaEntityDiedEventFilter: entity has/doesn't have loot

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Pi-C
Smart Inserter
Smart Inserter
Posts: 1651
Joined: Sun Oct 14, 2018 8:13 am
Contact:

LuaEntityDiedEventFilter: entity has/doesn't have loot

Post by Pi-C »

The event data of on_entity_died already contains the value "loot". Apparently, loot can be an empty table or an inventory (which may or may not be empty). I'd like to have a new filter "has_loot" that can be set to true (non-empty loot inventory) or false. I don't care what's in the loot inventory, that's easy enough to check in the event script. But for mods dealing explicitly with loot, I think it would be more efficient to trigger the event only if the killed entity actually has loot. Do you think such a filter could be added?
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 interface requests”