Jump to content
Sign in to follow this  
Heeeere's johnny!

A safe way to get the weapon/object which killed a unit?

Recommended Posts

Since the "Killed" EH does not provide the weapon/object which killed the unit, I was looking through the other possible EHs (Dammaged, HandleDamage, Hit, HitPart), only to find that each one of these is either fireing multiple times for each damaged/hit part or potentially NOT fireing at all.

 

So, if I wanted to print a single line to the log, mentioning the killing weapon/object, which would be the most senseful (most efficient) way of doing that?

 

Best wishes,

Johnny

Share this post


Link to post
Share on other sites

Perhaps you can use the HandleDamage EH because it records the projectile that caused the damage. So you can refer to the last HandleDamage upon death. But I think that will only lead you to getting a list of weapons compatible with those projectiles, although you can use the currentWeapon if you get to ammo used by a primary weapon, secondary weapon or a pistol.

Share this post


Link to post
Share on other sites

Perhaps you can use the HandleDamage EH because it records the projectile that caused the damage. So you can refer to the last HandleDamage upon death. But I think that will only lead you to getting a list of weapons compatible with those projectiles, although you can use the currentWeapon if you get to ammo used by a primary weapon, secondary weapon or a pistol.

Unfortunately, HitPart seems to be the only of the four EHs which works with granades (and hopefully IEDs). Even HandleDamage only returns an empty string when the damage is dealt by a granade.

 

So, I'll have to work with HitPart somehow.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×