Comrades in Arms Discussion Board

Full Version: addEventHandler and calling sqf file issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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

(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
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



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