Jump to content

Recommended Posts

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

It will return info on the vehicle you call it on.

Share this post


Link to post
Share on other sites
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

CFGMagazines in Config Viewer has everything.

Share this post


Link to post
Share on other sites

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.

  • Thanks 1

Share this post


Link to post
Share on other sites

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

 

  • Thanks 1

Share this post


Link to post
Share on other sites
23 hours ago, Harzach said:

m32gfKT.jpg

 

HN63rPK.jpg

 

kaCP8Dp.jpg

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
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
_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.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

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
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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×