@ Planck
Aww, I was just about to say that
btw Yes that is the correct syntax, I can't believe I missed that out
@ Maximus-Sniper
For some reason, OFP seems to be expecting an array of numbers - which is odd, cause its just a float value of how much damage has been caused
editHmm, I think I see another problem.
There is no loop or pause between adding the EH and checking if the unit is dead, which could lead to all sorts of problems. I also changed the script a bit, see if it works now:
#loop
? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "hit"} forEach eastsnipe
~1
goto "loop"
#EH
{_x addEventHandler ["hit",{_dammage = _this select 1; goto "CheckDead"}]} forEach eastsnipe
#Wait
~3
goto "Wait"
#CheckDead
?(_dammage >= 1): _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
?(_dammage < 1): goto "loop"
? !slow_mo_deathcam : goto "loop"
~1
goto "EH"edit 2Hang on
If that doesn't work, then I think I might know what the problem is. OFP was expecting an array (which we want) but it got an object.
In the "Hit" EH, the arguments: "CausedBy" and "HowMuch" are stored in
_this.
AFAIK to get "causedBy" you would use
_this select 0 right? That's an object.
To get the value of "HowMuch" you'd use
_this select 1 right? This is a scalar ammount (can be an array).
So if OFP is getting an object, then maybe its
_this select 1 for "causedBy" and
_this select 2 for "HowMuch".
Just to see, try using this script as well:
#loop
? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "hit"} forEach eastsnipe
~1
goto "loop"
#EH
{_x addEventHandler ["hit",{goto "CheckDead"}]} forEach eastsnipe
#Wait
~3
goto "Wait"
#CheckDead
_dammage = _this select 2;
?(_dammage >= 1): _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
?(_dammage < 1): goto "loop"
? !slow_mo_deathcam : goto "loop"
~1
goto "EH"