Page 1 of 1

Check to see what damage "type" killed a unit

Posted: Fri Mar 01, 2019 4:29 pm
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.

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

Posted: Fri Mar 01, 2019 4:49 pm
by darkfrei

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

Posted: Sun Mar 03, 2019 2:13 am
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?

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

Posted: Sun Mar 03, 2019 12:42 pm
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.