From 68995eb8d32e7849d99b59d1a1088787abd65848 Mon Sep 17 00:00:00 2001 From: mrschick <58027418+mrschick@users.noreply.github.com> Date: Tue, 28 Nov 2023 18:24:25 +0100 Subject: [PATCH 1/4] Fix Zeus Racks being broken by remote controlling AI --- addons/sys_rack/fnc_enterVehicle.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sys_rack/fnc_enterVehicle.sqf b/addons/sys_rack/fnc_enterVehicle.sqf index 5cf5aead4..ce30b54dc 100644 --- a/addons/sys_rack/fnc_enterVehicle.sqf +++ b/addons/sys_rack/fnc_enterVehicle.sqf @@ -18,7 +18,7 @@ params ["_vehicle", "_unit"]; -if (_unit != _vehicle) then { +if (_unit != _vehicle && {isNull remoteControlled _unit}) then { private _initialized = _vehicle getVariable [QGVAR(initialized), false]; if (!_initialized) then { From 4c54e7820cde41d66f2a1a1cb0dcffc4da4fad23 Mon Sep 17 00:00:00 2001 From: mrschick <58027418+mrschick@users.noreply.github.com> Date: Wed, 29 Nov 2023 19:39:30 +0100 Subject: [PATCH 2/4] Preserve PTT assignments after using remote voice radios Previously, PTT customization would be reset after using a remote controlled AI's radios. --- addons/api/fnc_getMultiPushToTalkAssignment.sqf | 7 ++++++- addons/api/fnc_setMultiPushToTalkAssignment.sqf | 6 +++++- addons/sys_core/XEH_preInit.sqf | 1 + addons/sys_core/fnc_handleMultiPttKeyPress.sqf | 16 +++++++++++----- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/addons/api/fnc_getMultiPushToTalkAssignment.sqf b/addons/api/fnc_getMultiPushToTalkAssignment.sqf index 6bc1473d1..98dfe2275 100644 --- a/addons/api/fnc_getMultiPushToTalkAssignment.sqf +++ b/addons/api/fnc_getMultiPushToTalkAssignment.sqf @@ -17,8 +17,13 @@ //Emulate behaviour of the handleMultiPttKeyPress algorithm -private _radioLists = [+ ACRE_ASSIGNED_PTT_RADIOS, [] call EFUNC(sys_data,getPlayerRadioList)] call EFUNC(sys_data,sortRadioList); +private _radioLists = []; +if (acre_player isEqualTo player) then { // using zeus player voice + _radioLists = [+ ACRE_ASSIGNED_PTT_RADIOS, [] call EFUNC(sys_data,getPlayerRadioList)] call EFUNC(sys_data,sortRadioList); +} else { // using zeus remote voice + _radioLists = [+ ACRE_ASSIGNED_PTT_RADIOS_REMOTE, [] call EFUNC(sys_data,getPlayerRadioList)] call EFUNC(sys_data,sortRadioList); +}; private _returnValue = (_radioLists select 1); diff --git a/addons/api/fnc_setMultiPushToTalkAssignment.sqf b/addons/api/fnc_setMultiPushToTalkAssignment.sqf index b8648da26..f59d21837 100644 --- a/addons/api/fnc_setMultiPushToTalkAssignment.sqf +++ b/addons/api/fnc_setMultiPushToTalkAssignment.sqf @@ -35,6 +35,10 @@ private _index = _var findIf { if (_index != -1) exitWith { false }; -ACRE_ASSIGNED_PTT_RADIOS = _var; +if (acre_player isEqualTo player) then { // using zeus player voice + ACRE_ASSIGNED_PTT_RADIOS = _var; +} else { // using zeus remote voice + ACRE_ASSIGNED_PTT_RADIOS_REMOTE = _var; +}; true diff --git a/addons/sys_core/XEH_preInit.sqf b/addons/sys_core/XEH_preInit.sqf index bcc86d23d..2bba5ee49 100644 --- a/addons/sys_core/XEH_preInit.sqf +++ b/addons/sys_core/XEH_preInit.sqf @@ -66,6 +66,7 @@ DVAR(ACRE_LISTENER_DIVE) = 0; DVAR(ACRE_PTT_RELEASE_DELAY) = 0.2; DVAR(ACRE_ASSIGNED_PTT_RADIOS) = []; +DVAR(ACRE_ASSIGNED_PTT_RADIOS_REMOTE) = []; GVAR(delayReleasePTT_Handle) = nil; DVAR(ACRE_ACTIVE_PTTKEY) = -2; diff --git a/addons/sys_core/fnc_handleMultiPttKeyPress.sqf b/addons/sys_core/fnc_handleMultiPttKeyPress.sqf index 61604a317..c23ad0894 100644 --- a/addons/sys_core/fnc_handleMultiPttKeyPress.sqf +++ b/addons/sys_core/fnc_handleMultiPttKeyPress.sqf @@ -35,11 +35,17 @@ if (ACRE_ACTIVE_PTTKEY == -2) then { private _radioList = [] call EFUNC(sys_data,getPlayerRadioList); if (ACRE_ACTIVE_PTTKEY <= (count _radioList) - 1) then { if ((count ACRE_ASSIGNED_PTT_RADIOS) > 0) then { - private _sortList = [ACRE_ASSIGNED_PTT_RADIOS, _radioList] call EFUNC(sys_data,sortRadioList); - // This will handle cleanup automatically too - ACRE_ASSIGNED_PTT_RADIOS = _sortList select 0; - _radioList = _sortList select 1; - + if (acre_player isEqualTo player) then { // using zeus player voice + private _sortList = [ACRE_ASSIGNED_PTT_RADIOS, _radioList] call EFUNC(sys_data,sortRadioList); + // This will handle cleanup automatically too + ACRE_ASSIGNED_PTT_RADIOS = _sortList select 0; + _radioList = _sortList select 1; + } else { + private _sortList = [ACRE_ASSIGNED_PTT_RADIOS_REMOTE, _radioList] call EFUNC(sys_data,sortRadioList); + // This will handle cleanup automatically too + ACRE_ASSIGNED_PTT_RADIOS_REMOTE = _sortList select 0; + _radioList = _sortList select 1; + }; }; _sendRadio = _radioList select ACRE_ACTIVE_PTTKEY; [_sendRadio] call EFUNC(sys_radio,setActiveRadio); From 190224e4e220e377a08f5c57b50e4d9bfceae38a Mon Sep 17 00:00:00 2001 From: Fabio Schick <58027418+mrschick@users.noreply.github.com> Date: Sun, 7 Jul 2024 17:36:08 +0200 Subject: [PATCH 3/4] Add Comment Suggestion Co-authored-by: jonpas --- addons/sys_core/XEH_preInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sys_core/XEH_preInit.sqf b/addons/sys_core/XEH_preInit.sqf index 85c12d8b3..30dab6243 100644 --- a/addons/sys_core/XEH_preInit.sqf +++ b/addons/sys_core/XEH_preInit.sqf @@ -66,7 +66,7 @@ DVAR(ACRE_LISTENER_DIVE) = 0; DVAR(ACRE_PTT_RELEASE_DELAY) = 0.2; DVAR(ACRE_ASSIGNED_PTT_RADIOS) = []; -DVAR(ACRE_ASSIGNED_PTT_RADIOS_REMOTE) = []; +DVAR(ACRE_ASSIGNED_PTT_RADIOS_REMOTE) = []; // Remote controlled unit GVAR(delayReleasePTT_Handle) = nil; DVAR(ACRE_ACTIVE_PTTKEY) = -2; From e0f2c7d7666c5e8fea385510985c80706ede48a9 Mon Sep 17 00:00:00 2001 From: mrschick <58027418+mrschick@users.noreply.github.com> Date: Sun, 7 Jul 2024 17:49:22 +0200 Subject: [PATCH 4/4] Documentation Note for Racks not being usable to AI --- docs/wiki/user/vehicle-racks.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/wiki/user/vehicle-racks.md b/docs/wiki/user/vehicle-racks.md index ae4f064a0..5c811996b 100644 --- a/docs/wiki/user/vehicle-racks.md +++ b/docs/wiki/user/vehicle-racks.md @@ -16,6 +16,8 @@ In order to use and mount and unmount (when possible) a vehicle rack, ACE3 Inter Configuring the vehicle rack (opening the radio GUI) is disabled for *turned out* positions. +**Note:** Vehicle Racks cannot be accessed by AI that is being remote controlled by a Zeus Gamemaster. + ## Vehicle intercom In addition, vehicle racks are integrated into the intercom system. A rack with access to *crew* or *passenger* intercom allows players without access to the rack to hear incoming transmissions. These players however, will not be able to configure the radio nor transmit through it in the current implementation.