Page MenuHomeFeedback Tracker

Recent HandleDamage and Killed event handlers additions show actual firing unit as null if damage is indirect
Closed, ResolvedPublic

Description

Thanks for the improvements in event handlers that now include unit that actually triggered the shooting, but these changes are very limited and far from being enough. Currently only Killed and HandleDamage include new entity in the passed script array but it properly identifies it only in cases of direct hit, if it is an explosion damage, new passed entity is always null. Additionally it would be great to have these improvements on side of firing unit in form of passing new entity in HitPart and Fired event handlers.

In total:

  1. HandleDamage and Killed event handlers show new provided entity as null if damage was indirect
  2. Fired and HitPart should also provide actual firing unit in their event handler script arrays

Details

Severity
None
Resolution
Fixed
Reproducibility
Always
Operating System
Windows 7
Category
Scripting
Steps To Reproduce

To reproduce said issue with Killed and HandleDamage event handlers providing null object in case of indirect damage you can create simple mission following these steps:

  1. Open editor, select VR map
  2. Place player unit as any soldier unit with grenades
  3. Place non-player unit nearby and add following script into Init field:
this addEventHandler ["HandleDamage", {systemChat str _this;}]; this addEventHandler ["Killed", {systemChat str _this;}];
  1. Start the mission and throw grenade near non-player unit
  2. Observe output debug showing new provided entity as null

This issue also applies to vehicles, you can test it using the same approach with a tank\APC with explosive shells.

Event Timeline

SaMatra created this task.Aug 9 2016, 12:37 PM
razazel claimed this task.Aug 9 2016, 4:09 PM
razazel changed the task status from New to Feedback.
razazel added a subscriber: razazel.

Hello,

thank you for the feedback. Could you please try to switch to the Development branch and check the state of the EHs there? There were some changes applied.

Thanks

Thanks, I've checked it on dev branch and both event handlers now include firing unit with indirect damage. I will really appreciate if firing unit can also be included into HitPart and Fired event handlers so we can track projectiles after they're fired on clients, not only when they hit. Thank you.

razazel changed the task status from Feedback to Acknowledged.Aug 10 2016, 1:53 PM

Hi, so after a discussion with the responsible dev, here's something about the other EHs.

For HitPart and Fired EHs you can use the returned projectile to get the shot instigator/owner - using getShotParents command.

Feel free to share your thoughts about this :)

Yeah, I missed introduction of this command, it looks like a proper solution for this case, thank you!

Glad to hear that :)

razazel closed this task as Resolved.Aug 15 2016, 8:50 AM
razazel changed Resolution from Open to Fixed.