Home   Help Search Login Register  

Author Topic: thislist  (Read 688 times)

0 Members and 3 Guests are viewing this topic.

pazuzu

  • Guest
thislist
« on: 31 Mar 2005, 01:36:05 »
I'm making a mission with a fleet of enemy Destroyers  advancing toward the coast & the objective is to destroy them before they get there.

I want to set up a trigger to detect the presence of any 1 or more of these ships.

My problem is there will be many groups of detroyers so I think I need to use "thislist" for the condition.

I've never done it this way before & wondered how I do the syntax?

I've looked at a mission that uses this & its written out like this:

((t1 in thislist) and (t2 in thislist) and (t3 in thislist) and etc.

Will this work if any ship enters the trigger or does this mean all ships have to be in trigger?

Should I use OR instead of AND?

Thanks.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:thislist
« Reply #1 on: 31 Mar 2005, 01:44:25 »
In OFP code "and" and "or" work just like they do in normal language.     You want the trigger to fire if any one of the destroyers is in the triggera area, so it would be

(t1 in thislist) or (t2 in thislist)

When trying to figure out what to do in OFP, it's often work isolating and simplifying the problem and making a test missionette to figure out what's going on and what you need to do.

In this particular case you have a lot of destroyers so rather than using a huge stream of or commands you might be better of with something like

Condition:    "_x in thislist" count [t1, t2, t3 ...] >= 1

Syntax not guaranteed.

Remember what "thislist" is.    It is simply an array of all the units which are in the trigger area and are of the side specified in the first part of the Activation Box.   There is no black art or wierd commands associated with thislist.    To grab the list from outside the trigger, give the trigger an name and use

list triggerName

Note that this array is updated dynamically.   If a relevant unit moves in or out of the trigger area (or dies) then the list is automatically updated.

If you wanted the trigger to fire if all the destroyers were in the trigger you would use "and".   That would mean that if one of them was sunk (before it entered the trigger) then the trigger could never fire.
Plenty of reviewed ArmA missions for you to play

pazuzu

  • Guest
Re:thislist
« Reply #2 on: 31 Mar 2005, 01:57:22 »
Your right I should have done a test first.

Your explination is very good...I'm sure  can figure it out.

Thank you.