Jump to content
Sign in to follow this  
CarlGustaffa

Create your own delimited config list to arma.rpt

Recommended Posts

Sometimes when you want automation i.e. in addon creation, you may need access to certain kind of information in an easy to look at way. I needed that just now. Although this ACE list of weapons is nice to "look at", copying & pasting into a text editor was anything but trivial compared to the original Arma list of weapons. In my case, I was interrested in any weapons (from CfgWeapons) dexterity value, magazines, and current cursor it had assigned. Running this script generates a semicolon delimited list I can import as a .csv file into a spreadsheet (i.e. Excel), and do filterings and checks there.

It's obvious to the pros, but may be helpful for the new guy. Hope it is useful to some, I know it'll save me hours of manual typing for my experimental dexterity based weapon cursor addon. There may be better ways naturally, but this is what I came up with.

Oh, the script snippet:

//_i = 23; //=M16A4_ACG_GL
_start = 1; //0 = access, gives an error message, and is skipped for this CfgWeapons example
for "_i" from _start to (count (configFile >> "CfgWeapons")) - 1 do {
_entry = (configFile >> "CfgWeapons") select _i;
_array = toArray str(_entry);
_found = false;
for "_j" from (count _array - 1) to 0 step -1 do {
	if (_array select _j == 47) then {_found = true}; //47 = the "/" character
	if (_found) then {_array set [_j, objNull]};
};
_array = _array - [objNull];
_selection = toString _array;

_dex = getNumber (configFile >> "CfgWeapons" >> _selection >> "dexterity");
_cur = getText (configFile >> "CfgWeapons" >> _selection >> "cursor");
_mags = getArray (configFile >> "CfgWeapons" >> _selection >> "magazines");
_string = format ["%1;%2;%3;%4", _selection, _dex, _cur, _mags];

sleep 0.02;
hintSilent _string;
diag_log _string;
};
//After running this you should have a nice semicolon delimited list in your arma2.rpt
//that you can import into a spreadsheet as .csv or perform editing macros on with ease.

Share this post


Link to post
Share on other sites

Wow, this could really help me. So the information exported to csv can be used for addweapon, removeweapon, and addmag options per current mods being used?

Share this post


Link to post
Share on other sites

It's entirely up to you what you use it for :) But yes, it will output (in this case) all weapons from any mods you have active. I used it to extract all weapons in vanilla and ACE, where I put everything in a spreadsheet. That was then used to lookup and generate new cursorvalues based on weapon dexterity (huge weapons like M107 or ACE_M109 gets a big [inaccurate] cursor texture, while MP5s get a small [accurate] cursor texture, 9 sizes total). Based on this idea. In 15 minutes or so worktime, I had a 1855 line config.cpp with help from some additional editor macros.

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
Sign in to follow this  

×