Jump to content
Sign in to follow this  
Nephris1

count units group(s)

Recommended Posts

Hi,

i ve got 2 seperate west groups.

I want them to count,for a condition like:

{alive _x} count ((units groupx)+(units bravo)) == {_x in helicopter} count ((units groupx)+(units bravo));

As it is a coop map i cant garantee that each group is always present.

Means maybe units bravo are not exist, as each player spawned in units groupX.

That condition above doesnt fire my trigger.

Any hints?

Share this post


Link to post
Share on other sites

If there are no units in bravo, that means that bravo is not created, so you maybe have to add a if (!isNil (bravo) then {

And have to counts, 1 for each group and just add up the 2 counts after.

Share this post


Link to post
Share on other sites

If you define the group in their init line (which btw will only work reliably in no-respawn missions), then an isNil "groupx" check would do. Of course in order to avoid a large number of checks when you have more groups, you could do:

_heloUnits = [];
if (!isNil "groupx") then {_heloUnits = _heloUnits + (units groupx);};
if (!isNil "bravo") then {_heloUnits = _heloUnits + (units bravo);};
// etc etc...

And then check the condition on the _heloUnits array (could be a public variable rather than local if you need to do the check in a different script).

Share this post


Link to post
Share on other sites

Thx for that approach...i will test with that, and report back.

Share this post


Link to post
Share on other sites

That could work too, of course, as long as there aren't any playable units that don't need to get on that chopper.

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  

×