Jump to content
kcal

what does "thisList select 0" mean?

Recommended Posts

hello, i'm new here, and I just started scripting, and I think it's fun. i have some basic question. 
what does "thisList select 0" in "on activation" of triggers mean? i'm not sure but i guess it is an object that triggered it. Where can I see the ordering rules of thisList? 

Please excuse my poor English..

Share this post


Link to post
Share on other sites

"thisList" is an array : a list containing several objects :

[obj1, obj2, obj3]

In this case, the array contains all units/objects that fulfil the trigger's condition statement. Use this code in the "on activation" field to see what is included in thisList :

hint str thisList

The "thisList select 0" code simply selects the first element in that array (indexing starts at 0 when going through arrays).

  • Like 1

Share this post


Link to post
Share on other sites

Hello. Welcome on forum. thisList is a special variable for triggers, which returned the objects (units/vehicles) satisfying the preset conditions (example BLUFOR present). You can use it in condition and on activation fields but not in on deactivation field where it doesn't mean anything.

thisList select 0 is just the first object in the list (if any).

  • Like 1

Share this post


Link to post
Share on other sites

If i enter in a trigger with a chopper, who is 0 and who is the number 1 ?

Share this post


Link to post
Share on other sites
1 hour ago, XstinK said:

who is 0 and who is the number 1

 

There is no way to know, exactly, other than retrieving them and seeing "who" they are. The array isn't built in such a way that the order of elements is necessarily the same as the order of triggering entities.

 

What are you trying to do?

  • Like 2

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

×