From ab42eb847a3738675084ae25c8d9d70d6bf6afa3 Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Thu, 2 Nov 2023 09:55:29 +0100 Subject: [PATCH 1/8] Added eventhandler and function to allow creation of zeus on loadouts --- .../functions/init/fn_init_eventHandlers.sqf | 5 +++- .../systems/fn_player_createCurator.sqf | 29 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 cScripts/functions/systems/fn_player_createCurator.sqf diff --git a/cScripts/functions/init/fn_init_eventHandlers.sqf b/cScripts/functions/init/fn_init_eventHandlers.sqf index 51dafb69a..d15e75180 100644 --- a/cScripts/functions/init/fn_init_eventHandlers.sqf +++ b/cScripts/functions/init/fn_init_eventHandlers.sqf @@ -58,4 +58,7 @@ INFO("InitEventHandlers","Creating Server EventHandlers"); missionNamespace setVariable [QEGVAR(log,players), _playerLog]; }] call CBA_fnc_addEventHandler; - +[QEGVAR(curator,create), { + _this params ["_player"]; + [_player] call EFUNC(player,createCurator); +}] call CBA_fnc_addEventHandler; diff --git a/cScripts/functions/systems/fn_player_createCurator.sqf b/cScripts/functions/systems/fn_player_createCurator.sqf new file mode 100644 index 000000000..0385b2969 --- /dev/null +++ b/cScripts/functions/systems/fn_player_createCurator.sqf @@ -0,0 +1,29 @@ +#include "..\script_component.hpp"; +/* + * Author: SGT.Brostrom.A + * This function creates a zeus and attaches it for the for a defined player + * + * Arguments: + * 0: Player + * + * Example: + * cScripts_fnc_player_createCurator + * + * Public: No + */ + +params [ + ["_player", player, [objNull]] +]; + +if (!isServer) exitWith {}; +if (!isNull (getAssignedCuratorLogic _player)) exitWith { WARNING("Zeus", "Player already assigned as curator"); }; + + +private _curator = "curator" createVehicle [0,0,0]; +_curator addCuratorAddons activatedAddons; +_player assignCurator _curator; + +SHOW_INFO_CHAT_2("Zeus", "Curator created for %1 [%2]", player, typeOf _player); + +_curator addCuratorEditableObjects [[allPlayers], true]; \ No newline at end of file From df8f526f3c994797bc33f467a00c3bd00a21b86c Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Tue, 31 Oct 2023 09:20:41 +0100 Subject: [PATCH 2/8] Added loadouts --- cScripts/CfgLoadouts.hpp | 1 + cScripts/Loadouts/CfgLoadouts_Special.hpp | 38 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 cScripts/Loadouts/CfgLoadouts_Special.hpp diff --git a/cScripts/CfgLoadouts.hpp b/cScripts/CfgLoadouts.hpp index 8fe47ec13..0237ffe2d 100644 --- a/cScripts/CfgLoadouts.hpp +++ b/cScripts/CfgLoadouts.hpp @@ -13,6 +13,7 @@ class CfgLoadouts { #include "Loadouts\CfgLoadouts_Charlie_Weapon.hpp" #include "Loadouts\CfgLoadouts_Training.hpp" + #include "Loadouts\CfgLoadouts_Special.hpp" #include "Loadouts\CfgLoadouts_UserCustom.hpp" }; diff --git a/cScripts/Loadouts/CfgLoadouts_Special.hpp b/cScripts/Loadouts/CfgLoadouts_Special.hpp new file mode 100644 index 000000000..a910d5400 --- /dev/null +++ b/cScripts/Loadouts/CfgLoadouts_Special.hpp @@ -0,0 +1,38 @@ +class S3_Base: Cav_B_Seventh_Cavalry_Base_F { + displayName = "S3 Mission Control"; + category[] = {}; + scope = 2; + loadout = [["rhs_weap_m4a1_blockII_bk","ACE_muzzle_mzls_L","acc_pointer_IR","rhsusf_acc_ACOG_RMR",["ACE_30Rnd_556x45_Stanag_M995_AP_mag",30],[],"rhsusf_acc_rvg_blk"],[],["rhs_weap_M320","","","",["ACE_HuntIR_M203",1],[],""],["USP_G3C_RS2_MC",[["ACE_tourniquet",4],["ItemcTabHCam",1],["ACE_MapTools",1],["ACE_IR_Strobe_Item",2],["ACE_microDAGR",1],["ACE_splint",4],["ACE_Flashlight_XL50",1],["kat_Painkiller",2,10],["SmokeShellPurple",2,1],["Laserbatteries",1,1]]],["rhsusf_plateframe_grenadier",[["ACE_packingBandage",20],["ACE_IR_Strobe_Item",2],["rhs_mag_M664_red_cluster",2,1],["1Rnd_SmokeRed_Grenade_shell",2,1],["1Rnd_SmokeBlue_Grenade_shell",2,1],["ACE_HuntIR_M203",2,1],["ACE_30Rnd_556x45_Stanag_M995_AP_mag",6,30],["ACE_HandFlare_Green",2,1],["SmokeShellBlue",2,1],["SmokeShellRed",2,1]]],["USP_TACTICAL_PACK_CCT7",[["Rev_darter_item",1],["ACE_HuntIR_monitor",1],["ACE_EntrenchingTool",1],["ACE_UAVBattery",1],["Laserbatteries",1,1],[["ACE_Vector","","","",[],[],""],1]]],"rhsusf_opscore_mc_cover_pelt_cam","rhsusf_shemagh2_gogg_grn",["Laserdesignator","","","",["Laserbatteries",1],[],""],["ItemMap","ItemcTab","","ItemCompass","ItemWatch","USP_PVS15"]]; + role = "officer"; + + company = ""; + + insignia = "specialized_s3"; + preLoadout = "this setVariable ["cScripts_Player_Unit", "S3"];"; + postLoadout = ""; +}; + +class S3 : S3_Base { scope = 1; }; + +class S3_1 : S3_Base { scope = 1; }; +class S3_2 : S3_Base { scope = 1; }; +class S3_3 : S3_Base { scope = 1; }; +class S3_4 : S3_Base { scope = 1; }; +class S3_5 : S3_Base { scope = 1; }; +class S3_6 : S3_Base { scope = 1; }; +class S3_7 : S3_Base { scope = 1; }; +class S3_8 : S3_Base { scope = 1; }; + +class S3_1_1 : S3_Base { scope = 1; }; +class S3_2_1 : S3_Base { scope = 1; }; +class S3_3_1 : S3_Base { scope = 1; }; +class S3_4_1 : S3_Base { scope = 1; }; +class S3_5_1 : S3_Base { scope = 1; }; +class S3_6_1 : S3_Base { scope = 1; }; + +class S3_1_2 : S3_Base { scope = 1; }; +class S3_2_2 : S3_Base { scope = 1; }; +class S3_3_2 : S3_Base { scope = 1; }; +class S3_4_2 : S3_Base { scope = 1; }; +class S3_5_2 : S3_Base { scope = 1; }; +class S3_6_2 : S3_Base { scope = 1; }; \ No newline at end of file From ffb3e949db79e741f26789e9aff11bd7e879318e Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Thu, 2 Nov 2023 09:56:57 +0100 Subject: [PATCH 3/8] fixed quotes --- cScripts/Loadouts/CfgLoadouts_Special.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cScripts/Loadouts/CfgLoadouts_Special.hpp b/cScripts/Loadouts/CfgLoadouts_Special.hpp index a910d5400..071aa7163 100644 --- a/cScripts/Loadouts/CfgLoadouts_Special.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Special.hpp @@ -8,7 +8,7 @@ class S3_Base: Cav_B_Seventh_Cavalry_Base_F { company = ""; insignia = "specialized_s3"; - preLoadout = "this setVariable ["cScripts_Player_Unit", "S3"];"; + preLoadout = "this setVariable ['cScripts_Player_Unit', 'S3'];"; postLoadout = ""; }; From fff7dfcdd30359c8c4bfb2272bc4855b3895a87a Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Thu, 2 Nov 2023 10:12:23 +0100 Subject: [PATCH 4/8] Merged in and updated functions --- cScripts/CfgFunctions.hpp | 1 + cScripts/Loadouts/CfgLoadouts_Special.hpp | 8 +++----- cScripts/functions/init/fn_init_eventHandlers.sqf | 4 ++-- .../{fn_player_createCurator.sqf => fn_createCurator.sqf} | 6 +++++- 4 files changed, 11 insertions(+), 8 deletions(-) rename cScripts/functions/systems/{fn_player_createCurator.sqf => fn_createCurator.sqf} (78%) diff --git a/cScripts/CfgFunctions.hpp b/cScripts/CfgFunctions.hpp index 31b499ef4..0b9052a41 100644 --- a/cScripts/CfgFunctions.hpp +++ b/cScripts/CfgFunctions.hpp @@ -129,6 +129,7 @@ class cScripts { class doGetOutHeloSide {}; class addObjectToCurator {}; + class createCurator {}; class getChannelName {}; class clearRadioIds {}; diff --git a/cScripts/Loadouts/CfgLoadouts_Special.hpp b/cScripts/Loadouts/CfgLoadouts_Special.hpp index 071aa7163..4fa391ad6 100644 --- a/cScripts/Loadouts/CfgLoadouts_Special.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Special.hpp @@ -8,8 +8,8 @@ class S3_Base: Cav_B_Seventh_Cavalry_Base_F { company = ""; insignia = "specialized_s3"; - preLoadout = "this setVariable ['cScripts_Player_Unit', 'S3'];"; - postLoadout = ""; + preLoadout = "player setVariable ['cScripts_Player_Unit', 'S3'];"; + postLoadout = "['cScripts_Curator_Create', [player]] call CBA_fnc_serverEvent;"; }; class S3 : S3_Base { scope = 1; }; @@ -20,8 +20,6 @@ class S3_3 : S3_Base { scope = 1; }; class S3_4 : S3_Base { scope = 1; }; class S3_5 : S3_Base { scope = 1; }; class S3_6 : S3_Base { scope = 1; }; -class S3_7 : S3_Base { scope = 1; }; -class S3_8 : S3_Base { scope = 1; }; class S3_1_1 : S3_Base { scope = 1; }; class S3_2_1 : S3_Base { scope = 1; }; @@ -35,4 +33,4 @@ class S3_2_2 : S3_Base { scope = 1; }; class S3_3_2 : S3_Base { scope = 1; }; class S3_4_2 : S3_Base { scope = 1; }; class S3_5_2 : S3_Base { scope = 1; }; -class S3_6_2 : S3_Base { scope = 1; }; \ No newline at end of file +class S3_6_2 : S3_Base { scope = 1; }; diff --git a/cScripts/functions/init/fn_init_eventHandlers.sqf b/cScripts/functions/init/fn_init_eventHandlers.sqf index d15e75180..385b3e99e 100644 --- a/cScripts/functions/init/fn_init_eventHandlers.sqf +++ b/cScripts/functions/init/fn_init_eventHandlers.sqf @@ -58,7 +58,7 @@ INFO("InitEventHandlers","Creating Server EventHandlers"); missionNamespace setVariable [QEGVAR(log,players), _playerLog]; }] call CBA_fnc_addEventHandler; -[QEGVAR(curator,create), { +[QEGVAR(Curator,Create), { _this params ["_player"]; - [_player] call EFUNC(player,createCurator); + [_player] call FUNC(createCurator); }] call CBA_fnc_addEventHandler; diff --git a/cScripts/functions/systems/fn_player_createCurator.sqf b/cScripts/functions/systems/fn_createCurator.sqf similarity index 78% rename from cScripts/functions/systems/fn_player_createCurator.sqf rename to cScripts/functions/systems/fn_createCurator.sqf index 0385b2969..70b0ebf96 100644 --- a/cScripts/functions/systems/fn_player_createCurator.sqf +++ b/cScripts/functions/systems/fn_createCurator.sqf @@ -7,7 +7,7 @@ * 0: Player * * Example: - * cScripts_fnc_player_createCurator + * cScripts_fnc_createCurator * * Public: No */ @@ -19,6 +19,10 @@ params [ if (!isServer) exitWith {}; if (!isNull (getAssignedCuratorLogic _player)) exitWith { WARNING("Zeus", "Player already assigned as curator"); }; +private _unit = _player getVariable [QEGVAR(Player,Unit), ""]; +_unit = toLower _unit; +if (!(_unit in ["s3", "zeus", "curator", "debug"])) exitWith {} + private _curator = "curator" createVehicle [0,0,0]; _curator addCuratorAddons activatedAddons; From e31df083bf89a2592f6bc0a0543f7325b7d83c9b Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Thu, 2 Nov 2023 10:14:20 +0100 Subject: [PATCH 5/8] fixed semicolon --- cScripts/functions/systems/fn_createCurator.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cScripts/functions/systems/fn_createCurator.sqf b/cScripts/functions/systems/fn_createCurator.sqf index 70b0ebf96..6c2283670 100644 --- a/cScripts/functions/systems/fn_createCurator.sqf +++ b/cScripts/functions/systems/fn_createCurator.sqf @@ -21,7 +21,7 @@ if (!isNull (getAssignedCuratorLogic _player)) exitWith { WARNING("Zeus", "Playe private _unit = _player getVariable [QEGVAR(Player,Unit), ""]; _unit = toLower _unit; -if (!(_unit in ["s3", "zeus", "curator", "debug"])) exitWith {} +if (!(_unit in ["s3", "zeus", "curator", "debug"])) exitWith {}; private _curator = "curator" createVehicle [0,0,0]; From 4ac40ef167259e335fd5b446d268f2f054fc1c74 Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Tue, 7 Nov 2023 12:16:33 +0100 Subject: [PATCH 6/8] curator role --- cScripts/Loadouts/CfgLoadouts_Special.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cScripts/Loadouts/CfgLoadouts_Special.hpp b/cScripts/Loadouts/CfgLoadouts_Special.hpp index 267fef758..2b4633130 100644 --- a/cScripts/Loadouts/CfgLoadouts_Special.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Special.hpp @@ -3,7 +3,7 @@ class S3_Base: Cav_B_Seventh_Cavalry_Base_F { category[] = {}; scope = 2; loadout = [["rhs_weap_m4a1_blockII_bk","ACE_muzzle_mzls_L","acc_pointer_IR","rhsusf_acc_ACOG_RMR",["ACE_30Rnd_556x45_Stanag_M995_AP_mag",30],[],"rhsusf_acc_rvg_blk"],[],["rhs_weap_M320","","","",["ACE_HuntIR_M203",1],[],""],["USP_G3C_RS2_MC",[["ACE_tourniquet",4],["ItemcTabHCam",1],["ACE_MapTools",1],["ACE_IR_Strobe_Item",2],["ACE_microDAGR",1],["ACE_splint",4],["ACE_Flashlight_XL50",1],["kat_Painkiller",2,10],["SmokeShellPurple",2,1],["Laserbatteries",1,1]]],["rhsusf_plateframe_grenadier",[["ACE_packingBandage",20],["ACE_IR_Strobe_Item",2],["rhs_mag_M664_red_cluster",2,1],["1Rnd_SmokeRed_Grenade_shell",2,1],["1Rnd_SmokeBlue_Grenade_shell",2,1],["ACE_HuntIR_M203",2,1],["ACE_30Rnd_556x45_Stanag_M995_AP_mag",6,30],["ACE_HandFlare_Green",2,1],["SmokeShellBlue",2,1],["SmokeShellRed",2,1]]],["USP_TACTICAL_PACK_CCT7",[["Rev_darter_item",1],["ACE_HuntIR_monitor",1],["ACE_EntrenchingTool",1],["ACE_UAVBattery",1],["Laserbatteries",1,1],[["ACE_Vector","","","",[],[],""],1]]],"rhsusf_opscore_mc_cover_pelt_cam","rhsusf_shemagh2_gogg_grn",["Laserdesignator","","","",["Laserbatteries",1],[],""],["ItemMap","ItemcTab","","ItemCompass","ItemWatch","USP_PVS15"]]; - role = "officer"; + role = "curator"; company = ""; From 804ee203061cae0df73d8ad59cda48a01b7a5264 Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Tue, 7 Nov 2023 22:18:56 +0100 Subject: [PATCH 7/8] Updated and made the system more reliable --- cScripts/Loadouts/CfgLoadouts_Special.hpp | 2 +- .../functions/systems/fn_createCurator.sqf | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/cScripts/Loadouts/CfgLoadouts_Special.hpp b/cScripts/Loadouts/CfgLoadouts_Special.hpp index a4e38f27d..d2145bf32 100644 --- a/cScripts/Loadouts/CfgLoadouts_Special.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Special.hpp @@ -1,7 +1,7 @@ class S3_Base: Cav_B_Seventh_Cavalry_Base_F { displayName = "S3 Mission Control"; category[] = {}; - scope = 2; + scope = 1; loadout = [["rhs_weap_m4a1_blockII_bk","ACE_muzzle_mzls_L","acc_pointer_IR","rhsusf_acc_ACOG_RMR",["ACE_30Rnd_556x45_Stanag_M995_AP_mag",30],[],"rhsusf_acc_rvg_blk"],[],["rhs_weap_M320","","","",["ACE_HuntIR_M203",1],[],""],["USP_G3C_RS2_MC",[["ACE_tourniquet",4],["ItemcTabHCam",1],["ACE_MapTools",1],["ACE_IR_Strobe_Item",2],["ACE_microDAGR",1],["ACE_splint",4],["ACE_Flashlight_XL50",1],["kat_Painkiller",2,10],["SmokeShellPurple",2,1],["Laserbatteries",1,1]]],["rhsusf_plateframe_grenadier",[["ACE_packingBandage",20],["ACE_IR_Strobe_Item",2],["rhs_mag_M664_red_cluster",2,1],["1Rnd_SmokeRed_Grenade_shell",2,1],["1Rnd_SmokeBlue_Grenade_shell",2,1],["ACE_HuntIR_M203",2,1],["ACE_30Rnd_556x45_Stanag_M995_AP_mag",6,30],["ACE_HandFlare_Green",2,1],["SmokeShellBlue",2,1],["SmokeShellRed",2,1]]],["USP_TACTICAL_PACK_CCT7",[["Rev_darter_item",1],["ACE_HuntIR_monitor",1],["ACE_EntrenchingTool",1],["ACE_UAVBattery",1],["Laserbatteries",1,1],[["ACE_Vector","","","",[],[],""],1]]],"rhsusf_opscore_mc_cover_pelt_cam","rhsusf_shemagh2_gogg_grn",["Laserdesignator","","","",["Laserbatteries",1],[],""],["ItemMap","ItemcTab","","ItemCompass","ItemWatch","USP_PVS15"]]; role = "curator"; diff --git a/cScripts/functions/systems/fn_createCurator.sqf b/cScripts/functions/systems/fn_createCurator.sqf index 6c2283670..748c04203 100644 --- a/cScripts/functions/systems/fn_createCurator.sqf +++ b/cScripts/functions/systems/fn_createCurator.sqf @@ -1,3 +1,4 @@ +#define DEBUG_MODE; #include "..\script_component.hpp"; /* * Author: SGT.Brostrom.A @@ -17,17 +18,25 @@ params [ ]; if (!isServer) exitWith {}; -if (!isNull (getAssignedCuratorLogic _player)) exitWith { WARNING("Zeus", "Player already assigned as curator"); }; +if (!isNull (getAssignedCuratorLogic _player)) exitWith { SHOW_WARNING_2("Zeus", "Player %1 [%2] already assigned as curator", _player, typeOf _player); }; private _unit = _player getVariable [QEGVAR(Player,Unit), ""]; _unit = toLower _unit; -if (!(_unit in ["s3", "zeus", "curator", "debug"])) exitWith {}; +if (!(_unit in ["s3", "zeus", "curator", "debug"])) exitWith { + SHOW_WARNING_2("Zeus", "Player %1 [%2] can not be assigned as curator", _player, typeOf _player); +}; +private _group = createGroup sideLogic; +private _curator = _group createUnit ["ModuleCurator_F", [0,0,0], [], 0, "NONE"]; +_curator setVariable ["owner", _owner, true]; +_curator setVariable ["Addons", 3, true]; +_curator setVariable ["BIS_fnc_initModules_disableAutoActivation", false]; +_curator setCuratorCoef ["Place", 0]; +_curator setCuratorCoef ["Delete", 0]; + +_group deleteGroupWhenEmpty true; -private _curator = "curator" createVehicle [0,0,0]; _curator addCuratorAddons activatedAddons; _player assignCurator _curator; -SHOW_INFO_CHAT_2("Zeus", "Curator created for %1 [%2]", player, typeOf _player); - -_curator addCuratorEditableObjects [[allPlayers], true]; \ No newline at end of file +SHOW_CHAT_INFO_2("Zeus", "Curator created for %1 [%2]", _player, typeOf _player); \ No newline at end of file From 26ba5bd6507a8e8d6f87749685dc70920046e7ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brostr=C3=B6m=2EA=20=7C=20Evul?= Date: Tue, 7 Nov 2023 22:22:54 +0100 Subject: [PATCH 8/8] Update fn_createCurator.sqf --- cScripts/functions/systems/fn_createCurator.sqf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cScripts/functions/systems/fn_createCurator.sqf b/cScripts/functions/systems/fn_createCurator.sqf index 748c04203..3fd85c687 100644 --- a/cScripts/functions/systems/fn_createCurator.sqf +++ b/cScripts/functions/systems/fn_createCurator.sqf @@ -1,4 +1,3 @@ -#define DEBUG_MODE; #include "..\script_component.hpp"; /* * Author: SGT.Brostrom.A @@ -8,7 +7,7 @@ * 0: Player * * Example: - * cScripts_fnc_createCurator + * [player] call cScripts_fnc_createCurator * * Public: No */ @@ -39,4 +38,4 @@ _group deleteGroupWhenEmpty true; _curator addCuratorAddons activatedAddons; _player assignCurator _curator; -SHOW_CHAT_INFO_2("Zeus", "Curator created for %1 [%2]", _player, typeOf _player); \ No newline at end of file +SHOW_CHAT_INFO_2("Zeus", "Curator created for %1 [%2]", _player, typeOf _player);