Adding "handledamage" and feeding 0 damage to the engine causes never ending avalanche of explosions:
Description
Details
- Legacy ID
- 3914345050
- Severity
- None
- Resolution
- Open
- Reproducibility
- Have Not Tried
- Operating System
- Windows 7
- Category
- Engine
Create AH-9 on Altis next to powerline.
In init field of the heli type:
this addeventhandler ["handledamage", {0}];
This should stop it from taking damage.
Fly into powerline.
Watch game getting confused.
Adding no handledamage EH or adding
this addeventhandler ["handledamage", {_this select 2}];
doesn't seem to cause any problems.
Other combinations that cause avalanche:
this addeventhandler ["handledamage", {0.01}];
this addeventhandler ["handledamage", {0.1}];
this addeventhandler ["handledamage", {0.9}];
Event Timeline
I am really very sorry for confusion. I didn't pay enough attention. I was talking about this one: http://feedback.arma3.com/view.php?id=6644
I've investigated this issue further. These are my finding:
The chain explosion is caused by repeated calling of custom air destruction script. This initially is called from the "killed" config event handler. This leads me to believe that somehow config event handler "killed" ignores the fact that handledamage event handler returns 0. Handledamage keeps helicopter alive while config "killed" keeps on executing because helicopter is supposed to be dead.
Script added "killed" event handler never gets executed. Further more I found error in scripted destruction script which is located in a3\functions_f\Effects\fn_effectKilledAirDestruction.sqf
line 47: if (_velz>1) then (_v setvelocity [velocity _v select 0,velocity _v select 1,0]);
the use of () instead of {}
Changing category from scripting to engine
Soon will be a year since this has been submitted. Just wondering is this going to be fixed at all?
This is coming from the AGM-Team:
Even:
(vehicle player) removeAllEventHandlers "EPEContactStart"; (vehicle player) removeAllEventHandlers "EPEContact"; (vehicle player) removeAllEventHandlers "EPEContactEnd"; (vehicle player) removeAllEventHandlers "Hit"; (vehicle player) removeAllEventHandlers "HitPart"; (vehicle player) removeAllEventHandlers "HandleDamage"; (vehicle player) addEventHandler ["HandleDamage", {(_this select 2) min 0.89}];
still results in explosions
If you remove the killed EH
(vehicle player) removeAllEventHandlers "Killed";
no more explosions but the helicopter still dies
using:
(vehicle player) removeAllEventHandlers "EpeContactStart"; (vehicle player) removeAllEventHandlers "EpeContact"; (vehicle player) removeAllEventHandlers "EPEContactContactEnd"; (vehicle player) removeAllEventHandlers "Hit"; (vehicle player) removeAllEventHandlers "HitPart"; (vehicle player) removeAllEventHandlers "Killed"; (vehicle player) removeAllEventHandlers "HandleDamage"; (vehicle player) addEventHandler ["epeContact", {(_this select 0) setdamage 0}];
works, at least partially. The chopper bounces a couple of times then it explodes when it rolls over