obrien979 4 Posted March 20, 2018 Is there a way to pull all the magazine classnames for every vehicle and weapon from the CFG file? I know that BIStudio has a listing on their Wiki page, but I am looking to do the same for the addons that I have. Thanks In Advance Brandon Share this post Link to post Share on other sites
Harzach 2517 Posted March 20, 2018 https://community.bistudio.com/wiki/magazinesAllTurrets Questions like this really belong in Editing and Scripting. Share this post Link to post Share on other sites
obrien979 4 Posted March 20, 2018 19 minutes ago, Harzach said: https://community.bistudio.com/wiki/magazinesAllTurrets Questions like this really belong in Editing and Scripting. Will this only read the CFG file for the vehicles on the screen or will it get info from all Vehicles in my asset browser? Share this post Link to post Share on other sites
Harzach 2517 Posted March 20, 2018 It will return info on the vehicle you call it on. Share this post Link to post Share on other sites
obrien979 4 Posted March 20, 2018 4 minutes ago, Harzach said: It will return info on the vehicle you call it on. Yeah that works for individual vehicles perfectly. However I am looking for a way to pull the same data from the CFG File for all vehicle classes or types (tanks, trucks, etc). Share this post Link to post Share on other sites
Harzach 2517 Posted March 20, 2018 CFGMagazines in Config Viewer has everything. Share this post Link to post Share on other sites
Harzach 2517 Posted March 20, 2018 Or you could place one of each relevant vehicle in an otherwise empty mission and run the following in the debug console: _allMags = []; {_magsArray = magazinesAllTurrets _x; {_mag = _x select 0; _allMags = (_allMags - [_mag]) + [_mag]; } forEach _magsArray; } forEach (allMissionObjects "All"); copyToClipboard str _allMags; It will return an array of all magazines used by all editor-placed vehicles, with no duplicate entries, in your clipboard ready for pasting into your text editor. I placed all of the RHS T-80 variants in a VR mission (plus a civilian for player unit) and it returned this: ["rhs_mag_3bm17_14","rhs_mag_3bk14_8","rhs_mag_3bm42_10","rhs_mag_3bk21_8","rhs_mag_3bm22_10","rhs_mag_9m112m_4","rhs_mag_3bm22_14","rhs_mag_3bk18m_8","rhs_mag_3d17_12","rhs_mag_dazzler","rhs_mag_smokegen","rhs_mag_3bm46_10","rhs_mag_3bk31_8","rhs_mag_3of26_6","rhs_mag_9m119_4","rhs_mag_762x54mm_250","rhs_mag_3d17","rhs_LaserFCSMag","rhs_mag_127x108mm_50"] Obviously, you could change the vehicle class to look for certain types of vehicles only. 1 Share this post Link to post Share on other sites
pierremgi 4898 Posted March 21, 2018 if you want the same list as in config viewer: _arr= ((" getNumber (_x >> 'scope') == 2" configclasses (configfile >> "cfgmagazines")) apply {configname _x}); _arr sort true // alphabetical order 1 Share this post Link to post Share on other sites
Harzach 2517 Posted March 21, 2018 Very nice, thanks Pierre! Share this post Link to post Share on other sites
obrien979 4 Posted March 21, 2018 23 hours ago, Harzach said: Thats great if I wanna look at each individual magazine type. I am looking for a way to pull the types of magazines that are Default loaded on vehicles from the start. Objective is to be able to quick reference a RHS or CUP vehicles loadout prior to placing on the map so That I can have an idea as to what firepower I have. Thanks Share this post Link to post Share on other sites
Harzach 2517 Posted March 21, 2018 Then the method I posted will be what you want. Share this post Link to post Share on other sites
obrien979 4 Posted March 21, 2018 11 minutes ago, Harzach said: Then the method I posted will be what you want. COuld it be modified to also pull the display name for the vehicle and display it with the magazine listing? Share this post Link to post Share on other sites
Harzach 2517 Posted March 21, 2018 _allMags = []; _sep = " ||| "; {_magsArray = magazinesAllTurrets _x; _name = getText (configFile >> "cfgVehicles" >> typeOf _x >> "displayName"); _allMags pushback _sep; _allMags pushback _name; {_mag = _x select 0; _allMags pushback _mag; } forEach _magsArray; } forEach (allMissionObjects "LandVehicle"); copyToClipboard str _allMags; I placed an Ifrit GMG, Ifrit HMG and Qilin (Armed) on the map. Output was: [" ||| ","Ifrit GMG","SmokeLauncherMag","96Rnd_40mm_G_belt"," ||| ","Ifrit HMG","SmokeLauncherMag","200Rnd_127x99_mag_Tracer_Green","200Rnd_127x99_mag_Tracer_Green"," ||| ","Qilin (Armed)","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash"] For readability (maybe?) I added a separator before each new vehicle displayName. This version does not exclude duplicates in favor of showing exactly which magazines each vehicle holds. 1 1 Share this post Link to post Share on other sites
Harzach 2517 Posted March 21, 2018 And of course, this is just the kooky and convoluted method I arrived at. I'm sure there is a far more elegant way to do this. Share this post Link to post Share on other sites
obrien979 4 Posted March 23, 2018 On 3/21/2018 at 8:42 PM, Harzach said: _allMags = []; _sep = " ||| "; {_magsArray = magazinesAllTurrets _x; _name = getText (configFile >> "cfgVehicles" >> typeOf _x >> "displayName"); _allMags pushback _sep; _allMags pushback _name; {_mag = _x select 0; _allMags pushback _mag; } forEach _magsArray; } forEach (allMissionObjects "LandVehicle"); copyToClipboard str _allMags; I placed an Ifrit GMG, Ifrit HMG and Qilin (Armed) on the map. Output was: [" ||| ","Ifrit GMG","SmokeLauncherMag","96Rnd_40mm_G_belt"," ||| ","Ifrit HMG","SmokeLauncherMag","200Rnd_127x99_mag_Tracer_Green","200Rnd_127x99_mag_Tracer_Green"," ||| ","Qilin (Armed)","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash"] For readability (maybe?) I added a separator before each new vehicle displayName. This version does not exclude duplicates in favor of showing exactly which magazines each vehicle holds. This is perfect!! It works great and will do just what I need. Thanks for your help Share this post Link to post Share on other sites
Harzach 2517 Posted March 23, 2018 Also, if you want to limit the reported magazines for each vehicle to just the type and not the number, for example: [" ||| ","Ifrit GMG","SmokeLauncherMag","96Rnd_40mm_G_belt"," ||| ","Ifrit HMG","SmokeLauncherMag","200Rnd_127x99_mag_Tracer_Green"," ||| ","Qilin (Armed)","500Rnd_65x39_Belt_Tracer_Green_Splash"] you can replace "pushBack" in line 8 with "pushBackUnique": _allMags = []; _sep = " ||| "; {_magsArray = magazinesAllTurrets _x; _name = getText (configFile >> "cfgVehicles" >> typeOf _x >> "displayName"); _allMags pushBack _sep; _allMags pushBack _name; {_mag = _x select 0; _allMags pushBackUnique _mag; } forEach _magsArray; } forEach (allMissionObjects "LandVehicle"); copyToClipboard str _allMags; Share this post Link to post Share on other sites