If multiple EHs return damage value for custom damage handling, only last returned value will be considered by the engine.
Multiple "HandleDamage" event handlers can be added to the same unit.
Only the return value of the last added "HandleDamage" EH is considered. This allows for safe stacking of this event handler. If no value is returned, the default damage processing will be done. Return value of 0 will make the unit invulnerable if damage is not scripted in other ways (i.e using setDamage and/or setHit for additional damage handling). If code provided returns a numeric value, this value will overwrite the default damage of given selection after processing. When this vehicle gets hit, only EH on PC where the vehicle is currently local will fire. For example, you can add this event handler to one particular vehicle on every PC. This EH can accept a remote unit as argument however it will only fire when the unit is local to the PC this event handler was added on. Triggers when the unit is damaged and fires for each damaged selection separately.
anim: String - Name of the anim that is started.
unit: Object - Object the event handler is assigned to.
It can be assigned to a remote unit but will only fire on the PC where the actual addEventHandler command was executed. This EH is only triggered for the 1st animation state in a sequence. Triggered every time a new animation is started. Object event handler, always executed on the computer where it was added.Įxample: mySoldier addEventHandler