Files
Samuele Lorefice 83d2cb6c52 Initial commit: ArmADump ammo/armor rebalance tool
- SQF extraction scripts (ammo, armor, weapons, magazines) with ACE3 properties
- Python pipeline: extract_csvs, split_by_mod, generate_patches
- Generates CfgPatches config.cpp normalizing non-RHS values to RHS baseline
- Documentation: REFERENCE.md, GENERATE_PATCHES_EXPLAINED.md, AGENTS.md
2026-07-20 18:27:33 +02:00

84 lines
2.9 KiB
Plaintext

///////// ARMA3 Config CSV EXPORT — Weapons (with ACE barrel properties)
///////// Usage: execVM "weapons.sqf" or paste execVM in debug console
///////// Arguments: [name, CfgPatches name] for a mod, [name] for vanilla BIS
///////// Outputs: CSV via diag_log to .rpt
private ["_CfgPatches","_configPath","_getClass","_out","_items","_count"];
_CfgPatches = false;
_configPath = "";
if(count _this > 1) then
{
_configPath = _configPath + (_this select 1);
_CfgPatches = true;
};
_getClass = {
_out = "";
if(typename _this == "STRING") then
{
_out = _this;
}
else
{
_out = configName _this;
};
_out;
};
_count = 0;
_items = [];
if(_CfgPatches) then
{
_items = _items + getArray(configfile >> "CfgPatches" >> _configPath >> "weapons");
}
else
{
_items = [configFile >> "CfgWeapons"] call BIS_fnc_returnChildren;
};
diag_log "--- WEAPONS EXPORT CSV START ---";
diag_log text("source_mod;name;type;class_name;mass;mags;ACE_barrelLength;ACE_barrelTwist");
{
private _configName = _x call _getClass;
private _name = getText(configFile >> "CfgWeapons" >> _configName >> "displayname");
private _picture = getText(configFile >> "CfgWeapons" >> _configName >> "picture");
if (_name != "" && _picture != "") then {
private _parents = [_x, true] call BIS_fnc_returnParents;
private _type = switch true do {
case ("Rifle_Base_F" in _parents): {"PrimaryWeapon"};
case ("Pistol" in _parents): {"SecondaryWeapon"};
case ("Launcher" in _parents): {"Launcher"};
default {"unknown"};
};
if (_type != "unknown") then {
// Source mod
private _sources = configSourceAddonList (configFile >> "CfgWeapons" >> _configName);
private _sourceMod = "unknown";
if (count _sources > 0) then { _sourceMod = _sources select 0; };
private _mass = getNumber(configFile >> "CfgWeapons" >> _configName >> "WeaponSlotsInfo" >> "mass");
private _mags = getArray(configFile >> "CfgWeapons" >> _configName >> "magazines");
// ACE3 weapon properties
private _aceBarrelLength = getNumber(configFile >> "CfgWeapons" >> _configName >> "ACE_barrelLength");
private _aceBarrelTwist = getNumber(configFile >> "CfgWeapons" >> _configName >> "ACE_barrelTwist");
diag_log text(format["%1;%2;%3;%4;%5;%6;%7;%8",
_sourceMod, _name, _type, _configName, _mass, str _mags,
_aceBarrelLength, _aceBarrelTwist]);
_count = _count + 1;
if (_count % 100 == 0) then { sleep 0; };
};
};
} forEach _items;
diag_log "--- WEAPONS EXPORT CSV END ---";
systemchat format["Weapons export done — %1 weapons", _count];