Jump to content

Recommended Posts

Hello,

 

For my ambush mission start in a city with various group and units hidden arround, I would like start with all units in given area say "zone1"

 

I want to get a gerenric trigger that I can use to change value of a large number of units (behaviour, combat mode, disable ai, unitpos...)

 

I drop a trigger on the zone activated by East

 

in activation in write:   zone1=thislist; {_x setCaptive true} forEach  thislist;

 

this is working find.

 

But when I want to cancel setCaptive , I put in an other trigger and write:   {_x setCaptive false} forEach  zone1

but it dosent work, I also tried {_x setCaptive false} forEach  units zone1

 

I guess the zone1=thislist  is maybe a wrong syntax

 

Can anyone tell me the good syntax to call all unit of a given zone ?

thank you in advance

 

SKNAM

 

 

Share this post


Link to post
Share on other sites

The setCaptive command changes a units side, so the trigger will no longer detect them, since they're on the civilian side now.

Try this instead, in the onAct:

EnemyUnits = thisList;

 

In the other triggers onAct:

{_x setCaptive false} forEach EnemyUnits;

 

Cheers

Share this post


Link to post
Share on other sites
zone1 = +thislist

As GOM says the setCaptive will cause them to change side. As soon as they change side the trigger will update its list being [] nothing. The trigger constantly updates its list based on its activation settings even though its condition may cause it not to activate.

As there are no East units to fire off the trigger the activation will not run again to change the variable zone1, but because ARRAYs are copied by Reference and not by Value zone1 will update to hold [].

Putting + in front of thisList will make it copy thisList by Value which will stop zone1 updating and will leave it still holding the original list of units you changed when the trigger first activated, as long as the trigger does not reactivate before hand.

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

×