Jump to content
Sign in to follow this  

setTriggerStatements questino

Recommended Posts

Hi Scripters,

I'm playing arround with scripted triggers and so far it's work just fine. However i'm trying to build in some additional logic but that seem to fail on me. Hope someone has some hints on how to solve this. I've created similar conditions in triggers I created through the editor which work out just fine with the TriggerActivated syntax. Through scripted triggers i'm unable to get it working.

Trigger area2 and area3 fires. But with the TriggerActivated line in the setTriggerStatements on area4 fails to fire.

So i'm guessing i am not using the proper trigger names? Or should I change the syntax of the setTriggerStatements line with the TriggerActivated in it to get it to fire properly ?

_trga=createTrigger["EmptyDetector",getMarkerPos "area2"];
_trga setTriggerArea[5,5,0,false];
_trga setTriggerActivation["WEST","PRESENT",false];
_trga setTriggerStatements["this", "hint 'area2 hit'", "'"];

_trgb=createTrigger["EmptyDetector",getMarkerPos "area3"];
_trgb setTriggerArea[5,5,0,false];
_trgb setTriggerActivation["WEST","PRESENT",false];
_trgb setTriggerStatements["this", "hint 'area3", "'"];

_trgc=createTrigger["EmptyDetector",getMarkerPos "area4"];
_trgc setTriggerArea[5,5,0,false];
_trgc setTriggerActivation["WEST","PRESENT",false];
_trgc setTriggerStatements["this && TriggerActivated _trga && TriggerActivated _trgb", "hint 'All good, previous triggers are set.'"];



Share this post

Link to post
Share on other sites

Try changing the triggers from a local variable into a global. I think area4 fails to fire because you are passing local vars to it:

yourTag_trga=createTrigger["EmptyDetector",getMarkerPos "area2"]; 
yourTag_trga setTriggerArea[5,5,0,false]; 
yourTag_trga setTriggerActivation["WEST","PRESENT",false]; 
yourTag_trga setTriggerStatements["this", "hint 'area2 hit'", "'"]; 

yourTag_trgb=createTrigger["EmptyDetector",getMarkerPos "area3"]; 
yourTag_trgb setTriggerArea[5,5,0,false]; 
yourTag_trgb setTriggerActivation["WEST","PRESENT",false]; 
yourTag_trgb setTriggerStatements["this", "hint 'area3", "'"]; 

yourTag_trgc=createTrigger["EmptyDetector",getMarkerPos "area4"]; 
yourTag_trgc setTriggerArea[5,5,0,false]; 
yourTag_trgc setTriggerActivation["WEST","PRESENT",false]; 
yourTag_trgc setTriggerStatements["this && TriggerActivated yourTag_trga && TriggerActivated yourTag_trgb", "hint 'All good, previous triggers are set.'"];

Share this post

Link to post
Share on other sites

Hi, you have local variables in global space (trigger statement)

Try this

trga=createTrigger["EmptyDetector",getMarkerPos "area2"];
trga setTriggerArea[5,5,0,false];
trga setTriggerActivation["WEST","PRESENT",false];
trga setTriggerStatements["this", "hint 'area2 hit'", "'"];

trgb=createTrigger["EmptyDetector",getMarkerPos "area3"];
trgb setTriggerArea[5,5,0,false];
trgb setTriggerActivation["WEST","PRESENT",false];
trgb setTriggerStatements["this", "hint 'area3", "'"];

_trgc=createTrigger["EmptyDetector",getMarkerPos "area4"];
_trgc setTriggerArea[5,5,0,false];
_trgc setTriggerActivation["WEST","PRESENT",false];
_trgc setTriggerStatements["this and triggerActivated trga and triggerActivated trgb", "hint 'All good, previous triggers are set.'"]; 

Share this post

Link to post
Share on other sites

Hi, thank you for your comments, it worked out great !

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