Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Kromz

need help with parameters

Recommended Posts

Im trying to group all anti air vehicles using the entities command. there is no anti air vehicle class so im using the tank class and im hoping to use the parameter typesExclude to exclude all the other vehicles then use excludeDead to exclude destroyed vehicles.

 

Im quite new to arma scripting and i cant figure out how to use these parameters, ive tried it in every way i could and there is no info on google and these forms even the examples on the wiki page don't work!.maybe doing it a different way would be better or cleaner but i dont know how to do it any other way. Any help would be appreciated ive been stuck on this for days.

 

wiki page: https://community.bistudio.com/wiki/entities

 

my code:

antiair = entities "tank";

Share this post


Link to post
Share on other sites

Since you can't actually tell if a vehicle is AA from config alone your best bet would be to predefine class types in an array and go from there.

Let's say you want blufor AA vehicles, check if they can fire (also checks if vehicle is alive) and have a gunner it would look like this:

_allowed = ["B_APC_Tracked_01_AA_F"];
_AA = [];
 
{
 
    if (typeOf _x in _allowed AND {canFire _x} AND {gunner _x != objNull}) then {_AA pushback _x};
 
} foreach vehicles;
systemchat str _AA;

Cheers

  • Like 2

Share this post


Link to post
Share on other sites
Guest

I dont know how you manage the units but you can ways put them in the same group and retrieve all units from this group

Share this post


Link to post
Share on other sites
Sign in to follow this  

×