gc8 970 Posted May 2, 2012 hi Is there a way to detect if vehicle is artillery vehicle? (other than using lists of vehicle types with isKindOf command.) Share this post Link to post Share on other sites
blakeace 11 Posted May 3, 2012 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. _Fnc_Is_Vehicle_Arty = { _Veh = _this select 0; _result = 0; if (isNumber (configFile >> "CfgVehicles" >> _Veh >> "artilleryScanner")) then { _result = getNumber (configFile >> "CfgVehicles" >> _Veh >> "artilleryScanner"); }; _result }; Hope this helps Blake Share this post Link to post Share on other sites
gc8 970 Posted May 3, 2012 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. Share this post Link to post Share on other sites
orcinus 121 Posted May 3, 2012 (edited) 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. Edited May 3, 2012 by Orcinus Share this post Link to post Share on other sites
gc8 970 Posted May 4, 2012 thx I found out that this works as well: getNumber (configFile >> "CfgVehicles" >> _veh >> "transportSoldier") Share this post Link to post Share on other sites
orcinus 121 Posted May 5, 2012 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. Share this post Link to post Share on other sites