SSgt 'Ice Cold' Sykes 1 Posted March 25, 2018 Hi there, I have issues with my code coming from the fact that i don't really know of to use the configFile and everything that comes with it. I want to return all vehicles including those with "skins". So here is a part of the code i'm trying to use: _allClassNames = []; _Cfg = configFile >> "CfgVehicles"; for "_i" from 0 to (count _Cfg)-1 do { _class = _Cfg select _i; _className = configName _class; _allClassNames pushback _className; }; copyToClipBoard str _allClassNames; /* Extract of _allClassNames: "O_Heli_Transport_04_bench_F", "O_Heli_Transport_04_box_F", ---------------------------- Extract of a list of all class names : "O_Heli_Transport_04_bench_F", "O_Heli_Transport_04_bench_black_F", "O_Heli_Transport_04_box_F", */ I'm clearly missing some vehicles here. (Also how do i get the sqf highlighting when posting code on the forums ?) 1 Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted March 25, 2018 Not sure what you mean with skins, but you can get all classes that meet a certain criteria using configClasses. _configs = "getNumber (_x >> 'scope') >= 2 AND configName _x isKindof 'Helicopter'" configClasses (configFile >> "CfgVehicles"); This will return all editor placeable helicopter configs. To get an array of classNames simply do this: _configs = "getNumber (_x >> 'scope') >= 2 AND configName _x isKindof 'Helicopter'" configClasses (configFile >> "CfgVehicles"); _classNames = _configs apply {configName _x}; Cheers 2 Share this post Link to post Share on other sites
SSgt 'Ice Cold' Sykes 1 Posted March 25, 2018 Thanks for your help ! Wasn't expecting some until at least next week, guess i should've come here sooner... Well i tried : _configs = "getNumber (_x >> 'scope') >= 2" configClasses (configFile >> "CfgVehicles"); _classNames = _configs apply {configName _x}; copyToClipBoard str _classNames; And i still can't find my "O_Heli_Transport_04_bench_black_F" in _classNames Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted March 25, 2018 1 hour ago, SSgt 'Ice Cold' Sykes said: Thanks for your help ! Wasn't expecting some until at least next week, guess i should've come here sooner... Well i tried : _configs = "getNumber (_x >> 'scope') >= 2" configClasses (configFile >> "CfgVehicles"); _classNames = _configs apply {configName _x}; copyToClipBoard str _classNames; And i still can't find my "O_Heli_Transport_04_bench_black_F" in _classNames That's because the scope value probably doesn't return 2+, so it's configured to not be placed in the editor. Try the snippet and check for scope >= 1. Cheers Share this post Link to post Share on other sites
SSgt 'Ice Cold' Sykes 1 Posted March 26, 2018 How do i make sure that the classnames returned don't have any subClasses in them ? Meaning from this : "B_Heli_Light_01_F", "B_Heli_Light_01_stripped_F", "Heli_Light_01_armed_base_F", "Heli_Light_01_dynamicLoadout_base_F", "B_Heli_Light_01_dynamicLoadout_F", "B_Heli_Light_01_armed_F" I would return : "B_Heli_Light_01_F", "B_Heli_Light_01_stripped_F", "B_Heli_Light_01_dynamicLoadout_F", "B_Heli_Light_01_armed_F" Share this post Link to post Share on other sites
pierremgi 4850 Posted March 27, 2018 The base classes (they don't start with B_) are scope 0. Share this post Link to post Share on other sites
SSgt 'Ice Cold' Sykes 1 Posted April 17, 2018 Thanks it helped a lot ! Do you know where i can find a list of all things like : 'displayName', 'vehicleClass', 'textureSource', 'hardpoints' (idk what they're called) ? Share this post Link to post Share on other sites
pierremgi 4850 Posted April 17, 2018 Example for display name, for helicopter: "getNumber (_x >> 'scope') >= 2 && configName _x isKindOf 'helicopter' " configClasses (configFile >> "CfgVehicles") apply {getText (_x >> "displayName")} Share this post Link to post Share on other sites
SSgt 'Ice Cold' Sykes 1 Posted April 17, 2018 I misspoke myself, i meant the "parameters" you can use after : "configFile >> 'CfgVehicles' >> _class >>" like 'displayName', 'vehicleClass', 'faction' and such Share this post Link to post Share on other sites
pierremgi 4850 Posted April 17, 2018 Just have a look at the config viewer (from console), and here. Share this post Link to post Share on other sites
SSgt 'Ice Cold' Sykes 1 Posted April 17, 2018 Oh nice. Thanks ! Share this post Link to post Share on other sites