Jump to content
Sign in to follow this  
fencr0c

Trigger with call compile format

Recommended Posts

I've been staring at this bit of code for several hours and dont see why its not working.

_loc=[696.712,8334.23,0]
_trgname="_trigger";
_trgstsfld="areaclear";

call compile format["%1=createTrigger[""EmptyDetector"",%2]",_trgname,_loc];
call compile format["%1 setTriggerArea[300,300,0,false]",_trgname];
call compile format["%1 setTriggerActivation[""GUER"",""NOT PRESENT"",false]",_trgname];
call compile format["%1 setTriggerStatements[""this"",""%2=true;"",""""]",_trgname,_trgstsfld];

call compile format["waitUntil {%1}",_trgstsfld];

It should do the following, but the areaclear is never set so I assume the trigger is not firing. The only unit on the whole map is me a BAF soldier.

_trigger=createTrigger["EmptyDetector",[696.712,8334.23,0]];
_trigger setTriggerArea[300,300,0,false];
_trigger setTriggerActivation["GUER","NOT PRESENT",false];
_trigger setTriggerStatements["this","areaclear=true;",""];

waitUntil {areaclear};

Edited by fencr0c

Share this post


Link to post
Share on other sites

Missing semicolon after the loc at least.

But, can't you just do something this:

_loc=[696.712,8334.23,0];

_trigger=createTrigger["EmptyDetector",_loc];
_trigger setTriggerArea[300,300,0,false];
_trigger setTriggerActivation["GUER","NOT PRESENT",false];
_trigger setTriggerStatements["this","",""];

waituntil {triggeractivated _trigger};

Share this post


Link to post
Share on other sites

The missing semi colon after the _loc was a typo on the post only.

Learning this scripting as I go along, will try the triggeractivated command.

Thanks for the help.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×