Jump to content
Sign in to follow this  
L3TUC3

Count all mounted units

Recommended Posts

I've a mission in the works where I need to know how many enemy units are currently in play.

 

My current solution is this:

_badguys = east countSide list eastTrig;

This simply counts all units on side East in that particular trigger. However this will count units being transported in vehicles as a single unit. So if I've one truck with 10 guys being transported, the count will be 1 instead of 11. How can I get all the crew and transported infantry? I don't really care about knowing how many vehicles there are.

 

Thanks.

Share this post


Link to post
Share on other sites

I'm currently at work so I don't have acces to arma for testing but conceptually you do something like this.

_badguys = 0;

{
    if(_x isVehicle) then {
        _crew = _x getCrew;
        {
            _badguys = _badguys + 1;
        } foreach _crew;
    } else {
        _badguys = _badguys + 1;
    }
} foreach east countSide list eastTrig;

Again this is conceptually syntax might not be correct.  Maybe I'm even missing something I don't know about.  Hope it helps you steer in the right direction.

Share this post


Link to post
Share on other sites

Why do you need to count units in trigger? Do you have specific area you want to count units in or you want to know total number? I have impression it is the latter from your post. So in this case:

 

_badguys = east countSide allUnits;

 

Share this post


Link to post
Share on other sites
On 2/14/2017 at 9:52 AM, killzone_kid said:

Why do you need to count units in trigger? Do you have specific area you want to count units in or you want to know total number? I have impression it is the latter from your post. So in this case:

 


_badguys = east countSide allUnits;

 

 

In this case I don't. That's just the way I've done it before that's worked for me.

 

Thanks.

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  

×