-
-
Save fuxx/0652f77aaf0710ce5cc5ee52e4e20127 to your computer and use it in GitHub Desktop.
Revisions
-
Wolfenswan revised this gist
Jul 17, 2016 . 1 changed file with 30 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ ///////// Usage: Paste everything below in the debug console and run it (or exec as script) ///////// ToDo: Filter weapon variants (with sights etc) private ["_CfgPatches","_configPath","_collectionName","_getClass","_out","_wepsEx","_itemsEx","_magsEx","_backEx","_weapons","_backpacks","_magazines","_glasses","_configName","_picture","_parents","_type","_classname","_mags","_mass","_capacity","_armor","_passthrough","_append","_ammo"]; _CfgPatches = false; _configPath = ""; @@ -33,9 +33,11 @@ _wepsEx = []; _itemsEx = []; _magsEx = []; _backEx = []; _glassEx = []; _weapons = []; _backpacks = []; _magazines = []; _glasses = []; if(_CfgPatches) then { _weapons = _weapons + getArray(configfile >> "CfgPatches" >> _configPath >> "weapons"); @@ -46,6 +48,7 @@ else _magazines = [configfile >> "CfgMagazines"] call BIS_fnc_returnChildren; _weapons = [configFile >> "CfgWeapons"] call BIS_fnc_returnChildren; _backpacks = [configFile >> "CfgVehicles"] call BIS_fnc_returnChildren; _glasses = [configFile >> "CfgGlasses"] call BIS_fnc_returnChildren; }; { @@ -114,7 +117,7 @@ else case "Vest": { _armor = []; { _armor pushback (getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "armor")); } forEach ["Neck","Arms","Chest","Diaphragm","Abdomen","Body"]; }; default {_armor = "N/A"}; @@ -125,7 +128,7 @@ else case "HeadGear": {_passthrough = getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "passthrough")}; case "Vest": { _passthrough = []; { _passthrough pushback (getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "passthrough")); } forEach ["Neck","Arms","Chest","Diaphragm","Abdomen","Body"]; }; default {_passthrough = "N/A"}; @@ -149,25 +152,35 @@ else if(_name != "" && _picture != "") then { _classname = _configName; _magsEx pushback [_name,"magazine",_classname,_mass,_ammocount,_ammo]; }; } foreach _magazines; { private ["_configName","_picture","_mass","_capacity"]; _configName = _x call _getClass; _name = getText(configFile >> "CfgVehicles" >> _configName >> "displayname"); _picture = getText(configFile >> "CfgVehicles" >> _configName >> "picture"); _mass = getNumber(configFile >> "CfgVehicles" >> _configName >> "mass"); _capacity = getNumber(configFile >> "CfgVehicles" >> _configName >> "maximumload"); if(_name != "" && _picture != "" && !(isClass (configFile >> "CfgVehicles" >> _configName >> "TransportItems")) && "Bag_Base" in _parents && _configName != "Bag_Base" && _name != "Bag") then { _backEx pushback [_name,"bag",_configName,_mass,_capacity]; }; } foreach _backpacks; { private ["_configName","_picture","_mass"]; _configName = _x call _getClass; _name = getText(configFile >> "CfgGlasses" >> _configName >> "displayname"); _mass = getNumber(configFile >> "CfgGlasses" >> _configName >> "mass"); if (_name != "") then { _glassEx pushback [_name,"glasses",_configName,_mass]; }; } foreach _glasses; diag_log "--- CONFIG DUMP SHEET 1 CSV START ---"; diag_log text("name;type;class name;mass;capacity;mags/caliber"); { @@ -197,6 +210,7 @@ diag_log ""; diag_log ""; diag_log "--- CONFIG DUMP SHEET 2 CSV START ---"; diag_log text("name;type;class name;mass;capacity;armor (Neck/Arms/Chest/Diaphragm/Abdomen/Body)';passthrough (Neck/Arms/Chest/Diaphragm/Abdomen/Body)"); { _name = _x select 0; _type = _x select 1; @@ -217,6 +231,14 @@ diag_log text("name;type;class name;mass;capacity;armor (Neck/Arms/Chest/Diaphra diag_log text(format["%1;%2;%3;%4;%5",_name,_type,_classname,_mass,_capacity]); } forEach _backEx; { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _mass = _x select 3; diag_log text(format["%1;%2;%3;%4;%5",_name,_type,_classname,_mass,"N/A"]); } forEach _glassEx; diag_log "--- CONFIG DUMP CSV SHEET 2 END ---"; systemchat "Config export done"; -
Wolfenswan revised this gist
Jun 15, 2016 . 1 changed file with 22 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ ///////// Usage: [name,CfgPatches name] ///////// Usage: [name] to export bis stuff ///////// Usage: Paste everything below in the debug console and run it (or exec as script) ///////// ToDo: Filter weapon variants (with sights etc) private ["_CfgPatches","_configPath","_collectionName","_getClass","_out","_wepsEx","_itemsEx","_magsEx","_backEx","_weapons","_backpacks","_magazines","_configName","_picture","_parents","_type","_classname","_mags","_mass","_capacity","_armor","_passthrough","_append","_ammo"]; @@ -51,16 +52,17 @@ else _configName = _x call _getClass; _name = getText(configFile >> "CfgWeapons" >> _configName >> "displayname"); _picture = getText(configFile >> "CfgWeapons" >> _configName >> "picture"); if(_name != "" && _picture != "") then { _parents = [_x, true] call BIS_fnc_returnParents; _type = switch true do { case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryOpticsItem_Base_F"): {"OpticAttachment"}; case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryMuzzleItem_Base_F" || getText(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "muzzleend") != ""): {"MuzzleAttachment"}; case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryFlashLightItem_Base_F"): {"SideAttachment"}; case ("Rifle_Base_F" in _parents): {"PrimaryWeapon"}; case ("Pistol" in _parents): {"SecondaryWeapon"}; case ("Launcher" in _parents): {"Launcher"}; case ("HelmetBase" in _parents): {"HeadGear"}; case ("H_HelmetB" in _parents): {"HeadGear"}; case ("Uniform_Base" in _parents): {"Uniform"}; case ("Vest_Camo_Base" in _parents || "Vest_NoCamo_Base" in _parents): {"Vest"}; @@ -72,23 +74,24 @@ else case ("ItemRadio" in _parents): {"Radio"}; case ("NVGoggles" in _parents || _configName == "NVGoggles"): {"NVGoggles"}; case ("Binocular" in _parents): {"Binocular"}; case ("CannonCore" in _parents): {"Cannon"}; default {"unknown"}; }; if (_type == "unknown") exitWith {systemChat ("Ignoring: " + _configName)}; _classname = _configName; _mags = getArray(configFile >> "CfgWeapons" >> _configName >> "magazines"); if(_CfgPatches) then { _magazines append _mags; }; if(_type in ["PrimaryWeapon","SecondaryWeapon","Launcher"]) then { _mass = getNumber(configFile >> "CfgWeapons" >> _configName >> "WeaponSlotsInfo" >> "mass"); _wepsEx pushback [_name,_type,_classname,_mags,_mass]; }; if(_type != "unknown" && !(_type in ["PrimaryWeapon","SecondaryWeapon","Launcher"]) ) then @@ -111,7 +114,7 @@ else case "Vest": { _armor = []; { _armor pushback format ["%2",_x,getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "armor")]; } forEach ["Neck","Arms","Chest","Diaphragm","Abdomen","Body"]; }; default {_armor = "N/A"}; @@ -122,20 +125,20 @@ else case "HeadGear": {_passthrough = getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "passthrough")}; case "Vest": { _passthrough = []; { _passthrough pushback format ["%2",_x,getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "passthrough")]; } forEach ["Neck","Arms","Chest","Diaphragm","Abdomen","Body"]; }; default {_passthrough = "N/A"}; }; _itemsEx pushback [_name,_type,_classname,_mass,_capacity,_armor,_passthrough]; }; }; } foreach _weapons; { private ["_configName","_picture","_mass","_ammocount","_ammo"]; _configName = _x call _getClass; _name = getText(configFile >> "CfgMagazines" >> _configName >> "displayname"); @@ -187,9 +190,13 @@ diag_log text("name;type;class name;mass;capacity;mags/caliber"); } forEach _magsEx; diag_log "--- CONFIG DUMP CSV SHEET 1 END ---"; diag_log ""; diag_log ""; diag_log ""; diag_log ""; diag_log ""; diag_log "--- CONFIG DUMP SHEET 2 CSV START ---"; diag_log text("name;type;class name;mass;capacity;armor (Neck/Arms/Chest/Diaphragm/Abdomen/Body)';passthrough (Neck/Arms/Chest/Diaphragm/Abdomen/Body)"); { _name = _x select 0; _type = _x select 1; @@ -210,4 +217,6 @@ diag_log text("name;type;class name;mass;capacity;armor;passthrough"); diag_log text(format["%1;%2;%3;%4;%5",_name,_type,_classname,_mass,_capacity]); } forEach _backEx; diag_log "--- CONFIG DUMP CSV SHEET 2 END ---"; systemchat "Config export done"; -
Wolfenswan revised this gist
Jun 15, 2016 . 1 changed file with 30 additions and 106 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ ///////// ARMA3 Config CSV EXPORT ///////// Usage: [name,CfgPatches name] ///////// Usage: [name] to export bis stuff ///////// Usage: Paste everything below in the debug console and run it (or exec as script) private ["_CfgPatches","_configPath","_collectionName","_getClass","_out","_wepsEx","_itemsEx","_magsEx","_backEx","_weapons","_backpacks","_magazines","_configName","_picture","_parents","_type","_classname","_mags","_mass","_capacity","_armor","_passthrough","_append","_ammo"]; _CfgPatches = false; _configPath = ""; @@ -95,14 +95,16 @@ else { _mass = getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "mass"); _capacity = getText(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "containerclass"); if(_capacity != "") then { _capacity = getNumber(configFile >> "CfgVehicles" >> _capacity >> "maximumload"); } else { _capacity = "N/A"; }; _armor = 0; switch (_type) do { case "HeadGear": {_armor = (getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "armor"))}; @@ -127,27 +129,29 @@ else }; _itemsEx append [[_name,_type,_classname,_mass,_capacity,_armor,_passthrough]]; }; }; } foreach _weapons; { private ["_configName","_picture","_mass","_ammocount","_ammo"]; _configName = _x call _getClass; _name = getText(configFile >> "CfgMagazines" >> _configName >> "displayname"); _picture = getText(configFile >> "CfgMagazines" >> _configName >> "picture"); _mass = getNumber(configFile >> "CfgMagazines" >> _configName >> "mass"); _ammocount = getNumber(configFile >> "CfgMagazines" >> _configName >> "count"); _ammo = getText(configFile >> "CfgMagazines" >> _configName >> "ammo"); if(_name != "" && _picture != "") then { _classname = _configName; _magsEx append [[_name,"magazine",_classname,_mass,_ammocount,_ammo]]; }; } foreach _magazines; { private ["_configName","_parents","_picture","_mass","_capacity"]; _configName = _x call _getClass; _parents = [(configFile >> "CfgVehicles" >> _configName), true] call BIS_fnc_returnParents; _name = getText(configFile >> "CfgVehicles" >> _configName >> "displayname"); @@ -156,20 +160,20 @@ else _capacity = getNumber(configFile >> "CfgVehicles" >> _configName >> "maximumload"); if(_name != "" && _picture != "" && !(isClass (configFile >> "CfgVehicles" >> _configName >> "TransportItems")) && "Bag_Base" in _parents && _configName != "Bag_Base") then { _backEx append [[_name,"bag",_configName,_mass,_capacity]]; }; } foreach _backpacks; diag_log "--- CONFIG DUMP SHEET 1 CSV START ---"; diag_log text("name;type;class name;mass;capacity;mags/caliber"); { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _magazines = _x select 3; _mass = _x select 4; diag_log text(format["%1;%2;%3;%4;%5;%6",_name,_type,_classname,_mass,"N/A",_magazines]); } forEach _wepsEx; { @@ -178,112 +182,32 @@ diag_log text("name;type;class name;mass;capacity;armor;passthrough;mags"); _classname = _x select 2; _mass = _x select 3; _capacity = _x select 4; _ammo = _x select 5; diag_log text(format["%1;%2;%3;%4;%5;%6",_name,_type,_classname,_mass,_capacity,_ammo]); } forEach _magsEx; diag_log "--- CONFIG DUMP CSV SHEET 1 END ---"; diag_log "--- CONFIG DUMP SHEET 2 CSV START ---"; diag_log text("name;type;class name;mass;capacity;armor;passthrough"); { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _mass = _x select 3; _capacity = _x select 4; _armor = _x select 5; _passthrough = _x select 6; diag_log text(format["%1;%2;%3;%4;%5;%6;%7;%8", _name,_type,_classname,_mass,_capacity,_armor,_passthrough]); } forEach _itemsEx; { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _mass = _x select 3; _capacity = _x select 4; diag_log text(format["%1;%2;%3;%4;%5",_name,_type,_classname,_mass,_capacity]); } forEach _backEx; diag_log "--- CONFIG DUMP CSV SHEET 2 END ---"; -
Wolfenswan revised this gist
Jun 14, 2016 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -103,21 +103,23 @@ else { _capacity = 0; }; _armor = 0; switch (_type) do { case "HeadGear": {_armor = (getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "armor"))}; case "Vest": { _armor = []; { _armor pushback format ["%1:%2",_x,getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "armor")]; } forEach ["Neck","Arms","Chest","Diaphragm","Abdomen","Body"]; }; default {_armor = "N/A"}; }; _passthrough = 0; switch (_type) do { case "HeadGear": {_passthrough = getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "passthrough")}; case "Vest": { _passthrough = []; { _passthrough pushback format ["%1:%2",_x,getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "passthrough")]; } forEach ["Neck","Arms","Chest","Diaphragm","Abdomen","Body"]; }; -
Wolfenswan revised this gist
Jun 14, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -108,7 +108,7 @@ else case "HeadGear": {_armor = (getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "armor"))}; case "Vest": { { _armor pushback format ["%1:%2",_x,getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "armor")]; } forEach ["Neck","Arms","Chest","Diaphragm","Abdomen","Body"]; }; default {_armor = "N/A"}; @@ -118,7 +118,7 @@ else switch (_type) do { case "HeadGear": {_passthrough = getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "passthrough")}; case "Vest": { { _passthrough pushback format ["%1:%2",_x,getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "passthrough")]; } forEach ["Neck","Arms","Chest","Diaphragm","Abdomen","Body"]; }; default {_passthrough = "N/A"}; -
Wolfenswan revised this gist
Jun 14, 2016 . 1 changed file with 19 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,8 @@ ///////// Usage: [name] to export bis stuff ///////// Usage: Paste everything below in the debug console and run it private ["_CfgPatches","_configPath","_collectionName","_getClass","_out","_wepsEx","_itemsEx","_magsEx","_backEx","_weapons","_backpacks","_magazines","_configName","_picture","_parents","_type","_classname","_mags","_mass","_capacity","_armor","_passthrough","_append"]; _CfgPatches = false; _configPath = ""; _collectionName = "test"; @@ -101,18 +103,25 @@ else { _capacity = 0; }; _armor = []; switch (_type) do { case "HeadGear": {_armor = (getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "armor"))}; case "Vest": { { _armor pushback format ["%1:%2",_x,getNumber(configFile >> "CfgWeapons" >> "V_TacVest_khk" >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "armor")]; } forEach ["Neck","Arms","Chest","Diaphragm","Abdomen","Body"]; }; default {_armor = "N/A"}; }; _passthrough = []; switch (_type) do { case "HeadGear": {_passthrough = getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "passthrough")}; case "Vest": { { _passthrough pushback format ["%1:%2",_x,getNumber(configFile >> "CfgWeapons" >> "V_TacVest_khk" >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "passthrough")]; } forEach ["Neck","Arms","Chest","Diaphragm","Abdomen","Body"]; }; default {_passthrough = "N/A"}; }; -
Wolfenswan revised this gist
Mar 18, 2015 . 1 changed file with 11 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -130,7 +130,7 @@ else if(_name != "" && _picture != "") then { _classname = _configName; _magsEx = _magsEx + [[_name,"magazine",_classname,_mass]]; }; } foreach _magazines; @@ -172,6 +172,14 @@ diag_log text("name;type;class name;mass;capacity;armor;passthrough;mags"); diag_log text(format["%1;%2;%3;%4;%5;%6;%7;%8", _name,_type,_classname,_mass,_capacity,_armor,_passthrough]); } forEach _itemsEx; { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _mass = _x select 3; diag_log text(format["%1;%2;%3;%4;%5",_name,_type,_classname,_mass,_capacity]); } forEach _magsEx; { _name = _x select 0; _type = _x select 1; @@ -222,8 +230,8 @@ if(count _magazines > 0) then { _name = _x select 0; _classname = _x select 2; _mass = _x select 3; " <Magazine>" call _append; format [" <Name>%1</Name>",_name] call _append; format [" <ClassName>%1</ClassName>",_classname] call _append; -
Wolfenswan revised this gist
Mar 14, 2015 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ ///////// XML & CSV EXPORT ///////// Usage: [name,CfgPatches name] ///////// Usage: [name] to export bis stuff ///////// Usage: Paste everything below in the debug console and run it _CfgPatches = false; _configPath = ""; -
Wolfenswan revised this gist
Mar 14, 2015 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ ///////// XML EXPORT ///////// Usage: [name,CfgPatches name] ///////// Usage : [name] to export bis stuff _CfgPatches = false; _configPath = ""; @@ -107,7 +110,7 @@ else _passthrough = switch (_type) do { case "HeadGear"; case "Vest": {getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "passthrough")}; case "Uniform": {getNumber(configFile >> "cfgVehicles" >> (getText(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "uniformclass")) >> "Hitpoints" >> "Hitbody" >> "passthrough")}; default {"N/A"}; }; -
Wolfenswan revised this gist
Mar 14, 2015 . 1 changed file with 1 addition and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,3 @@ _CfgPatches = false; _configPath = ""; @@ -110,7 +106,7 @@ else _passthrough = switch (_type) do { case "HeadGear"; case "Vest": {getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "passthrough")}; case "Uniform": {getNumber(configFile >> "cfgVehicles" >> (getText(configFile >> "CfgWeapons" >> "ItemInfo" >> "uniformclass")) >> "Hitpoints" >> "Hitbody" >> "passthrough")}; default {"N/A"}; }; -
Wolfenswan revised this gist
Mar 14, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ ///////// XML EXPORT ///////// Usage: [name,CfgPatches name] ///////// Usage : [name] to export bis stuff ///////// armor value for uniforms only takes center mass into account (not head, hands etc.) _CfgPatches = false; _configPath = ""; -
Wolfenswan revised this gist
Mar 13, 2015 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ///////// XML EXPORT ///////// Usage: [name,CfgPatches name] ///////// Usage : [name] to export bis stuff @@ -145,7 +145,7 @@ else _capacity = getNumber(configFile >> "CfgVehicles" >> _configName >> "maximumload"); if(_name != "" && _picture != "" && !(isClass (configFile >> "CfgVehicles" >> _configName >> "TransportItems")) && "Bag_Base" in _parents && _configName != "Bag_Base") then { _backEx = _backEx + [[_name,"bag",_configName,_mass,_capacity]]; }; } foreach _backpacks; @@ -158,7 +158,7 @@ diag_log text("name;type;class name;mass;capacity;armor;passthrough;mags"); _classname = _x select 2; _magazines = _x select 3; _mass = _x select 4; diag_log text(format["%1;%2;%3;%4;%5;%6;%7;%8", _name,_type,_classname,_mass,"N/A","N/A","N/A",_magazines]); } forEach _wepsEx; { @@ -178,7 +178,7 @@ diag_log text("name;type;class name;mass;capacity;armor;passthrough;mags"); _classname = _x select 2; _mass = _x select 3; _capacity = _x select 4; diag_log text(format["%1;%2;%3;%4;%5",_name,_type,_classname,_mass,_capacity]); } forEach _backEx; diag_log "--- CONFIG DUMP CSV END ---"; -
Wolfenswan revised this gist
Mar 13, 2015 . 1 changed file with 44 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ///////// XML & CSV EXPORT ///////// Usage: [name,CfgPatches name] ///////// Usage : [name] to export bis stuff @@ -145,11 +145,45 @@ else _capacity = getNumber(configFile >> "CfgVehicles" >> _configName >> "maximumload"); if(_name != "" && _picture != "" && !(isClass (configFile >> "CfgVehicles" >> _configName >> "TransportItems")) && "Bag_Base" in _parents && _configName != "Bag_Base") then { _backEx = _backEx + [[_name,_x,_configName,_mass,_capacity]]; }; } foreach _backpacks; diag_log "--- CONFIG DUMP CSV START ---"; diag_log text("name;type;class name;mass;capacity;armor;passthrough;mags"); { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _magazines = _x select 3; _mass = _x select 4; diag_log text(format["%1;%2;%3;%4;%5;%6;%7;%8", _name,_type,_classname,_mass,"N/A","N/A",_magazines]); } forEach _wepsEx; { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _mass = _x select 3; _capacity = _x select 4; _armor = _x select 5; _passthrough = _x select 6; diag_log text(format["%1;%2;%3;%4;%5;%6;%7;%8", _name,_type,_classname,_mass,_capacity,_armor,_passthrough]); } forEach _itemsEx; { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _mass = _x select 3; _capacity = _x select 4; diag_log text(format["%1;%2;%3;%4;%5",_name,_type,_configName,_mass,_capacity]); } forEach _backEx; diag_log "--- CONFIG DUMP CSV END ---"; diag_log "--- CONFIG DUMP XML START ---"; _append = { diag_log text _this; }; @@ -159,6 +193,7 @@ _append = { '<Collection>' call _append; ' <Name>'+_collectionName+'</Name>' call _append; ' <Weapons>' call _append; { _name = _x select 0; _type = _x select 1; @@ -184,6 +219,7 @@ if(count _magazines > 0) then } foreach _wepsEx; ' </Weapons>' call _append; ' <Magazines>' call _append; { _name = _x select 0; _classname = _x select 1; @@ -217,9 +253,10 @@ format [" <Mass>%1</Mass>",_mass] call _append; { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _mass = _x select 3; _capacity = _x select 4; " <Item>" call _append; format [" <Name>%1</Name>",_name] call _append; format [" <ClassName>%1</ClassName>",_classname] call _append; @@ -229,4 +266,5 @@ format [" <ClassName>%1</ClassName>",_classname] call _append; " </Item>" call _append; } foreach _backEx; ' </Items>' call _append; '</Collection>' call _append; diag_log "--- CONFIG DUMP XML END ---"; -
Wolfenswan revised this gist
Mar 13, 2015 . 1 changed file with 25 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -72,19 +72,23 @@ else case ("Binocular" in _parents): {"Binocular"}; default {"unknown"}; }; if(_type == "unknown") exitWith {systemChat _configName}; _classname = _configName; _mags = getArray(configFile >> "CfgWeapons" >> _configName >> "magazines"); if(_CfgPatches) then { _magazines = _magazines + _mags; }; if(_type in ["PrimaryWeapon","SecondaryWeapon","Launcher"]) then { _mass = getNumber(configFile >> "CfgWeapons" >> _configName >> "WeaponSlotsInfo" >> "mass"); _capacity = 0; _wepsEx = _wepsEx + [[_name,_type,_classname,_mags,_mass]]; }; if(_type != "unknown" && !(_type in ["PrimaryWeapon","SecondaryWeapon","Launcher"]) ) then { _mass = getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "mass"); @@ -97,7 +101,22 @@ else { _capacity = 0; }; _armor = switch (_type) do { case "HeadGear"; case "Vest": {getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "armor")}; case "Uniform": {getNumber(configFile >> "cfgVehicles" >> (getText(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "uniformclass")) >> "Hitpoints" >> "Hitbody" >> "armor")}; default {"N/A"}; }; _passthrough = switch (_type) do { case "HeadGear"; case "Vest": {getNumber(configFile >> "CfgWeapons" >> "ItemInfo" >> "passthrough")}; case "Uniform": {getNumber(configFile >> "cfgVehicles" >> (getText(configFile >> "CfgWeapons" >> "ItemInfo" >> "uniformclass")) >> "Hitpoints" >> "Hitbody" >> "passthrough")}; default {"N/A"}; }; _itemsEx = _itemsEx + [[_name,_type,_classname,_mass,_capacity,_armor,_passthrough]]; }; }; } foreach _weapons; @@ -183,12 +202,16 @@ format [" <Mass>%1</Mass>",_mass] call _append; _classname = _x select 2; _mass = _x select 3; _capacity = _x select 4; _armor = _x select 5; _passthrough = _x select 6; " <Item>" call _append; format [" <Name>%1</Name>",_name] call _append; format [" <ClassName>%1</ClassName>",_classname] call _append; format [" <ItemType>%1</ItemType>",_type] call _append; format [" <Mass>%1</Mass>",_mass] call _append; format [" <Capacity>%1</Capacity>",_capacity] call _append; format [" <Armor>%1</Armor>",_armor] call _append; format [" <Passthrough>%1</Passthrough>",_passthrough] call _append; " </Item>" call _append; } foreach _itemsEx; @@ -206,5 +229,4 @@ format [" <ClassName>%1</ClassName>",_classname] call _append; " </Item>" call _append; } foreach _backEx; ' </Items>' call _append; '</Collection>' call _append; -
headswe revised this gist
Sep 11, 2014 . 1 changed file with 9 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,12 +2,13 @@ ///////// Usage: [name,CfgPatches name] ///////// Usage : [name] to export bis stuff _CfgPatches = false; _configPath = ""; _collectionName = "test"; if(count [] > 1) then { _configPath = _configPath + _this select 1; _CfgPatches = true; }; @@ -34,8 +35,8 @@ _backpacks = []; _magazines = []; if(_CfgPatches) then { _weapons = _weapons + getArray(configfile >> "CfgPatches" >> _configPath >> "weapons"); _backpacks = _backpacks + getArray(configFile >> "CfgPatches" >> _configPath >> "units"); } else { @@ -52,16 +53,16 @@ else { _parents = [_x, true] call BIS_fnc_returnParents; _type = switch true do { case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryOpticsItem_Base_F"): {"OpticAttachment"}; case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryMuzzleItem_Base_F" || getText(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "muzzleend") != ""): {"MuzzleAttachment"}; case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryFlashLightItem_Base_F"): {"SideAttachment"}; case ("Rifle" in _parents): {"PrimaryWeapon"}; case ("Pistol" in _parents): {"SecondaryWeapon"}; case ("Launcher" in _parents): {"Launcher"}; case ("H_HelmetB" in _parents): {"HeadGear"}; case ("Uniform_Base" in _parents): {"Uniform"}; case ("Vest_Camo_Base" in _parents || "Vest_NoCamo_Base" in _parents): {"Vest"}; case ("ItemCore" in _parents || "DetectorCore" in _parents): {"CommonItem"}; case ("ItemMap" in _parents): {"Map"}; case ("ItemWatch" in _parents): {"Watch"}; case ("ItemCompass" in _parents): {"Compass"}; -
headswe revised this gist
Sep 11, 2014 . 1 changed file with 106 additions and 50 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,38 @@ ///////// XML EXPORT ///////// Usage: [name,CfgPatches name] ///////// Usage : [name] to export bis stuff _CfgPatches = false; _configPath = ""; _collectionName = _this select 0 if(count _this > 1) then { _configPath = _this select 1; _CfgPatches = true; }; _getClass = { _out = ""; if(typename _this == "STRING") then { _out = _this; } else { _out = configName _this; }; _out; }; _wepsEx = []; _itemsEx = []; _magsEx = []; _backEx = []; _weapons = []; _backpacks = []; _magazines = []; if(_CfgPatches) then { _weapons = getArray(configfile >> "CfgPatches" >> _configPath >> "weapons"); _backpacks = getArray(configFile >> "CfgPatches" >> _configPath >> "units"); @@ -21,10 +42,10 @@ else _magazines = [configfile >> "CfgMagazines"] call BIS_fnc_returnChildren; _weapons = [configFile >> "CfgWeapons"] call BIS_fnc_returnChildren; _backpacks = [configFile >> "CfgVehicles"] call BIS_fnc_returnChildren; }; { _configName = _x call _getClass; _name = getText(configFile >> "CfgWeapons" >> _configName >> "displayname"); _picture = getText(configFile >> "CfgWeapons" >> _configName >> "picture"); if(_name != "" && _picture != "" && !(isClass (configFile >> "CfgWeapons" >> _configName >> "LinkedItems"))) then @@ -41,11 +62,16 @@ else case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryOpticsItem_Base_F"): {"OpticAttachment"}; case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryMuzzleItem_Base_F"): {"MuzzleAttachment"}; case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryFlashLightItem_Base_F"): {"SideAttachment"}; case ("ItemMap" in _parents): {"Map"}; case ("ItemWatch" in _parents): {"Watch"}; case ("ItemCompass" in _parents): {"Compass"}; case ("ItemGPS" in _parents): {"GPS"}; case ("ItemRadio" in _parents): {"Radio"}; case ("NVGoggles" in _parents || _configName == "NVGoggles"): {"NVGoggles"}; case ("Binocular" in _parents): {"Binocular"}; default {"unknown"}; }; if(_type == "unknown") exitWith {systemChat _configName}; _classname = _configName; _mags = getArray(configFile >> "CfgWeapons" >> _configName >> "magazines"); if(_CfgPatches) then @@ -54,100 +80,130 @@ else }; if(_type in ["PrimaryWeapon","SecondaryWeapon","Launcher"]) then { _mass = getNumber(configFile >> "CfgWeapons" >> _configName >> "WeaponSlotsInfo" >> "mass"); _capacity = 0; _wepsEx = _wepsEx + [[_name,_type,_classname,_mags,_mass]]; }; if(_type != "unknown" && !(_type in ["PrimaryWeapon","SecondaryWeapon","Launcher"]) ) then { _mass = getNumber(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "mass"); _capacity = getText(configFile >> "CfgWeapons" >> _configName >> "ItemInfo" >> "containerclass"); if(_capacity != "") then { _capacity = getNumber(configFile >> "CfgVehicles" >> _capacity >> "maximumload"); } else { _capacity = 0; }; _itemsEx = _itemsEx + [[_name,_type,_classname,_mass,_capacity]]; }; }; } foreach _weapons; { _configName = _x call _getClass; _name = getText(configFile >> "CfgMagazines" >> _configName >> "displayname"); _picture = getText(configFile >> "CfgMagazines" >> _configName >> "picture"); _mass = getNumber(configFile >> "CfgMagazines" >> _configName >> "mass"); if(_name != "" && _picture != "") then { _classname = _configName; _magsEx = _magsEx + [[_name,_classname,_mass]]; }; } foreach _magazines; { _configName = _x call _getClass; _parents = [(configFile >> "CfgVehicles" >> _configName), true] call BIS_fnc_returnParents; _name = getText(configFile >> "CfgVehicles" >> _configName >> "displayname"); _picture = getText(configFile >> "CfgVehicles" >> _configName >> "picture"); _mass = getNumber(configFile >> "CfgVehicles" >> _configName >> "mass"); _capacity = getNumber(configFile >> "CfgVehicles" >> _configName >> "maximumload"); if(_name != "" && _picture != "" && !(isClass (configFile >> "CfgVehicles" >> _configName >> "TransportItems")) && "Bag_Base" in _parents && _configName != "Bag_Base") then { _backEx = _backEx + [[_name,_configName,_mass,_capacity]]; }; } foreach _backpacks; _append = { diag_log text _this; }; '<?xml version="1.0" encoding="utf-8"?>' call _append; '<Collection>' call _append; ' <Name>'+_collectionName+'</Name>' call _append; ' <Weapons>' call _append; { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _magazines = _x select 3; _mass = _x select 4; " <Weapon>" call _append; format [" <Name>%1</Name>",_name] call _append; format [" <ClassName>%1</ClassName>",_classname] call _append; format [" <WeaponType>%1</WeaponType>",_type] call _append; format [" <Mass>%1</Mass>",_mass] call _append; if(count _magazines > 0) then { " <Magazines>" call _append; { " <Magazine>" call _append; format[" <ClassName>%1</ClassName>",_x] call _append; " </Magazine>" call _append; } foreach _magazines; " </Magazines>" call _append; }; " </Weapon>" call _append; } foreach _wepsEx; ' </Weapons>' call _append; ' <Magazines>' call _append; { _name = _x select 0; _classname = _x select 1; _mass = _x select 2; " <Magazine>" call _append; format [" <Name>%1</Name>",_name] call _append; format [" <ClassName>%1</ClassName>",_classname] call _append; format [" <Mass>%1</Mass>",_mass] call _append; " </Magazine>" call _append; } foreach _magsEx; ' </Magazines>' call _append; ' <Items>' call _append; { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _mass = _x select 3; _capacity = _x select 4; " <Item>" call _append; format [" <Name>%1</Name>",_name] call _append; format [" <ClassName>%1</ClassName>",_classname] call _append; format [" <ItemType>%1</ItemType>",_type] call _append; format [" <Mass>%1</Mass>",_mass] call _append; format [" <Capacity>%1</Capacity>",_capacity] call _append; " </Item>" call _append; } foreach _itemsEx; { _name = _x select 0; _classname = _x select 1; _mass = _x select 2; _capacity = _x select 3; " <Item>" call _append; format [" <Name>%1</Name>",_name] call _append; format [" <ClassName>%1</ClassName>",_classname] call _append; format [" <ItemType>%1</ItemType>","Backpack"] call _append; format [" <Mass>%1</Mass>",_mass] call _append; format [" <Capacity>%1</Capacity>",_capacity] call _append; " </Item>" call _append; } foreach _backEx; ' </Items>' call _append; '</Collection>' call _append; copyToClipboard text outputXML; -
headswe revised this gist
Sep 11, 2014 . 1 changed file with 68 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,30 @@ _CfgPatches = false; _configPath = ""; _collectionName = _this select 0; if(count _this > 1) then { _configPath = _this select 1; _CfgPatches = true; }; _wepsEx = []; _itemsEx = []; _magsEx = []; _backEx = []; íf(_CfgPatches) then { _weapons = getArray(configfile >> "CfgPatches" >> _configPath >> "weapons"); _backpacks = getArray(configFile >> "CfgPatches" >> _configPath >> "units"); } else { _magazines = [configfile >> "CfgMagazines"] call BIS_fnc_returnChildren; _weapons = [configFile >> "CfgWeapons"] call BIS_fnc_returnChildren; _backpacks = [configFile >> "CfgVehicles"] call BIS_fnc_returnChildren; } { _configName = _x; _name = getText(configFile >> "CfgWeapons" >> _configName >> "displayname"); _picture = getText(configFile >> "CfgWeapons" >> _configName >> "picture"); if(_name != "" && _picture != "" && !(isClass (configFile >> "CfgWeapons" >> _configName >> "LinkedItems"))) then @@ -18,38 +38,69 @@ _weapons = [configfile >> "CfgWeapons"] call BIS_fnc_returnChildren; case ("Uniform_Base" in _parents): {"Uniform"}; case ("Vest_Camo_Base" in _parents || "Vest_NoCamo_Base" in _parents): {"Vest"}; case ("ItemCore" in _parents || "DetectorCore" in _parents): {"CommonItem"}; case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryOpticsItem_Base_F"): {"OpticAttachment"}; case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryMuzzleItem_Base_F"): {"MuzzleAttachment"}; case ((configname inheritsFrom (Configfile >> "CfgWeapons" >> _configName >> "ItemInfo")) == "InventoryFlashLightItem_Base_F"): {"SideAttachment"}; case ("NVGoggles" in _parents || _configName == "NVGoggles"): {"NVGoggles"}; case ("Binocular" in _parents): {"Binocular"}; default {"unknown"}; }; if(_type == "unknown") exitWith {}; _classname = _configName; _mags = getArray(configFile >> "CfgWeapons" >> _configName >> "magazines"); if(_CfgPatches) then { _magazines = _magazines + _mags; }; if(_type in ["PrimaryWeapon","SecondaryWeapon","Launcher"]) then { _wepsEx = _wepsEx + [[_name,_type,_classname,_mags]]; }; if(_type != "unknown" && !(_type in ["PrimaryWeapon","SecondaryWeapon","Launcher"]) ) then { _itemsEx = _itemsEx + [[_name,_type,_classname]]; }; }; } foreach _weapons; { _configName = configName _x; _name = getText(configFile >> "CfgMagazines" >> _configName >> "displayname"); _picture = getText(configFile >> "CfgMagazines" >> _configName >> "picture"); if(_name != "" && _picture != "") then { _classname = _configName; _magsEx = _magsEx + [[_name,_classname]]; }; } foreach _magazines; { _configName = _x; _parents = [(configFile >> "CfgVehicles" >> _x), true] call BIS_fnc_returnParents; _name = getText(configFile >> "CfgVehicles" >> _configName >> "displayname"); _picture = getText(configFile >> "CfgVehicles" >> _configName >> "picture"); if(_name != "" && _picture != "" && !(isClass (configFile >> "CfgVehicles" >> _configName >> "TransportItems")) && "Bag_Base" in _parents) then { _backEx = _backEx + [[_name,_x]]; }; } foreach _backpacks; { _name = _x select 0; _type = _x select 1; @@ -90,4 +141,13 @@ diag_log text " </Magazine>"; diag_log text format [" <ClassName>%1</ClassName>",_classname]; diag_log text format [" <ItemType>%1</ItemType>",_type]; diag_log text " </Item>"; } foreach _itemEx { _name = _x select 0; _classname = _x select 1; diag_log text " <Item>"; diag_log text format [" <Name>%1</Name>",_name]; diag_log text format [" <ClassName>%1</ClassName>",_classname]; diag_log text " </Item>"; } foreach _backEx; -
headswe revised this gist
Sep 8, 2014 . 1 changed file with 12 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,10 +50,6 @@ _magazines = [configfile >> "CfgMagazines"] call BIS_fnc_returnChildren; { _name = _x select 0; _type = _x select 1; @@ -83,4 +79,15 @@ diag_log text " <Magazine>"; diag_log text format [" <Name>%1</Name>",_name]; diag_log text format [" <ClassName>%1</ClassName>",_classname]; diag_log text " </Magazine>"; } foreach _magsEx; { _name = _x select 0; _type = _x select 1; _classname = _x select 2; diag_log text " <Item>"; diag_log text format [" <Name>%1</Name>",_name]; diag_log text format [" <ClassName>%1</ClassName>",_classname]; diag_log text format [" <ItemType>%1</ItemType>",_type]; diag_log text " </Item>"; } foreach _itemEx -
headswe revised this gist
Sep 8, 2014 . 1 changed file with 75 additions and 77 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,88 +1,86 @@ _wepsEx = []; _itemsEx = []; _magsEx = []; _weapons = [configfile >> "CfgWeapons"] call BIS_fnc_returnChildren; { _configName = configName _x; _name = getText(configFile >> "CfgWeapons" >> _configName >> "displayname"); _picture = getText(configFile >> "CfgWeapons" >> _configName >> "picture"); if(_name != "" && _picture != "" && !(isClass (configFile >> "CfgWeapons" >> _configName >> "LinkedItems"))) then { _parents = [_x, true] call BIS_fnc_returnParents; _type = switch true do { case ("Rifle" in _parents): {"PrimaryWeapon"}; case ("Pistol" in _parents): {"SecondaryWeapon"}; case ("Launcher" in _parents): {"Launcher"}; case ("H_HelmetB" in _parents): {"HeadGear"}; case ("Uniform_Base" in _parents): {"Uniform"}; case ("Vest_Camo_Base" in _parents || "Vest_NoCamo_Base" in _parents): {"Vest"}; case ("ItemCore" in _parents || "DetectorCore" in _parents): {"CommonItem"}; case ("Binocular" in _parents): {"Binocular"}; default {"unknown"}; }; if(_type == "unknown") exitWith {}; _classname = _configName; _magazines = getArray(configFile >> "CfgWeapons" >> _configName >> "magazines"); if(_type in ["PrimaryWeapon","SecondaryWeapon","Launcher"]) then { _wepsEx = _wepsEx + [[_name,_type,_classname,_magazines]]; }; if(_type != "unknown" && !(_type in ["PrimaryWeapon","SecondaryWeapon","Launcher"]) ) then { _itemsEx = _itemsEx + [[_name,_type,_classname]]; }; }; } foreach _weapons; _magazines = [configfile >> "CfgMagazines"] call BIS_fnc_returnChildren; { _configName = configName _x; _name = getText(configFile >> "CfgMagazines" >> _configName >> "displayname"); _picture = getText(configFile >> "CfgMagazines" >> _configName >> "picture"); if(_name != "" && _picture != "") then { _type = "CommonItem"; _classname = _configName; _magsEx = _magsEx + [[_name,_classname]]; }; } foreach _magazines; weps = _wepsEx; item = _itemsEx; mags = _magsEx; { _name = _x select 0; _type = _x select 1; _classname = _x select 2; _magazines = _x select 3; diag_log text " <Weapon>"; diag_log text format [" <Name>%1</Name>",_name]; diag_log text format [" <ClassName>%1</ClassName>",_classname]; diag_log text format [" <WeaponType>%1</WeaponType>",_type]; if(count _magazines > 0) then { diag_log text " <Magazines>"; { diag_log text " <Magazine>"; diag_log text format[" <ClassName>%1</ClassName>",_x]; diag_log text " </Magazine>"; } foreach _magazines; diag_log text " </Magazines>"; }; diag_log text " </Weapon>"; } foreach _wepsEx; { _name = _x select 0; _classname = _x select 1; diag_log text " <Magazine>"; diag_log text format [" <Name>%1</Name>",_name]; diag_log text format [" <ClassName>%1</ClassName>",_classname]; diag_log text " </Magazine>"; } foreach _magsEx; -
harakka revised this gist
Jan 26, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -69,7 +69,7 @@ diag_log text("type;cfgName;name;mass;capacity;armor;passthrough;mags;parents;cf _armor = switch _type do { case "helmet"; case "uniform"; case "vest": {getNumber(_cfgPath >> "ItemInfo" >> "armor")}; default {"N/A"}; }; -
harakka revised this gist
Oct 4, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ _allCfgs = []; { for "_i" from 0 to ((count _x) -1) do { _item = _x select _i; _cfgName = configName(_item); if (isClass _item && getText(_x >> _cfgName >> "displayName") != "" && getText(_x >> _cfgName >> "picture") != "") then { -
harakka renamed this gist
Oct 4, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
harakka created this gist
Oct 4, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,88 @@ // todo: figure out common class for bipod/tripod _allCfgs = []; { for "_i" from 0 to ((count _x) -1) do { _item = _x select _i; _cfgName = configName(_item); if (isClass _item && getText(_x >> _cfgName >> "displayName") != "" && getText(_x >> _cfgName >> "picture") != "") then { _allCfgs = _allCfgs + [([_item] call BIS_fnc_configPath)]; }; }; } forEach [configFile >> "CfgWeapons", configFile >> "CfgVehicles", configFile >> "CfgMagazines"]; diag_log text("type;cfgName;name;mass;capacity;armor;passthrough;mags;parents;cfgFullName"); { _cfgPath = [_x] call BIS_fnc_configPath; //_item = _cfgs select _i; _cfgName = configName(_cfgPath); _cfgFullName = [_x, "STRING"] call BIS_fnc_configPath; _parents = [_cfgPath, true] call BIS_fnc_returnParents; _type = switch true do { case ("Rifle" in _parents): {"rifle"}; case ("Pistol" in _parents): {"pistol"}; case ("Launcher" in _parents): {"launcher"}; case ("H_HelmetB" in _parents): {"helmet"}; case ("Uniform_Base" in _parents): {"uniform"}; case ("Vest_Camo_Base" in _parents || "Vest_NoCamo_Base" in _parents): {"vest"}; case ("Weapon_Bag_Base" in _parents): {"bag_static"}; case ("Bag_Base" in _parents): {"bag"}; case ("HandGrenade" in _parents): {"grenade"}; case ("CA_Magazine" in _parents && !("VehicleMagazine" in _parents)): {"magazine"}; case ("CA_LauncherMagazine" in _parents): {"launcherammo"}; case ("ItemCore" in _parents || "DetectorCore" in _parents || "Binocular" in _parents): {"misc"}; default {"unknown"}; }; _name = getText(_cfgPath >> "displayName"); _desc = getText(_cfgPath >> "descriptionShort"); _icon = getText(_cfgPath >> "picture"); _mags = getArray(_cfgPath >> "magazines"); if (format["%1", _mags] == "[]") then {_mags = "N/A";}; _capacity = switch _type do { case "uniform"; case "vest": {parseNumber([getText(_cfgPath >> "ItemInfo" >> "containerClass"), 6] call BIS_fnc_trimString)}; case "bag": {getNumber(_cfgPath >> "maximumLoad")}; default {"N/A"}; }; _mass = switch _type do { case "magazine"; case "bag_static"; case "grenade"; case "launcherammo"; case "bag": {getNumber(_cfgPath >> "mass")}; case "helmet"; case "uniform"; case "vest"; case "misc": {getNumber(_cfgPath >> "ItemInfo" >> "mass")}; case "rifle"; case "pistol"; case "launcher": {getNumber(_cfgPath >> "WeaponSlotsInfo" >> "mass")}; default {"N/A"}; }; _armor = switch _type do { case "helmet"; case "uniform"; case "vest": {getText(_cfgPath >> "ItemInfo" >> "armor")}; default {"N/A"}; }; _passthrough = switch _type do { case "helmet"; case "uniform"; case "vest": {getNumber(_cfgPath >> "ItemInfo" >> "passThrough")}; default {"N/A"}; }; if (_name != "" && _icon != "" && _type != "unknown") then { diag_log text(format["%1;%2;%3;%4;%5;%6;%7;%8;%9;%10", _type, _cfgName, _name, _mass, _capacity, _armor, _passthrough, _mags, _parents, _cfgFullName]); } } forEach _allCfgs; hint "Done!";