How to get the type of magazine which damaged the entity
How to get the type of magazine which damaged the entity
I'm creating a mod which adds special types of magazines to the game, on of which explodes in a small area upon impact. I want to make it explode when an entity is damaged using the "on_entity_damaged" event, but I can't figure out how to get the type of magazine that damaged the entity.
-
- Fast Inserter
- Posts: 153
- Joined: Sun Jul 26, 2020 4:05 pm
- Contact:
Re: How to get the type of magazine which damaged the entity
There are a few ways of doing what you're wanting to do, but I wouldn't use the 'on_entity_damaged' event.
I'd either fit the explosion into the trigger effect, like the base-game does with tank shells and such, or I'd add a script trigger effect to the action effect, then add a listener to that.
(see https://wiki.factorio.com/Types/AmmoType, https://wiki.factorio.com/Types/TriggerEffect)
I'd either fit the explosion into the trigger effect, like the base-game does with tank shells and such, or I'd add a script trigger effect to the action effect, then add a listener to that.
(see https://wiki.factorio.com/Types/AmmoType, https://wiki.factorio.com/Types/TriggerEffect)