From 4cb0625f01c9128d329ad952e1840d38e46e6fbf Mon Sep 17 00:00:00 2001 From: IT07 Date: Tue, 19 Jul 2016 21:30:51 +0200 Subject: [PATCH] Config changes/tweaks --- CHANGELOG.md | 3 ++ a3_vemf_reloaded/sqf/checkClasses.sqf | 49 +++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 a3_vemf_reloaded/sqf/checkClasses.sqf diff --git a/CHANGELOG.md b/CHANGELOG.md index 30892e0..21a9db7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ **[TWEAKED]** crate loot settings
**[TWEAKED]** config comments
**[TWEAKED]** VEMFr startup RPT output
+**[TWEAKED]** respect handling of AI kills
+**[TWEAKED]** checkClasses.sqf
+
#### `v0750.1` diff --git a/a3_vemf_reloaded/sqf/checkClasses.sqf b/a3_vemf_reloaded/sqf/checkClasses.sqf new file mode 100644 index 0000000..0daf1a4 --- /dev/null +++ b/a3_vemf_reloaded/sqf/checkClasses.sqf @@ -0,0 +1,49 @@ +/* + Author: IT07 + + Description: + checks the VEMF loot table for invalid classnames. Reports to RPT if invalid classes found. + + Params: + none + + Returns: + nothing +*/ + +if (("validateLoot" call VEMFr_fnc_config) isEqualTo 1) then +{ // _validateLoot is enabled, go ahead... + if (("debugMode" call VEMFr_fnc_config) < 1) then { ["checkLoot", 0, "Can not validate classnames: no output allowed in RPT"] ExecVM ("log" call VEMFr_fnc_scriptPath) } + else + { + ["checkLoot",1,"Validating VEMFr config classes..."] ExecVM ("log" call VEMFr_fnc_scriptPath); + uiSleep 0.5; + _bin = []; + _cfgMags = []; + "_cfgMags pushBack (toLower (configName _x)); true" configClasses (configFile >> "cfgMagazines"); + + _cfgWpns = []; + "_cfgWpns pushBack (toLower (configName _x)); true" configClasses (configFile >> "cfgWeapons"); + + _cfgBags = "(toLower (getText (_x >> 'vehicleClass'))) isEqualTo 'backpacks'" configClasses (configFile >> "cfgVehicles"); + { _cfgBags set [_forEachIndex, toLower (configName _x)] } forEach _cfgBags; + + _cfgGlasses = []; + "_cfgGlasses pushBack (toLower (configName _x)); true" configClasses (configFile >> "CfgGlasses"); + + if (("Apex" call VEMFr_fnc_modAppID) in (getDLCs 1)) then + { + { { if not(((toLower _x) in _cfgMags) OR ((toLower _x) in _cfgWpns) OR ((toLower _x) in _cfgBags) OR ((toLower _x) in _cfgGlasses)) then { _bin pushBack (toLower _x) } } forEach _x } forEach ([["aiInventory","ApexBandits"],["backpacks","faceWear","headGear","launchers","rifles","uniforms","vests"]] call VEMFr_fnc_config); + { { if not(((toLower _x) in _cfgMags) OR ((toLower _x) in _cfgWpns) OR ((toLower _x) in _cfgBags) OR ((toLower _x) in _cfgGlasses)) then { _bin pushBack (toLower _x) } } forEach _x } forEach ([["aiInventory","Gendarmerie"],["headGear","faceWear","pistols","rifles","uniforms","vests"]] call VEMFr_fnc_config); + { { _x0 = toLower (_x select 0); if not((_x0 in _cfgMags) OR (_x0 in _cfgWpns) OR (_x0 in _cfgBags) OR (_x in _cfgGlasses)) then { _bin pushBack (toLower _x) } } forEach _x } forEach ([["missionSettings","DynamicLocationInvasion","crateLootApex"],["attachments","backpacks","headGear","headGearSpecial","magazines","pistols","rifles","vests"]] call VEMFr_fnc_config); + }; + { { if not(((toLower _x) in _cfgMags) OR ((toLower _x) in _cfgWpns) OR ((toLower _x) in _cfgBags) OR ((toLower _x) in _cfgGlasses)) then { _bin pushBack (toLower _x) } } forEach _x } forEach ([["aiInventory","Guerilla"],["backpacks","headGear","launchers","pistols","rifles","uniforms","vests"]] call VEMFr_fnc_config); + { { if not(((toLower _x) in _cfgMags) OR ((toLower _x) in _cfgWpns) OR ((toLower _x) in _cfgBags) OR ((toLower _x) in _cfgGlasses)) then { _bin pushBack (toLower _x) } } forEach _x } forEach ([["aiInventory","PoliceRegular"],["headGear","pistols","rifles","uniforms","vests"]] call VEMFr_fnc_config); + { { if not(((toLower _x) in _cfgMags) OR ((toLower _x) in _cfgWpns) OR ((toLower _x) in _cfgBags) OR ((toLower _x) in _cfgGlasses)) then { _bin pushBack (toLower _x) } } forEach _x } forEach ([["aiInventory","PoliceSpecialForces"],["faceWear","headGear","pistols","rifles","uniforms","vests"]] call VEMFr_fnc_config); + + { { _x0 = toLower (_x select 0); if not((_x0 in _cfgMags) OR (_x0 in _cfgWpns) OR (_x0 in _cfgBags) OR (_x in _cfgGlasses)) then { _bin pushBack _x } } forEach _x } forEach ([["missionSettings","DynamicLocationInvasion","crateLootVanilla"],["attachments","backpacks","headGear",format["itemsLoot%1", call VEMFr_fnc_whichMod],"magazines","pistols","rifles","vests"]] call VEMFr_fnc_config); + + if ((count _bin) isEqualTo 0) then { ["checkLoot", 1, "All classnames are valid! :)"] ExecVM ("log" call VEMFr_fnc_scriptPath) } + else { ["checkLoot",0,format["Invalid classes found in config! | %1", _bin]] ExecVM ("log" call VEMFr_fnc_scriptPath) }; + }; + };