hi
Is there a way to detect if vehicle is artillery vehicle? (other than using lists of vehicle types with isKindOf command.)
hi
Is there a way to detect if vehicle is artillery vehicle? (other than using lists of vehicle types with isKindOf command.)
This is the function I created for my AI FO addon. If the result is 1 it is an artillery piece. I haven't found an instance "yet" where it didn't yield the correct result.
Hope this helpsCode:_Fnc_Is_Vehicle_Arty = { _Veh = _this select 0; _result = 0; if (isNumber (configFile >> "CfgVehicles" >> _Veh >> "artilleryScanner")) then { _result = getNumber (configFile >> "CfgVehicles" >> _Veh >> "artilleryScanner"); }; _result };
Blake
that seems great thx. now if it were possible to detect between transport helos/planes and attack helos/planes that would be perfect. isKindOf isn't very usefull for this.
CfgVehicles has for all air vehicles cargoCompartment entries. For several cargo-capable machines (UH-1, Mi-24, C-130)
driverCompartments="Compartment1";
cargoCompartments[]={"Compartment2"};
You'll need to check, but if the presence of "Compartment2" is restricted to cargo-capable aircraft you could modify blakeace's code appropriately.
Another possibility would be to use "transportSoldier" - returns the number of cargo seats. If 0, it's an attack machine.
edit - should have said
Another possibility would be to look for "transportSoldier" - contains the number of cargo seats. If 0, it's an attack machine.
Last edited by Orcinus; May 3 2012 at 22:10.
thx I found out that this works as well:
Code:getNumber (configFile >> "CfgVehicles" >> _veh >> "transportSoldier")
Fine
Ofc some aircraft will be both cargo-capable & attack capable - for example, an Mi-24V or an Mi-8 (rockets) can do a lot of damage as well as carry troops. Depends what you want to do with your script. If you want to try somehow directing AA fire at attack machines, cargo capacity would be a very poor discriminator.