Jump to content
Sign in to follow this  
Gil Galvanti

thisList For Detecting Who Trips Trigger?

Recommended Posts

Hey,

I'm trying to figure out which unit trips a trigger in the game. I did a search and saw that "thisList" is an array created that has the list of units that meet the activation requirements. So I create a trigger and set to repeated, activated by presence of civilians, and put 2 civilians in the trigger area. When I try and print or use thisList it doesn't seem to do anything though. I've tried

player globalChat "list="+str(thisList);

and

player globalChat "list="+str(thisList select 0);

thisList also doesn't highlight like _this does in ArmA Edit. Am I using it wrong?

I'm using an external script, does thisList carry over to external scripts or is does it just work in the editor?

EDIT: One more thing I realized, I'm using it outside the trigger activation statement, does it not exist outside of the activation statement?

Nevermind, it seems that thisList only exist within the activation, so I'll just pass it to a new array, sorry for the thread.

Edited by Gil Galvanti

Share this post


Link to post
Share on other sites

Indeed, thislist only exists in the scope of the trigger. However, with the list command, you can access the list of any trigger from anywhere. Ex:

player globalChat format ["MyTrigger List: %1",list MyTrigger];

Share this post


Link to post
Share on other sites
Nevermind, it seems that thisList only exist within the activation, so I'll just pass it to a new array, sorry for the thread.

As Big_Dawg says it exist both in the activation and the condition. So you can do this in the activation for example:

tText = "People in area"; {tText = tText + "\n" + (name _x);} forEach thisList; hint tText;

You don't have to use the list command if you want to run a script with the people that are triggering; i'm pretty sure you can pass thislist to a function (maybe this is what you mean with "so I'll just pass it to a new array, sorry for the thread.") like this: [thislist] call listCivilians;

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  

×