https://lua-api.factorio.com/latest/Lua ... ity.damage
entity.damage() takes the arguments damage, force, and type, but does not allow you to specify a source. If I recall correctly, on_entity_damaged and on_entity_died events will then fire off with a nil source. I was working on a series of events that would be greatly simplified if I could just pass a source entity in entity.damage()
Add source entity argument to entity.damage
Re: Add source entity argument to entity.damage
Curious, why can't the entity deal the damage itself?
There's also script.raise_event, but there's not much documentation on how that works.
https://lua-api.factorio.com/0.12.35/Lu ... aise_event
There's also script.raise_event, but there's not much documentation on how that works.
https://lua-api.factorio.com/0.12.35/Lu ... aise_event
I have mods! I guess!
Link
Link
Re: Add source entity argument to entity.damage
Okay, added for the next version.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.