Jump to content
Sign in to follow this  
mr_centipede

Trigger Woes... return typeName instead. Help needed

Recommended Posts

this is my code:

_trg=createTrigger["EmptyDetector",getPos player];
_trg setTriggerArea[500,500,0,false];
_trg setTriggerText "Keep Formation"; 
_trg setTriggerActivation["ANY","WEST D",false];
_trg setTriggerStatements["this", "[b]player sideChat format['%1',player countFriendly list _trg][/b]", ""];

At the highlited part, I expect it to return Number like 1,2,3 but instead it return typeName instead. In this case it return 'SCALAR'. Any idea why?

Share this post


Link to post
Share on other sites

You're using an Variable inside the trigger, that is private for the script. "_trg"

The trigger is created by the script, but not inside it so it wont know the value of "_trg".

Use this instead:

_trg=createTrigger["EmptyDetector",getPos player];
_trg setTriggerArea[500,500,0,false];
_trg setTriggerText "Keep Formation"; 
_trg setTriggerActivation["ANY","WEST D",false];
_trg setTriggerStatements["this", "player sideChat format['%1',player countFriendly thisList]", ""];

thisList <-

Share this post


Link to post
Share on other sites

thanks Tajin, that was really helpful... say if I really need to use variable, what should I do?

Share this post


Link to post
Share on other sites

then don't use a private variable. That will only work inside the script

_var <-- private variable

var <-- global variable

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  

×