diff --git a/CHANGELOG.md b/CHANGELOG.md index 934514e..f4c6b0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project badly attempts [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.1.0] - 2023-12-17 + +### Added + +- Vehicles now have an ace interaction to allow the mounting of flags onto them for identification. Contributed by IndigoFox +- Added inventory validation checks +- Added empty group removal code due to ownership issues on entity transfers +- Added medical card visibility to medics for triage purposes + ## [3.0.2] - 2023-10-14 ### Changed diff --git a/functions/CfgFunctions.hpp b/functions/CfgFunctions.hpp index 7a8c4d5..55ba3b7 100644 --- a/functions/CfgFunctions.hpp +++ b/functions/CfgFunctions.hpp @@ -33,11 +33,14 @@ class milsim class bindVehicleActions { postInit = 1; }; class addClientStatsPFH {}; class calculateClientStats {}; + class initVehicleFlags { postInit = 1; }; + class bindEmptyGroupGarbageCleanup { postInit = 1; }; }; class server { class addServerStatsPFH {}; class calculateServerStats {}; + class logPlayerInventory {}; }; class resupply { diff --git a/functions/client/fn_bindEmptyGroupGarbageCleanup.sqf b/functions/client/fn_bindEmptyGroupGarbageCleanup.sqf new file mode 100644 index 0000000..7cb7771 --- /dev/null +++ b/functions/client/fn_bindEmptyGroupGarbageCleanup.sqf @@ -0,0 +1,23 @@ +diag_log text format ["[MILSIM] (client) initializing empty group deletion PFH"]; + +_emptyGroupPFH = [ + { + { + if (local _x) then { + if ((count units _x) == 0) then { + deleteGroup _x; + }; + }; + } forEach allGroups; + }, + 300, + [], + { diag_log text format ["[MILSIM] (client) Empty Group Deletion PFH loaded"] }, + { diag_log text format ["[MILSIM] (client) Empty Group Deletion"] }, + { true }, + { false }, + [] +] call CBA_fnc_createPerFrameHandlerObject; + + + diff --git a/functions/client/fn_bindEventHandlers.sqf b/functions/client/fn_bindEventHandlers.sqf index 3cb0dd5..08a8cdf 100644 --- a/functions/client/fn_bindEventHandlers.sqf +++ b/functions/client/fn_bindEventHandlers.sqf @@ -38,6 +38,14 @@ addMissionEventHandler ["HandleChatMessage", ]; +["ace_arsenal_displayClosed", { + player remoteExec["milsim_fnc_logPlayerInventory", 0]; +}] call CBA_fnc_addEventHandler; + +[missionNamespace, "arsenalClosed", { + player remoteExec["milsim_fnc_logPlayerInventory", 0]; +}] call BIS_fnc_addScriptedEventHandler; + diag_log text "[MILSIM] (client) event handlers bound"; nil; \ No newline at end of file diff --git a/functions/client/fn_initVehicleFlags.sqf b/functions/client/fn_initVehicleFlags.sqf new file mode 100644 index 0000000..e6b06bc --- /dev/null +++ b/functions/client/fn_initVehicleFlags.sqf @@ -0,0 +1,190 @@ +milsim_vehicleflag_options = [ + ["Chevron IDs", [ + ["flag_chevron_id1", createHashMapFromArray [ + ["Title", "Flag 1"], + ["Texture", "textures\flag_number\flag_id_1_co.paa"] + ]], + ["flag_chevron_id2", createHashMapFromArray [ + ["Title", "Flag 2"], + ["Texture", "textures\flag_number\flag_id_2_co.paa"] + ]], + ["flag_chevron_id3", createHashMapFromArray [ + ["Title", "Flag 3"], + ["Texture", "textures\flag_number\flag_id_3_co.paa"] + ]], + ["flag_chevron_id4", createHashMapFromArray [ + ["Title", "Flag 4"], + ["Texture", "textures\flag_number\flag_id_4_co.paa"] + ]], + ["flag_chevron_id5", createHashMapFromArray [ + ["Title", "Flag 5"], + ["Texture", "textures\flag_number\flag_id_5_co.paa"] + ]], + ["flag_chevron_id6", createHashMapFromArray [ + ["Title", "Flag 6"], + ["Texture", "textures\flag_number\flag_id_6_co.paa"] + ]], + ["flag_chevron_id7", createHashMapFromArray [ + ["Title", "Flag 7"], + ["Texture", "textures\flag_number\flag_id_7_co.paa"] + ]], + ["flag_chevron_id8", createHashMapFromArray [ + ["Title", "Flag 8"], + ["Texture", "textures\flag_number\flag_id_8_co.paa"] + ]], + ["flag_chevron_id9", createHashMapFromArray [ + ["Title", "Flag 9"], + ["Texture", "textures\flag_number\flag_id_9_co.paa"] + ]], + ["flag_chevron_id10", createHashMapFromArray [ + ["Title", "Flag 10"], + ["Texture", "textures\flag_number\flag_id_10_co.paa"] + ]], + ["flag_chevron_hq", createHashMapFromArray [ + ["Title", "Flag HQ"], + ["Texture", "textures\flag_number\flag_id_hq_co.paa"] + ]] + ]], + ["Simple Shapes", [ + ["flag_simpleshape_greenoctagon", createHashMapFromArray [ + ["Title", "Green Octagon"], + ["Texture", "textures\simple_shape\flag_simpleshape_greenoctagon_co.paa"] + ]], + ["flag_simpleshape_bluecircle", createHashMapFromArray [ + ["Title", "Blue Circle"], + ["Texture", "textures\simple_shape\flag_simpleshape_bluecircle_co.paa"] + ]], + ["flag_simpleshape_orangesquare", createHashMapFromArray [ + ["Title", "Orange Square"], + ["Texture", "textures\simple_shape\flag_simpleshape_orangesquare_co.paa"] + ]], + ["flag_simpleshape_pinktriangle", createHashMapFromArray[ + ["Title", "Pink Triangle"], + ["Texture", "textures\simple_shape\flag_simpleshape_pinktriangle_co.paa"] + ]], + ["flag_simpleshape_redpentagon", createHashMapFromArray [ + ["Title", "Red Pentagon"], + ["Texture", "textures\simple_shape\flag_simpleshape_redpentagon_co.paa"] + ]] + ]], + ["Miscellaneous", [ + ["flag_17th_emblem", createHashMapFromArray [ + ["Title", "17th Emblem"], + ["Texture", "textures\flags_misc\flag_17th_emblem_co.paa"] + ]], + ["flag_redcross", createHashMapFromArray [ + ["Title", "Red Cross"], + ["Texture", "textures\flags_misc\flag_redcross_co.paa"] + ]] + ]] +]; + + + +["AllVehicles", "InitPost", { + private _flagActionID = "SetVehicleFlag"; + private _flagMasterAction = [ + _flagActionID, // id + "Set Vehicle Flag", // displayed title + "\A3\ui_f\data\map\markers\flags\nato_ca.paa", // flag icon + {true}, // statement + {true}, // condition + { + params ["_target", "_player", "_params"]; + private _flagActionID = _params#0; + private _actions = []; + { + _x params ["_flagCategory", "_flagOptions"]; + // diag_log format ["NewFlagCategory: %1 %2", _flagCategory, _flagOptions]; + + private _flagCategoryOption = [ + _flagActionID + "_" + _flagCategory, // id + _flagCategory, // displayed title + (_flagOptions#0#1) get "Texture", // flag icon + {true}, // statement + { + params ["_target", "_player", "_params"]; + alive _target; + // true; + }, // condition + { + params ["_target", "_player", "_params"]; + _params params ["_flagActionID", "_flagCategoryID", "_flagOptions"]; + private _categoryOptions = []; + { + _x params ["_flagOptionID", "_flagOptionData"]; + // diag_log format ["NewFlagOption: %1 %2", _flagOptionID, _flagOptionData]; + private _newFlagOption = [ + _flagActionID + "_" + _flagCategory + "_" + _flagOptionID, // id + _flagOptionData get "Title", // displayed title + _flagOptionData get "Texture", // flag icon + { + params ["_target", "_player", "_params"]; + _target forceFlagTexture (_params select 2); + }, // statement + { + params ["_target", "_player", "_params"]; + alive _target; + // true; + }, // condition + nil, // child code + [_flagActionID, _flagCategoryID, getMissionPath (_flagOptionData get "Texture")], // params + nil, // position + 4, // distance + [false, false, false, false, false] // other params + ] call ace_interact_menu_fnc_createAction; + _categoryOptions pushBack [_newFlagOption, [], _target]; + } forEach _flagOptions; + _categoryOptions; + }, // child code + [_flagActionID, _flagCategoryID, _flagOptions], // params + nil, // position + 4, // distance + [false, false, false, false, false], // other params + nil // modifier function code + ] call ace_interact_menu_fnc_createAction; + + _actions pushBack [_flagCategoryOption, [], _target]; + } forEach milsim_vehicleflag_options; + + _actions; + }, // child code + [_flagActionID], // params + nil, // position + 4, // distance + [false, false, false, false, false], // other params + nil // modifier function code + ] call ace_interact_menu_fnc_createAction; + + // add action to add flag + [ + (_this select 0), // object + 0, // action 0 or self-action 1 + ["ACE_MainActions"], // parent + _flagMasterAction // action + ] call ace_interact_menu_fnc_addActionToObject; + + + // add action to remove flag + private _removeFlagAction = [ + _flagActionID + "_removeflag", // id + "Remove Flag", // displayed title + "\A3\ui_f\data\map\markers\flags\nato_ca.paa", // flag icon + { + params ["_target", "_player", "_params"]; + _target forceFlagTexture ""; + }, // statement + {true}, // condition + nil // child code + ] call ace_interact_menu_fnc_createAction; + + [ + (_this select 0), // object + 0, // action 0 or self-action 1 + ["ACE_MainActions", _flagActionID], // parent + _removeFlagAction // action + ] call ace_interact_menu_fnc_addActionToObject; + +}, true, [], true] call CBA_fnc_addClassEventHandler; + +nil; \ No newline at end of file diff --git a/functions/server/fn_logPlayerInventory.sqf b/functions/server/fn_logPlayerInventory.sqf new file mode 100644 index 0000000..3e3f2f8 --- /dev/null +++ b/functions/server/fn_logPlayerInventory.sqf @@ -0,0 +1,40 @@ + +params [ + ["_player", objNull, [objNull]] +]; + +if (!isPlayer _player) exitWith { diag_log("exitWith inventotry")}; + +_items = []; +_items append uniformItems _player; +_items append vestItems _player; +_items append backpackItems _player; +_items pushback hmd _player; +_items pushback binocular _player; +_items append primaryWeaponItems _player; + +{ + _item = _x; + _modes = getArray(configfile >> "CfgWeapons" >> _item >> "visionMode"); + + _subModes = [configfile >> "CfgWeapons" >> _item >> "ItemInfo" >> "OpticsModes", 1] call BIS_fnc_returnChildren; + + { + _modes append getArray( _x >> "visionMode" ); + } forEach _subModes; + + _restrictedItemList = ["A3_GPNVG18b_REC_TI","A3_GPNVG18_REC_TI","A3_GPNVG18b_TI","A3_GPNVG18_TI","A3_GPNVG18b_REC_BLK_TI","A3_GPNVG18_REC_BLK_TI","A3_GPNVG18b_BLK_TI","A3_GPNVG18_BLK_TI","NVGogglesB_gry_F","NVGogglesB_grn_F","NVGogglesB_blk_F","optic_Nightstalker","rhsusf_acc_anpas13gv1","Tier1_ANPVS10_Tan","rhsusf_acc_anpvs27","optic_tws_mg","optic_tws"]; + + if ( _x in _restrictedItemList ) then { + diag_log text format["[MILSIM] (logPlayerInventory): %1 has a restricted inventory item: %2", name _player, getText( configfile >> "CfgWeapons" >> _item >> "displayName" )]; + } else if ((count _modes) isNotEqualTo 0) then { + _modes = _modes apply { toLower _x }; + if ( "ti" in _modes ) then { + diag_log text format["[MILSIM] (logPlayerInventory): %1 has an unlisted thermal item: %2", name _player, getText( configfile >> "CfgWeapons" >> _item >> "displayName" )]; + }; + } else { + diag_log text format["[MILSIM] (logPlayerInventory): %1 inventory in compliance", name _player]; + } +} forEach _items; + +nil \ No newline at end of file diff --git a/functions/settings/fn_addCBASettings.sqf b/functions/settings/fn_addCBASettings.sqf index 73395d2..410896d 100644 --- a/functions/settings/fn_addCBASettings.sqf +++ b/functions/settings/fn_addCBASettings.sqf @@ -6,7 +6,7 @@ "milsim_sideChat", "CHECKBOX", "Side Chat Text Enabled", - ["17th Batallion", "Side Chat"], + ["17th Battallion", "Side Chat"], false, true, { @@ -25,7 +25,7 @@ "milsim_server_cps_enable", "CHECKBOX", "CPS Metrics Enabled", - ["17th Batallion", "Server Metrics"], + ["17th Battallion", "Server Metrics"], true, true, { @@ -40,7 +40,7 @@ "milsim_server_cps_interval", "TIME", "Metrics Interval", - ["17th Batallion", "Server Metrics"], + ["17th Battallion", "Server Metrics"], [60,300,120], true, { @@ -71,7 +71,7 @@ "milsim_client_cps_enable", "CHECKBOX", "CPS Metrics Enabled", - ["17th Batallion", "Client Metrics"], + ["17th Battallion", "Client Metrics"], true, true, { @@ -86,7 +86,7 @@ "milsim_client_cps_interval", "TIME", "CPS Metrics Interval", - ["17th Batallion", "Client Metrics"], + ["17th Battallion", "Client Metrics"], [60,300,120], true, { diff --git a/mission_settings.hpp b/mission_settings.hpp index cba1a69..d7c80d5 100644 --- a/mission_settings.hpp +++ b/mission_settings.hpp @@ -6,6 +6,8 @@ onLoadMission = "THIS APPEARS BELOW THE LOADING SCREEN IMAGE"; briefingName = "THIS IS THE NAME ON THE #MISSIONS LIST"; overviewText = "THIS IS WHERE YOU DESCRIBE THE MISSION IN THE #MISSION LIST"; +missionSeries = ""; + // activate via #ace-fortify west base 2000 class ACEX_Fortify_Presets { diff --git a/textures/flag_number/flag_id_10_co.paa b/textures/flag_number/flag_id_10_co.paa new file mode 100644 index 0000000..f121a89 Binary files /dev/null and b/textures/flag_number/flag_id_10_co.paa differ diff --git a/textures/flag_number/flag_id_1_co.paa b/textures/flag_number/flag_id_1_co.paa new file mode 100644 index 0000000..65bfc44 Binary files /dev/null and b/textures/flag_number/flag_id_1_co.paa differ diff --git a/textures/flag_number/flag_id_2_co.paa b/textures/flag_number/flag_id_2_co.paa new file mode 100644 index 0000000..2130faa Binary files /dev/null and b/textures/flag_number/flag_id_2_co.paa differ diff --git a/textures/flag_number/flag_id_3_co.paa b/textures/flag_number/flag_id_3_co.paa new file mode 100644 index 0000000..366b6a3 Binary files /dev/null and b/textures/flag_number/flag_id_3_co.paa differ diff --git a/textures/flag_number/flag_id_4_co.paa b/textures/flag_number/flag_id_4_co.paa new file mode 100644 index 0000000..d6ce46c Binary files /dev/null and b/textures/flag_number/flag_id_4_co.paa differ diff --git a/textures/flag_number/flag_id_5_co.paa b/textures/flag_number/flag_id_5_co.paa new file mode 100644 index 0000000..33879bc Binary files /dev/null and b/textures/flag_number/flag_id_5_co.paa differ diff --git a/textures/flag_number/flag_id_6_co.paa b/textures/flag_number/flag_id_6_co.paa new file mode 100644 index 0000000..c102933 Binary files /dev/null and b/textures/flag_number/flag_id_6_co.paa differ diff --git a/textures/flag_number/flag_id_7_co.paa b/textures/flag_number/flag_id_7_co.paa new file mode 100644 index 0000000..314c5d9 Binary files /dev/null and b/textures/flag_number/flag_id_7_co.paa differ diff --git a/textures/flag_number/flag_id_8_co.paa b/textures/flag_number/flag_id_8_co.paa new file mode 100644 index 0000000..de0eafe Binary files /dev/null and b/textures/flag_number/flag_id_8_co.paa differ diff --git a/textures/flag_number/flag_id_9_co.paa b/textures/flag_number/flag_id_9_co.paa new file mode 100644 index 0000000..bd78305 Binary files /dev/null and b/textures/flag_number/flag_id_9_co.paa differ diff --git a/textures/flag_number/flag_id_hq_co.paa b/textures/flag_number/flag_id_hq_co.paa new file mode 100644 index 0000000..4f2238c Binary files /dev/null and b/textures/flag_number/flag_id_hq_co.paa differ diff --git a/textures/flags_misc/flag_17th_emblem_co.paa b/textures/flags_misc/flag_17th_emblem_co.paa new file mode 100644 index 0000000..8d300ce Binary files /dev/null and b/textures/flags_misc/flag_17th_emblem_co.paa differ diff --git a/textures/flags_misc/flag_redcross_co.paa b/textures/flags_misc/flag_redcross_co.paa new file mode 100644 index 0000000..1a3056b Binary files /dev/null and b/textures/flags_misc/flag_redcross_co.paa differ diff --git a/textures/simple_shape/flag_simpleshape_bluecircle_co.paa b/textures/simple_shape/flag_simpleshape_bluecircle_co.paa new file mode 100644 index 0000000..58e6d42 Binary files /dev/null and b/textures/simple_shape/flag_simpleshape_bluecircle_co.paa differ diff --git a/textures/simple_shape/flag_simpleshape_greenoctagon_co.paa b/textures/simple_shape/flag_simpleshape_greenoctagon_co.paa new file mode 100644 index 0000000..e513171 Binary files /dev/null and b/textures/simple_shape/flag_simpleshape_greenoctagon_co.paa differ diff --git a/textures/simple_shape/flag_simpleshape_orangesquare_co.paa b/textures/simple_shape/flag_simpleshape_orangesquare_co.paa new file mode 100644 index 0000000..7b12c21 Binary files /dev/null and b/textures/simple_shape/flag_simpleshape_orangesquare_co.paa differ diff --git a/textures/simple_shape/flag_simpleshape_pinktriangle_co.paa b/textures/simple_shape/flag_simpleshape_pinktriangle_co.paa new file mode 100644 index 0000000..7fe2735 Binary files /dev/null and b/textures/simple_shape/flag_simpleshape_pinktriangle_co.paa differ diff --git a/textures/simple_shape/flag_simpleshape_redpentagon_co.paa b/textures/simple_shape/flag_simpleshape_redpentagon_co.paa new file mode 100644 index 0000000..d6fcac8 Binary files /dev/null and b/textures/simple_shape/flag_simpleshape_redpentagon_co.paa differ