Check to see what damage "type" killed a unit

Place to get help with not working mods / modding interface.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1456
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Check to see what damage "type" killed a unit

Post by TheSAguy »

Hi,

How would I check to see what the damage type was that killed a unit?

I.E. I shoot the biter with a gun, it's "Physical"
Laser turret - "Laser".
etc.

Thanks.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1456
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Check to see what damage "type" killed a unit

Post by TheSAguy »

Hmm,

So "on_entity_damaged" has damage type, but "on_entity_died" does not.
I assume if there is a "final_damage_amount" with "on_entity_damaged", then it means the unit was killed by that?
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Check to see what damage "type" killed a unit

Post by darkfrei »

I don't know if it works, but here can be one hack:
if before the on_entity_died of entity you get on_entity_damaged event,
then you can save this parameters to global and use it by the on_entity_died event
else remove it from the global.
Post Reply

Return to “Modding help”