Jump to content
Sign in to follow this  
silentghoust

better explaination of thislist?

Recommended Posts

Using Igi_PL load script, I have created a task that involved retrieving crates of medical supplies from a downed helicopter and bringing them back to base. I can get one crate to properly trigger, simply having

cargo1 in thislist;

in the condition of the trigger, but I can't seem to get the other containers grouped up under the same trigger. Meaning you need all 3 crates to finish the objective.

I know Thislist is a array function but how do I add additionial items to this array?

Share this post


Link to post
Share on other sites

Put mainArray = [] in the players init line or somewhere else .

Then in each of your trigger condition mainArray = mainArray + thislist

All three should be in mainArray once all three have been triggered.

I'd help with the foreach command also but this is hard work writing code on a phone

Edited by Squeeze
auto correct on phone sucks....sometimes

Share this post


Link to post
Share on other sites

{_x in thislist}count [cargo1, cargo2, cargo3] == 3

For each [cargo1, cargo2, cargo3] it will run the code {_x in thislist}, where _x is each one of your cargo#'s in turn.

If {_x in thislist} is true then a hidden counter will be incremented, here we ask if the total count is equal to 3.

The whole expression returns TRUE if the each cargo# is in thislist.

It is a short version of saying

cargo1 in thislist && cargo2 in thislist && cargo3 in thislist

Which would also work.

Edited by Larrow

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  

×