Prototype flag for damage immunity

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
protocol_1903
Filter Inserter
Filter Inserter
Posts: 444
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Prototype flag for damage immunity

Post by protocol_1903 »

A flag or boolean on EntityWithHealthPrototype and its children that specifies that it is not possible of taking damage. Or, just flips LuaEntity.destructible automatically when it's created. On that note, is it possible to add a flag for each of the options on extended entity settings on the prototype to be flipped automatically?

The goal for this is creating entities that are dependents of EntityWithHealth like assemblers or chests, so they are possible of taking damage by nature, require a collision box and collision mask for entity placement/other interactions, but should otherwise not be able to take damage. This is currently possible by looping over all existing damage types and adding full resistance to them, but this annoying to do and very prone to issues when damage prototypes are later removed or added.
Py and PyBlock developer, wielder of LUA in arbitrary ways. I make mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
curiosity
Filter Inserter
Filter Inserter
Posts: 728
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Prototype flag for damage immunity

Post by curiosity »

trigger_target_mask?
User avatar
protocol_1903
Filter Inserter
Filter Inserter
Posts: 444
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Prototype flag for damage immunity

Post by protocol_1903 »

curiosity wrote: Tue Jan 20, 2026 11:15 am trigger_target_mask?
No, they can still take proxy damage (fire, explosions)
Py and PyBlock developer, wielder of LUA in arbitrary ways. I make mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
Post Reply

Return to “Modding interface requests”