Jump to content
Sign in to follow this  
anfo

Change setcaptive on trigger

Recommended Posts

Hi guys

 

I promise I've Google'd til the cows came home, but the results are not proving workable. The best I can explain is that blufor will start a mission as setcaptive true, in order to infiltrate an opfor held area. This is the trigger I use to get it started:

 

Activation None

Condition:

time > 1

On Act:

{if (side _x == west) then {_x setCaptive true;};} forEach allUnits;

This way I presume I can have all blufor in the desired state with minimum fuss.

 

However getting blufor to transpose from their setcaptive true state to false is proving a challenge. I understand that once a unit is setcaptive true, triggers do not activate for its original faction since they are now civilian. Could anybody please offer code that may work in a new trigger to bring all the setcaptive blufor back to false?

Share this post


Link to post
Share on other sites

Hi guys

 

I promise I've Google'd til the cows came home, but the results are not proving workable. The best I can explain is that blufor will start a mission as setcaptive true, in order to infiltrate an opfor held area. This is the trigger I use to get it started:

 

Activation None

Condition:

time > 1

On Act:

{if (side _x == west) then {_x setCaptive true;};} forEach allUnits;

This way I presume I can have all blufor in the desired state with minimum fuss.

 

However getting blufor to transpose from their setcaptive true state to false is proving a challenge. I understand that once a unit is setcaptive true, triggers do not activate for its original faction since they are now civilian. Could anybody please offer code that may work in a new trigger to bring all the setcaptive blufor back to false?

Create an array of blufor units and work with it from then on

blufors = allUnits select {side _x == west};
{_x setCaptive true} forEach blufors; //on
{_x setCaptive false} forEach blufors; //off

Share this post


Link to post
Share on other sites

 

Create an array of blufor units and work with it from then on

blufors = allUnits select {side _x == west};
{_x setCaptive true} forEach blufors; //on
{_x setCaptive false} forEach blufors; //off

Oh ok, I see what you mean, define all in west faction as "blufor" and regardless of what they become, they will always be known as blufor. So where do I define the first line of code? init.sqf?

Share this post


Link to post
Share on other sites

Oh ok, I see what you mean, define all in west faction as "blufor" and regardless of what they become, they will always be known as blufor. So where do I define the first line of code? init.sqf?

Anywhere that's not run repeatedly, but yes, preferably as soon as possible in some init file. And you do not define the units, you define an array (list) of units.

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  

×