'Handledamage' & 'Killed' EHs with SetDamage

ddraig

New Member
Hi,
Hopefully this should be an easy one. I have DZAI configured to use HandleDamage EH. This emulates the player blood health and unconsciousness of players for bots. I notice that the code in the handledamage EH will decide if the AI is killed or not, and if killed, will make a call to the DZAI ai_death.sqf which among other things calls 'SetDamage 1' on the AI. DZAI's handledamage EH returns 0 for damage back to the engine, which makes sense, since we only want 'blood' damage, until the AI is actually killed.

My question is, if I am using my own 'Killed' EH, say from WAI's code, or DZMS, will that 'Killed' EH get called when SetDamage 1 is set from DZAI on the same AI? I would presume so, but not sure. So I guess the simple questions is, does 'SetDamage 1' on a unit/agent call the Killed EH? This is A2 OA engine obviously. I honestly could not find a simple answer to this browsing BIS's forums, and I am not able to test this.
It would be cool to add DZAI's damage support, as well as ability to track headshots, but also have WAI's Killed EH called as well.
 
Good that you solved your own question, but to add a bit more information: When you add an event handler to ANY object, its always called. There can be multiple event handlers for the same event (such as "killed", ) and they will ALL be called.
The wiki does say that multiple event handlers will be called https://community.bistudio.com/wiki/addEventHandler although I guess your question is more of "which" event handler will be called?
 
Yeah, I was confused as to whether 'SetDamage 1' will indeed call the 'Killed' EH. It indeed does, which makes sense. So I have WAI using DZAI health system as well now, and they work together well. So have consistency across all bot types now. This thread goes into how to add DZAI health system via HandleDamage EH to DZMS bots, I just applied this to WAI the same way: http://epochmod.com/forum/index.php?/topic/16080-release-dzmshotspots/
 
Back
Top