Jump to content
Sign in to follow this  
patpowercat

Count certain units

Recommended Posts

I am trying to make a trigger activate when a certain number of units out of a group of named units are killed. I know I can do something like 

{alive _x} count units ALPHA < 1

But I don't want to group these units as they are (A) across the map and (B) when too close to each other they move out of the positions I put them in in editor. 

 

Any suggestions?

Share this post


Link to post
Share on other sites
([unit1,unit2,unit3,unit4,unit5] select {alive _x}) isEqualTo []

true if all (unit1,unit2,unit3,unit4,unit5) are killed

false if all or any of them are alive

Share this post


Link to post
Share on other sites
10 minutes ago, davidoss said:

([unit1,unit2,unit3,unit4,unit5] select {alive _x}) isEqualTo []

true if all (unit1,unit2,unit3,unit4,unit5) are killed

false if all or any of them are alive

Just out of curiosity, is this faster than

({alive _x} count [unit1,unit2,unit3,unit4,unit5]) isEqualTo 0

?

Edit:

([unit1,unit2,unit3,unit4,unit5] select {alive _x}) isEqualTo [] = 0.0112ms

({alive _x} count [unit1,unit2,unit3,unit4,unit5]) isEqualTo 0 = 0.0108ms

Share this post


Link to post
Share on other sites

Looks like your iteration is quicker 0,014ms that mine 0,018ms

and even your arma is quicker that mine :-)

 

  • Like 1

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  

×