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
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
///////// ARMA3 Config CSV EXPORT — Ammo (CfgAmmo) with ACE3 properties
|
||||
///////// Usage: execVM "ammo.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 — copy from log after run
|
||||
|
||||
private ["_CfgPatches","_configPath","_getClass","_out","_count","_maxDepth"];
|
||||
|
||||
_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;
|
||||
};
|
||||
|
||||
_maxDepth = 8;
|
||||
_count = 0;
|
||||
|
||||
diag_log "--- AMMO EXPORT CSV START ---";
|
||||
diag_log text("source_mod;name;simulation;class_name;parent_class;hit;indirectHit;indirectHitRange;caliber;typicalSpeed;airFriction;visibleFire;audibleFire;cost;explosive;deflecting;airLock;cartridge;ACE_caliber;ACE_bulletLength;ACE_bulletMass;ACE_ballisticCoefficients;ACE_velocityBoundaries;ACE_dragModel;ACE_standardAtmosphere;ACE_muzzleVelocities;ACE_barrelLengths;ACE_transonicStabilityCoef;ACE_muzzleVelocityVariationSD");
|
||||
|
||||
{
|
||||
private _queue = [[_x, 0]];
|
||||
while {count _queue > 0} do {
|
||||
private _pair = _queue deleteAt 0;
|
||||
private _current = _pair select 0;
|
||||
private _depth = _pair select 1;
|
||||
|
||||
{
|
||||
private _sim = getText(configFile >> "CfgAmmo" >> (configName _x) >> "simulation");
|
||||
if (_sim != "") then {
|
||||
private _cn = configName _x;
|
||||
|
||||
// Source mod identification
|
||||
private _sources = configSourceAddonList (configFile >> "CfgAmmo" >> _cn);
|
||||
private _sourceMod = "unknown";
|
||||
if (count _sources > 0) then {
|
||||
_sourceMod = _sources select 0;
|
||||
};
|
||||
|
||||
private _displayName = getText(configFile >> "CfgAmmo" >> _cn >> "displayName");
|
||||
private _name = if (_displayName != "") then { _displayName } else { _cn };
|
||||
|
||||
private _parentClass = configName inheritsFrom (configFile >> "CfgAmmo" >> _cn);
|
||||
if (_parentClass == "Default") then { _parentClass = ""; };
|
||||
|
||||
// Vanilla properties
|
||||
private _hit = getNumber(configFile >> "CfgAmmo" >> _cn >> "hit");
|
||||
private _indirectHit = getNumber(configFile >> "CfgAmmo" >> _cn >> "indirectHit");
|
||||
private _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _cn >> "indirectHitRange");
|
||||
private _caliber = getNumber(configFile >> "CfgAmmo" >> _cn >> "caliber");
|
||||
private _typicalSpeed = getNumber(configFile >> "CfgAmmo" >> _cn >> "typicalSpeed");
|
||||
private _airFriction = getNumber(configFile >> "CfgAmmo" >> _cn >> "airFriction");
|
||||
private _visibleFire = getNumber(configFile >> "CfgAmmo" >> _cn >> "visibleFire");
|
||||
private _audibleFire = getNumber(configFile >> "CfgAmmo" >> _cn >> "audibleFire");
|
||||
private _cost = getNumber(configFile >> "CfgAmmo" >> _cn >> "cost");
|
||||
private _explosive = getNumber(configFile >> "CfgAmmo" >> _cn >> "explosive");
|
||||
private _deflecting = getNumber(configFile >> "CfgAmmo" >> _cn >> "deflecting");
|
||||
private _airLock = getNumber(configFile >> "CfgAmmo" >> _cn >> "airLock");
|
||||
private _cartridge = getText(configFile >> "CfgAmmo" >> _cn >> "cartridge");
|
||||
|
||||
// ACE3 properties
|
||||
private _aceCaliber = getNumber(configFile >> "CfgAmmo" >> _cn >> "ACE_caliber");
|
||||
private _aceBulletLength = getNumber(configFile >> "CfgAmmo" >> _cn >> "ACE_bulletLength");
|
||||
private _aceBulletMass = getNumber(configFile >> "CfgAmmo" >> _cn >> "ACE_bulletMass");
|
||||
private _aceBCs = getArray(configFile >> "CfgAmmo" >> _cn >> "ACE_ballisticCoefficients");
|
||||
private _aceVBs = getArray(configFile >> "CfgAmmo" >> _cn >> "ACE_velocityBoundaries");
|
||||
private _aceDragModel = getNumber(configFile >> "CfgAmmo" >> _cn >> "ACE_dragModel");
|
||||
private _aceAtmo = getText(configFile >> "CfgAmmo" >> _cn >> "ACE_standardAtmosphere");
|
||||
private _aceMVs = getArray(configFile >> "CfgAmmo" >> _cn >> "ACE_muzzleVelocities");
|
||||
private _aceBLs = getArray(configFile >> "CfgAmmo" >> _cn >> "ACE_barrelLengths");
|
||||
private _aceTransonic = getNumber(configFile >> "CfgAmmo" >> _cn >> "ACE_transonicStabilityCoef");
|
||||
private _aceMVVar = getNumber(configFile >> "CfgAmmo" >> _cn >> "ACE_muzzleVelocityVariationSD");
|
||||
|
||||
// Format arrays as strings
|
||||
private _bcStr = str _aceBCs;
|
||||
private _vbStr = str _aceVBs;
|
||||
private _mvStr = str _aceMVs;
|
||||
private _blStr = str _aceBLs;
|
||||
|
||||
diag_log text(format["%1;%2;%3;%4;%5;%6;%7;%8;%9;%10;%11;%12;%13;%14;%15;%16;%17;%18;%19;%20;%21;%22;%23;%24;%25;%26;%27;%28;%29",
|
||||
_sourceMod, _name, _sim, _cn, _parentClass,
|
||||
_hit, _indirectHit, _indirectHitRange,
|
||||
_caliber, _typicalSpeed, _airFriction,
|
||||
_visibleFire, _audibleFire, _cost, _explosive,
|
||||
_deflecting, _airLock, _cartridge,
|
||||
_aceCaliber, _aceBulletLength, _aceBulletMass,
|
||||
_bcStr, _vbStr, _aceDragModel, _aceAtmo,
|
||||
_mvStr, _blStr, _aceTransonic, _aceMVVar]);
|
||||
|
||||
_count = _count + 1;
|
||||
if (_count % 200 == 0) then { sleep 0; };
|
||||
};
|
||||
|
||||
if (_depth < _maxDepth) then {
|
||||
{
|
||||
_queue pushBack [_x, _depth + 1];
|
||||
} forEach ("true" configClasses _x);
|
||||
};
|
||||
|
||||
} forEach ("true" configClasses _current);
|
||||
};
|
||||
} forEach [configFile >> "CfgAmmo"];
|
||||
|
||||
diag_log "--- AMMO EXPORT CSV END ---";
|
||||
|
||||
systemchat format["Ammo export done — %1 entries", _count];
|
||||
Reference in New Issue
Block a user