Jump to content
Sign in to follow this  
Spriterfight

HELP Check if any unit form a specified group is in the area

Recommended Posts

I want that any unit from a specified  group is in the area and activates trigger, but i need 5 units from 5 groups to be there because i want them to wait eachoter but if i set a trigger only for the leaders with a variable name ,if they got killed in action the trigger dosent activates

Share this post


Link to post
Share on other sites

For trigger condition, count the living units of each group to see whether at least one from each group is in the trigger list, and when count is correct the condition returns true, else false.

Example (not tested):

grpsPresent = [];
{if ({Alive _x && _x In thisList} Count (Units _x) > 0) then {grpsPresent pushBack _x};} forEach [grpTeam1,grpTeam2,grpTeam3,grpTeam4,grpTeam5];
Count grpsPresent >= 5

 

  • Thanks 1

Share this post


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

For trigger condition, count the living units of each group to see whether at least one from each group is in the trigger list, and when count is correct the condition returns true, else false.

Example (not tested):


grpsPresent = [];
{if ({Alive _x && _x In thisList} Count (Units _x) > 0) then {grpsPresent pushBack _x};} forEach [grpTeam1,grpTeam2,grpTeam3,grpTeam4,grpTeam5];
Count grpsPresent >= 5

 

Rhank you very much!

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  

×