Comrades in Arms Discussion Board
addEventHandler and calling sqf file issue - Printable Version

+- Comrades in Arms Discussion Board (http://forum.ciahome.net)
+-- Forum: Comrades in Arms Life (http://forum.ciahome.net/forumdisplay.php?fid=3)
+--- Forum: Mission Making (http://forum.ciahome.net/forumdisplay.php?fid=8)
+--- Thread: addEventHandler and calling sqf file issue (/showthread.php?tid=3365)



addEventHandler and calling sqf file issue - treendy - 05-10-2016


This works as expected in the init sqf (i.e., nothing hints)


Code:
if ("test" != "test") then {    
    hint "IN IF";
};


However, when using an event in the init of a unit:
Code:
"this addEventHandler ["killed", {_this exec "RandFramework\CivKilled.sqf"}]"


my CivKilled.sqf file simply has the statements above (removed all code to help debug this)
yet, I am now seeing the hint "IN IF"?


I do get a small error shown from FHQDebug
Code:
'|#|};' Error Missing {


and when looking at the rpt file, this is the only clue.

Code:
18:02:50 Error in expression <};>
18:02:50   Error position: <};>
18:02:50   Error Missing {


now, when I empty my CivKilled.sqf file, I get no error messages...


This is my current CivKilled.sqf content:



Code:
_killed = _this select 0;
_killer = _this select 1;




if ("test" != "test") then {    
    hint "IN IF";
};

tried without the top two lines and still get the error... but no error when empty... starting to think the sqf file that gets called from an eventHandler needs to have something more? but am not finding anything online Sad




Re: addEventHandler and calling sqf file issue - Alwarren - 05-10-2016

(05-10-2016, 07:24 PM)treendy link Wrote:
Code:
"this addEventHandler ["killed", {_this exec "RandFramework\CivKilled.sqf"}]"

Not surprised. The issue is the 'exec'. It calls an sqs file. If you don't know what that is, be thankful for it and change it to an "execVM" Smile


Re: addEventHandler and calling sqf file issue - treendy - 05-10-2016

THANK YOU!!!!!!!!!!


I was about to set a public variable that fires a trigger that takes care of what I need to work around this






Re: addEventHandler and calling sqf file issue - treendy - 05-10-2016

That worked. I can now stop shooting civilians for testing, was starting to feel a bit bad