diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..0deca3d2ab
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,13 @@
+root = true
+
+[*]
+end_of_line = crlf
+insert_final_newline = true
+charset = utf-8
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+
+[*.md]
+trim_trailing_whitespace = false
+
diff --git a/README.md b/README.md
index ddece2a48d..8721a3f217 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,23 @@
- 
+
+
+
-
+
-
+
-
+
Requires the latest version of CBA A3 | BIF thread
-**ACE 3** is a join effort by the teams behind **ACE 2**, **AGM**, **CSE** and **RHS** to improve the realism and authenticity of Arma 3.
+**ACE 3** is a joint effort by the teams behind **ACE2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3.
This mod is entirely **open-source**, and everyone is free to propose changes or maintain their own, customized version as long as they make their changes open to the public in accordance with the GNU General Public License (for more information check the license file attached to this project).
@@ -32,7 +34,7 @@ More information on the purpose of the different components of ACE and which one
* Realistic ballistics including wind and humidity
* Backblast simulation
* Weapon resting and bipod deployment
-* A fire control system for armored vehicles and helicopters
+* A fire control system for armored vehicles and helicopters
***and more...***
For a full list of current features, check [the official wiki](https://github.com/KoffeinFlummi/ACE3/wiki).
diff --git a/addons/parachute/Gurtgeschirr.p3d b/TO_MERGE/agm/Parachute/Gurtgeschirr.p3d
similarity index 100%
rename from addons/parachute/Gurtgeschirr.p3d
rename to TO_MERGE/agm/Parachute/Gurtgeschirr.p3d
diff --git a/addons/parachute/T10Schirm.p3d b/TO_MERGE/agm/Parachute/T10Schirm.p3d
similarity index 100%
rename from addons/parachute/T10Schirm.p3d
rename to TO_MERGE/agm/Parachute/T10Schirm.p3d
diff --git a/TO_MERGE/cse/sys_misc/functions/fn_moduleAmbianceSoundLoop.sqf b/TO_MERGE/cse/sys_misc/functions/fn_moduleAmbianceSoundLoop.sqf
deleted file mode 100644
index 4b4d93d453..0000000000
--- a/TO_MERGE/cse/sys_misc/functions/fn_moduleAmbianceSoundLoop.sqf
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * fn_moduleAmbianceSoundLoop.sqf
- * @Descr: N/A
- * @Author: Glowbal
- *
- * @Arguments: []
- * @Return:
- * @PublicAPI: false
- */
-
-private ["_logic", "_units", "_activated","_ambianceSounds", "_soundFiles", "_minimalDistance","_maximalDistance", "_minimalDistance", "_maxDelayBetweenSounds", "_allUnits", "_newPos", "_targetUnit", "_soundToPlay", "_soundPath", "_unparsedSounds", "_list", "_splittedList", "_nilCheckPassedList"];
-_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param;
-_units = [_this,1,[],[[]]] call BIS_fnc_param;
-_activated = [_this,2,true,[true]] call BIS_fnc_param;
-
-if (_activated && isServer) then {
- _ambianceSounds = [];
- _unparsedSounds = _logic getvariable ["soundFiles", ""];
- _minimalDistance = (_logic getvariable ["minimalDistance", 400]) max 1;
- _maximalDistance = (_logic getvariable ["maximalDistance", 10]) max _minimalDistance;
- _minDelayBetweensounds = (_logic getvariable ["minimalDelay", 10]) max 1;
- _maxDelayBetweenSounds = (_logic getvariable ["maximalDelay", 170]) max _minDelayBetweensounds;
- _volume = (_logic getvariable ["soundVolume", 30]) max 1;
- _followPlayers = _logic getvariable ["followPlayers", false];
-
- _splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString;
-
- _nilCheckPassedList = "";
- {
- _x = [_x] call cse_fnc_string_removeWhiteSpace;
- _splittedList set [_foreachIndex, _x];
- }foreach _splittedList;
-
- _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
- {
- if (isclass (missionConfigFile >> "CfgSounds" >> _x)) then {
- _ambianceSounds pushback (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0));
- } else {
- if (isclass (configFile >> "CfgSounds" >> _x)) then {
- _ambianceSounds pushback ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0));
- };
- };
- }foreach _splittedList;
-
- if (count _ambianceSounds == 0) exitwith {
- [format["No Ambiance sounds available"]] call cse_fnc_debug;
- };
- {
- if !([".", _x, true] call BIS_fnc_inString) then {
- [format["Ambiance soundfile does not contain a file extension %1", _x]] call cse_fnc_debug;
- _ambianceSounds set [_foreachIndex, _x + ".wss"];
- };
- }foreach _ambianceSounds;
- [format["Ambiance sounds %1", _ambianceSounds]] call cse_fnc_debug;
-
- while {alive _logic} do {
- _allUnits = switch (true) do {
- case isMultiplayer: {playableUnits};
- case isDedicated: {[_logic]};
- default {[player]};
- };
-
- if (count _allUnits > 0) then {
- _targetUnit = _allUnits select (round(random((count _allUnits)-1)));
-
- _newPos = (getPos _targetUnit);
- if (!_followPlayers) then {
- _newPos = getPos _logic;
- };
-
- if (random(1) >= 0.5) then {
- if (random(1) >= 0.5) then {
- _newPos set [0, (_newPos select 0) + (_minimalDistance + random(_maximalDistance))];
- } else {
- _newPos set [0, (_newPos select 0) - (_minimalDistance + random(_maximalDistance))];
- };
- } else {
- if (random(1) >= 0.5) then {
- _newPos set [1, (_newPos select 1) + (_minimalDistance + random(_maximalDistance))];
- } else {
- _newPos set [1, (_newPos select 1) - (_minimalDistance + random(_maximalDistance))];
- };
- };
-
- if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then {
-
- _soundToPlay = _ambianceSounds select (round(random((count _ambianceSounds)-1)));
- playSound3D [_soundToPlay, _targetUnit, false, _newPos, _volume, 1, 1000];
-
- [format["Played a sound %1", _soundToPlay]] call cse_fnc_debug;
-
- sleep (_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds;
- };
- };
- };
-};
-
-true;
\ No newline at end of file
diff --git a/ace_fcs.dll b/ace_fcs.dll
index 9907d9e1a0..7c222dc1d7 100644
Binary files a/ace_fcs.dll and b/ace_fcs.dll differ
diff --git a/addons/aircraft/CfgVehicles.hpp b/addons/aircraft/CfgVehicles.hpp
index 5f419506c0..e9fb90e61e 100644
--- a/addons/aircraft/CfgVehicles.hpp
+++ b/addons/aircraft/CfgVehicles.hpp
@@ -217,9 +217,8 @@ class CfgVehicles {
};*/
};
- class I_Heli_Transport_02_F: Heli_Transport_02_base_F {};
-
- class I_Heli_light_03_base_F: Helicopter_Base_F {
+ class Heli_light_03_base_F: Helicopter_Base_F {};
+ class I_Heli_light_03_base_F: Heli_light_03_base_F {
lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
@@ -242,15 +241,15 @@ class CfgVehicles {
};
};
- class I_Heli_light_03_F: I_Heli_light_03_base_F {
+ class I_Heli_light_03_F: Heli_light_03_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {};
};
};
- class I_Heli_light_03_unarmed_base_F: I_Heli_light_03_base_F {};
+ class Heli_light_03_unarmed_base_F: Heli_light_03_base_F {};
- class I_Heli_light_03_unarmed_F: I_Heli_light_03_unarmed_base_F {};
+ class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F {};
class Plane_CAS_01_base_F: Plane_Base_F {
lockDetectionSystem = 12;
@@ -303,7 +302,8 @@ class CfgVehicles {
};*/
};
- class B_Heli_Transport_03_base_F: Helicopter_Base_H {
+ class Heli_Transport_03_base_F: Helicopter_Base_H {};
+ class B_Heli_Transport_03_base_F: Heli_Transport_03_base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
@@ -317,7 +317,7 @@ class CfgVehicles {
};
};
- class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F {
+ class B_Heli_Transport_03_unarmed_base_F: Heli_Transport_03_base_F {
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;
diff --git a/addons/attach/CfgVehicles.hpp b/addons/attach/CfgVehicles.hpp
index 1cd65127a6..047549dfba 100644
--- a/addons/attach/CfgVehicles.hpp
+++ b/addons/attach/CfgVehicles.hpp
@@ -1,25 +1,27 @@
#define MACRO_ATTACHTOVEHICLE \
class ACE_Actions { \
- class GVAR(AttachVehicle) { \
- displayName = "$STR_ACE_Attach_AttachDetach"; \
- condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
- statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
- exceptions[] = {"ACE_Drag_isNotDragging"}; \
- showDisabled = 0; \
- priority = 0; \
- icon = PATHTOF(UI\attach_ca.paa); \
- distance = 4; \
- }; \
- class GVAR(DetachVehicle) { \
- displayName = "$STR_ACE_Attach_Detach"; \
- condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
- statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
- exceptions[] = {"ACE_Drag_isNotDragging"}; \
- showDisabled = 0; \
- priority = 0; \
- icon = PATHTOF(UI\detach_ca.paa); \
- distance = 4; \
+ class ACE_MainActions { \
+ class GVAR(AttachVehicle) { \
+ displayName = "$STR_ACE_Attach_AttachDetach"; \
+ condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
+ statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
+ exceptions[] = {"ACE_Drag_isNotDragging"}; \
+ showDisabled = 0; \
+ priority = 0; \
+ icon = PATHTOF(UI\attach_ca.paa); \
+ distance = 4; \
+ }; \
+ class GVAR(DetachVehicle) { \
+ displayName = "$STR_ACE_Attach_Detach"; \
+ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
+ statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
+ exceptions[] = {"ACE_Drag_isNotDragging"}; \
+ showDisabled = 0; \
+ priority = 0; \
+ icon = PATHTOF(UI\detach_ca.paa); \
+ distance = 4; \
+ }; \
}; \
};
diff --git a/addons/attach/functions/fnc_openAttachUI.sqf b/addons/attach/functions/fnc_openAttachUI.sqf
index 5533956bb6..1b95be9b84 100644
--- a/addons/attach/functions/fnc_openAttachUI.sqf
+++ b/addons/attach/functions/fnc_openAttachUI.sqf
@@ -62,6 +62,5 @@ _attachables = items _unit;
},
{
call EFUNC(interaction,hideMenu);
- if !(profileNamespace getVariable [QEGVAR(interaction,AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)};
}
] call EFUNC(interaction,openSelectMenu);
diff --git a/addons/backpacks/$PBOPREFIX$ b/addons/backpacks/$PBOPREFIX$
new file mode 100644
index 0000000000..99e61f20d4
--- /dev/null
+++ b/addons/backpacks/$PBOPREFIX$
@@ -0,0 +1 @@
+z\ace\addons\backpacks
\ No newline at end of file
diff --git a/addons/lockbackpacks/CfgEventHandlers.hpp b/addons/backpacks/CfgEventHandlers.hpp
similarity index 74%
rename from addons/lockbackpacks/CfgEventHandlers.hpp
rename to addons/backpacks/CfgEventHandlers.hpp
index 9a26e6f614..1aad146690 100644
--- a/addons/lockbackpacks/CfgEventHandlers.hpp
+++ b/addons/backpacks/CfgEventHandlers.hpp
@@ -5,6 +5,12 @@ class Extended_PreInit_EventHandlers {
};
};
+class Extended_PostInit_EventHandlers {
+ class ADDON {
+ init = QUOTE(call COMPILE_FILE(XEH_postInit));
+ };
+};
+
class Extended_InventoryOpened_EventHandlers {
class CAManBase {
class GVAR(onOpenInventory) {
diff --git a/addons/lockbackpacks/README.md b/addons/backpacks/README.md
similarity index 100%
rename from addons/lockbackpacks/README.md
rename to addons/backpacks/README.md
diff --git a/addons/backpacks/XEH_postInit.sqf b/addons/backpacks/XEH_postInit.sqf
new file mode 100644
index 0000000000..375fcd5f89
--- /dev/null
+++ b/addons/backpacks/XEH_postInit.sqf
@@ -0,0 +1,3 @@
+#include "script_component.hpp"
+
+["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler);
diff --git a/addons/lockbackpacks/XEH_preInit.sqf b/addons/backpacks/XEH_preInit.sqf
similarity index 86%
rename from addons/lockbackpacks/XEH_preInit.sqf
rename to addons/backpacks/XEH_preInit.sqf
index c474ff625a..a47825d0b0 100644
--- a/addons/lockbackpacks/XEH_preInit.sqf
+++ b/addons/backpacks/XEH_preInit.sqf
@@ -2,6 +2,7 @@
ADDON = false;
+PREP(backpackOpened);
PREP(getBackpackAssignedUnit);
PREP(isBackpack);
PREP(onOpenInventory);
diff --git a/addons/lockbackpacks/config.cpp b/addons/backpacks/config.cpp
similarity index 78%
rename from addons/lockbackpacks/config.cpp
rename to addons/backpacks/config.cpp
index 0224b4b237..ddc7639921 100644
--- a/addons/lockbackpacks/config.cpp
+++ b/addons/backpacks/config.cpp
@@ -5,7 +5,7 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
- requiredAddons[] = {"ace_common","ace_interaction"};
+ requiredAddons[] = {"ace_common"};
author[] = {"bux","commy2"};
authorUrl = "https://github.com/commy2/";
VERSION_CONFIG;
@@ -13,4 +13,3 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
-#include "CfgVehicles.hpp"
diff --git a/addons/backpacks/functions/fnc_backpackOpened.sqf b/addons/backpacks/functions/fnc_backpackOpened.sqf
new file mode 100644
index 0000000000..186202027f
--- /dev/null
+++ b/addons/backpacks/functions/fnc_backpackOpened.sqf
@@ -0,0 +1,51 @@
+/*
+ * Author: commy2
+ *
+ * Someone opened your backpack. Execute locally.
+ *
+ * Argument:
+ * 0: Who accessed your inventory? (Object)
+ * 1: Unit that wields the backpack (Object)
+ * 2: The backpack object (Object)
+ *
+ * Return value:
+ * None.
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_target"];
+
+_unit = _this select 0;
+_target = _this select 1;
+_backpack = _this select 2;
+
+// do cam shake if the target is the player
+if ([_target] call EFUNC(common,isPlayer)) then {
+ addCamShake [4, 0.5, 5];
+};
+
+// play a rustling sound
+private ["_sounds", "_position"];
+
+_sounds = [
+ /*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
+ "a3\sounds_f\characters\ingame\AinvPknlMstpSlayWrflDnon_medic.wss",
+ "a3\sounds_f\characters\ingame\AinvPpneMstpSlayWpstDnon_medic.wss",
+ "a3\sounds_f\characters\ingame\AinvPpneMstpSlayWrflDnon_medic.wss"*/
+
+ QUOTE(PATHTO_R(sounds\zip_in.wav)),
+ QUOTE(PATHTO_R(sounds\zip_out.wav))
+];
+
+_position = _target modelToWorld (_target selectionPosition "Spine3");
+_position = _position call EFUNC(common,positionToASL);
+
+playSound3D [
+ _sounds select floor random count _sounds,
+ objNull,
+ false,
+ _position,
+ 1,
+ 1,
+ 50
+];
diff --git a/addons/lockbackpacks/functions/fnc_getBackpackAssignedUnit.sqf b/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf
similarity index 100%
rename from addons/lockbackpacks/functions/fnc_getBackpackAssignedUnit.sqf
rename to addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf
diff --git a/addons/lockbackpacks/functions/fnc_isBackpack.sqf b/addons/backpacks/functions/fnc_isBackpack.sqf
similarity index 100%
rename from addons/lockbackpacks/functions/fnc_isBackpack.sqf
rename to addons/backpacks/functions/fnc_isBackpack.sqf
diff --git a/addons/backpacks/functions/fnc_onOpenInventory.sqf b/addons/backpacks/functions/fnc_onOpenInventory.sqf
new file mode 100644
index 0000000000..63e4aa87a3
--- /dev/null
+++ b/addons/backpacks/functions/fnc_onOpenInventory.sqf
@@ -0,0 +1,30 @@
+/*
+ * Author: commy2
+ *
+ * Handle the open inventory event. Display message on traget client.
+ *
+ * Argument:
+ * Input from "InventoryOpened" eventhandler
+ *
+ * Return value:
+ * false. Always open the inventory dialog. (Bool)
+ */
+#include "script_component.hpp"
+
+private ["_unit", "_backpack"];
+
+_unit = _this select 0;
+_backpack = _this select 1;
+
+// exit if the target is not a backpack
+if !([_backpack] call FUNC(isBackpack)) exitWith {};
+
+// get the unit that wears the backpack object
+private "_target";
+_target = [_backpack] call FUNC(getBackpackAssignedUnit);
+
+// raise event on target unit
+["backpackOpened", _target, [_unit, _target, _backpack]] call EFUNC(common,targetEvent);
+
+// return false to open inventory as usual
+false
diff --git a/addons/backpacks/functions/script_component.hpp b/addons/backpacks/functions/script_component.hpp
new file mode 100644
index 0000000000..b6bb78fff5
--- /dev/null
+++ b/addons/backpacks/functions/script_component.hpp
@@ -0,0 +1 @@
+#include "\z\ace\addons\backpacks\script_component.hpp"
\ No newline at end of file
diff --git a/addons/backpacks/script_component.hpp b/addons/backpacks/script_component.hpp
new file mode 100644
index 0000000000..2837367bfb
--- /dev/null
+++ b/addons/backpacks/script_component.hpp
@@ -0,0 +1,12 @@
+#define COMPONENT backpacks
+#include "\z\ace\addons\main\script_mod.hpp"
+
+#ifdef DEBUG_ENABLED_BACKPACKS
+ #define DEBUG_MODE_FULL
+#endif
+
+#ifdef DEBUG_ENABLED_BACKPACKS
+ #define DEBUG_SETTINGS DEBUG_ENABLED_BACKPACKS
+#endif
+
+#include "\z\ace\addons\main\script_macros.hpp"
\ No newline at end of file
diff --git a/addons/backpacks/sounds/zip_in.wav b/addons/backpacks/sounds/zip_in.wav
new file mode 100644
index 0000000000..b93549310a
Binary files /dev/null and b/addons/backpacks/sounds/zip_in.wav differ
diff --git a/addons/backpacks/sounds/zip_out.wav b/addons/backpacks/sounds/zip_out.wav
new file mode 100644
index 0000000000..b671c118a3
Binary files /dev/null and b/addons/backpacks/sounds/zip_out.wav differ
diff --git a/addons/captives/CfgEventHandlers.hpp b/addons/captives/CfgEventHandlers.hpp
index 722750f915..0ce09280a7 100644
--- a/addons/captives/CfgEventHandlers.hpp
+++ b/addons/captives/CfgEventHandlers.hpp
@@ -9,7 +9,6 @@ class Extended_PostInit_EventHandlers {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
-
//release escorted captive when entering a vehicle
class Extended_GetIn_EventHandlers {
class All {
@@ -18,7 +17,6 @@ class Extended_GetIn_EventHandlers {
};
};
};
-
//reset captive animation after leaving vehicle
class Extended_GetOut_EventHandlers {
class All {
@@ -27,7 +25,6 @@ class Extended_GetOut_EventHandlers {
};
};
};
-
//reset captivity and escorting status when getting killed
class Extended_Killed_EventHandlers {
class CAManBase {
@@ -36,7 +33,6 @@ class Extended_Killed_EventHandlers {
};
};
};
-
//mission start
class Extended_InitPost_EventHandlers {
class CAManBase {
@@ -45,4 +41,3 @@ class Extended_InitPost_EventHandlers {
};
};
};
-
diff --git a/addons/captives/CfgMoves.hpp b/addons/captives/CfgMoves.hpp
index 6e67f3615b..d60fab5a33 100644
--- a/addons/captives/CfgMoves.hpp
+++ b/addons/captives/CfgMoves.hpp
@@ -72,7 +72,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
InterpolateTo[] = {"Unconscious",0.01};
};
class ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
- speed = 0.333; //for gameplay reasons, slow this down
+ speed = 0.5; //for gameplay reasons, slow this down
actions = "CivilStandActions";
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon";
ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1};
diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp
index d292402bcf..930f2b27d8 100644
--- a/addons/captives/CfgVehicles.hpp
+++ b/addons/captives/CfgVehicles.hpp
@@ -2,70 +2,70 @@ class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_Actions {
+
class ACE_ApplyHandcuffs {
displayName = "$STR_ACE_Captives_SetCaptive";
- distance = 4;
+ selection = "righthand";
+ distance = 2;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs));
exceptions[] = {};
- showDisabled = 0;
- priority = 2.4;
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
- hotkey = "C";
};
class ACE_RemoveHandcuffs {
displayName = "$STR_ACE_Captives_ReleaseCaptive";
- distance = 4;
+ selection = "righthand";
+ distance = 2;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs));
exceptions[] = {};
- showDisabled = 0;
- priority = 2.4;
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
- hotkey = "R";
};
- class ACE_EscortCaptive {
- displayName = "$STR_ACE_Captives_EscortCaptive";
- distance = 4;
- condition = QUOTE([ARR_2(_player, _target)] call FUNC(canEscortCaptive));
- statement = QUOTE([ARR_3(_player, _target, true)] call FUNC(doEscortCaptive));
- exceptions[] = {};
- showDisabled = 0;
- icon = QUOTE(PATHTOF(UI\captive_ca.paa));
- priority = 2.3;
- hotkey = "E";
- };
- class ACE_StopEscorting {
- displayName = "$STR_ACE_Captives_StopEscorting";
- distance = 4;
- condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting));
- statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive));
- exceptions[] = {QGVAR(isNotEscorting)};
- showDisabled = 0;
- icon = QUOTE(PATHTOF(UI\captive_ca.paa));
- priority = 2.3;
- hotkey = "E";
- };
- class ACE_LoadCaptive {
- displayName = "$STR_ACE_Captives_LoadCaptive";
- distance = 4;
- condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive));
- statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive));
- exceptions[] = {QGVAR(isNotEscorting)};
- showDisabled = 0;
- icon = QUOTE(PATHTOF(UI\captive_ca.paa));
- priority = 2.2;
- hotkey = "L";
- };
- class ACE_FriskPerson {
- displayName = "$STR_ACE_Captives_FriskPerson";
- distance = 2;
- condition = QUOTE([ARR_2(_player, _target)] call FUNC(canFriskPerson));
- statement = QUOTE([ARR_2(_player, _target)] call FUNC(doFriskPerson));
- showDisabled = 0;
- //icon = ""; //@todo
- priority = 3;
- hotkey = "F";
+
+ class ACE_MainActions {
+ class ACE_EscortCaptive {
+ displayName = "$STR_ACE_Captives_EscortCaptive";
+ distance = 4;
+ condition = QUOTE([ARR_2(_player, _target)] call FUNC(canEscortCaptive));
+ statement = QUOTE([ARR_3(_player, _target, true)] call FUNC(doEscortCaptive));
+ exceptions[] = {};
+ showDisabled = 0;
+ icon = QUOTE(PATHTOF(UI\captive_ca.paa));
+ priority = 2.3;
+ hotkey = "E";
+ };
+ class ACE_StopEscorting {
+ displayName = "$STR_ACE_Captives_StopEscorting";
+ distance = 4;
+ condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting));
+ statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive));
+ exceptions[] = {QGVAR(isNotEscorting)};
+ showDisabled = 0;
+ icon = QUOTE(PATHTOF(UI\captive_ca.paa));
+ priority = 2.3;
+ hotkey = "E";
+ };
+ class ACE_LoadCaptive {
+ displayName = "$STR_ACE_Captives_LoadCaptive";
+ distance = 4;
+ condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive));
+ statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive));
+ exceptions[] = {QGVAR(isNotEscorting)};
+ showDisabled = 0;
+ icon = QUOTE(PATHTOF(UI\captive_ca.paa));
+ priority = 2.2;
+ hotkey = "L";
+ };
+ class ACE_FriskPerson {
+ displayName = "$STR_ACE_Captives_FriskPerson";
+ distance = 2;
+ condition = QUOTE([ARR_2(_player, _target)] call FUNC(canFriskPerson));
+ statement = QUOTE([ARR_2(_player, _target)] call FUNC(doFriskPerson));
+ showDisabled = 0;
+ //icon = ""; //@todo
+ priority = 3;
+ hotkey = "F";
+ };
};
};
@@ -82,7 +82,7 @@ class CfgVehicles {
class ACE_StartSurrenderingSelf {
displayName = "$STR_ACE_Captives_StartSurrendering";
condition = QUOTE([ARR_2(_player, true)] call FUNC(canSurrender));
- statement = QUOTE([ARR_2(_player, true)] call FUNC(surrender));
+ statement = QUOTE([ARR_2(_player, true)] call FUNC(setSurrendered));
exceptions[] = {};
showDisabled = 0;
priority = 0;
@@ -90,7 +90,7 @@ class CfgVehicles {
class ACE_StopSurrenderingSelf {
displayName = "$STR_ACE_Captives_StopSurrendering";
condition = QUOTE([ARR_2(_player, false)] call FUNC(canSurrender));
- statement = QUOTE([ARR_2(_player, false)] call FUNC(surrender));
+ statement = QUOTE([ARR_2(_player, false)] call FUNC(setSurrendered));
exceptions[] = {QGVAR(isNotSurrendering)};
showDisabled = 0;
priority = 0;
@@ -100,24 +100,27 @@ class CfgVehicles {
#define MACRO_LOADUNLOADCAPTIVE \
class ACE_Actions { \
- class ACE_LoadCaptive { \
- displayName = "$STR_ACE_Captives_LoadCaptive"; \
- distance = 4; \
- condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \
- statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \
- exceptions[] = {QGVAR(isNotEscorting)}; \
- showDisabled = 0; \
- priority = 1.2; \
- hotkey = "L"; \
- }; \
- class ACE_UnloadCaptive { \
- displayName = "$STR_ACE_Captives_UnloadCaptive"; \
- distance = 4; \
- condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \
- statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); \
- showDisabled = 0; \
- priority = 1.2; \
- hotkey = "C"; \
+ class ACE_MainActions { \
+ selection = ""; \
+ class ACE_LoadCaptive { \
+ displayName = "$STR_ACE_Captives_LoadCaptive"; \
+ distance = 4; \
+ condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \
+ statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \
+ exceptions[] = {QGVAR(isNotEscorting)}; \
+ showDisabled = 0; \
+ priority = 1.2; \
+ hotkey = "L"; \
+ }; \
+ class ACE_UnloadCaptive { \
+ displayName = "$STR_ACE_Captives_UnloadCaptive"; \
+ distance = 4; \
+ condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \
+ statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); \
+ showDisabled = 0; \
+ priority = 1.2; \
+ hotkey = "C"; \
+ }; \
}; \
};
@@ -151,15 +154,10 @@ class CfgVehicles {
MACRO_LOADUNLOADCAPTIVE
};
-#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
- name = #ITEM; \
- count = COUNT; \
- };
-
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
- MACRO_ADDITEM(ACE_CableTie,12)
+ MACRO_ADDITEM(ACE_CableTie,12);
};
};
diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf
index 9d1a242d4d..651edbcf86 100644
--- a/addons/captives/XEH_postInit.sqf
+++ b/addons/captives/XEH_postInit.sqf
@@ -1,12 +1,9 @@
#include "script_component.hpp"
-["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
-["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler);
-["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler);
-["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
//Handles when someone starts escorting and then disconnects, leaving the captive attached
//This is normaly handled by the PFEH in doEscortCaptive, but that won't be running if they DC
+
if (isServer) then {
addMissionEventHandler ["HandleDisconnect", {
PARAMS_1(_disconnectedPlayer);
@@ -21,12 +18,20 @@ if (isServer) then {
}];
};
-//TODO: Medical Integration Events???
+["playerVehicleChanged", {_this call FUNC(handleVehicleChanged)}] call EFUNC(common,addEventHandler);
+["zeusDisplayChanged", {_this call FUNC(handleZeusDisplayChanged)}] call EFUNC(common,addEventHandler);
+["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
+["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler);
+["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler);
-// [_unit, "knockedOut", {
-// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut};
-// }] call ACE_Core_fnc_addCustomEventhandler;
+["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
+["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler);
-// [_unit, "wokeUp", {
-// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp};
-// }] call ACE_Core_fnc_addCustomEventhandler;
+//Medical Integration Events???
+["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler);
+
+if (!hasInterface) exitWith {};
+
+["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithCondition);
+["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithCondition);
+["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithCondition);
diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf
index 75ee77e9bc..c09f81e51b 100644
--- a/addons/captives/XEH_preInit.sqf
+++ b/addons/captives/XEH_preInit.sqf
@@ -19,13 +19,13 @@ PREP(doUnloadCaptive);
PREP(handleGetIn);
PREP(handleGetOut);
PREP(handleKilled);
-PREP(handleKnockedOut);
+PREP(handleOnUnconscious);
PREP(handlePlayerChanged);
PREP(handleUnitInitPost);
-PREP(handleWokeUp);
+PREP(handleZeusDisplayChanged);
PREP(moduleSurrender);
PREP(setHandcuffed);
-PREP(surrender);
+PREP(setSurrendered);
PREP(vehicleCaptiveMoveIn);
PREP(vehicleCaptiveMoveOut);
diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp
index 27b7c4ec60..57de6ee970 100644
--- a/addons/captives/config.cpp
+++ b/addons/captives/config.cpp
@@ -16,16 +16,3 @@ class CfgPatches {
#include "CfgMoves.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
-
-
-class ACE_canInteractConditions {
- class GVAR(isNotEscorting) {
- condition = QUOTE(!(GETVAR(player,QGVAR(isEscorting),false)));
- };
- class GVAR(isNotHandcuffed) {
- condition = QUOTE(!(GETVAR(player,QGVAR(isHandcuffed),false)));
- };
- class GVAR(isNotSurrendering) {
- condition = QUOTE(!(GETVAR(player,QGVAR(isSurrendering),false)));
- };
-};
diff --git a/addons/captives/functions/fnc_canStopEscorting.sqf b/addons/captives/functions/fnc_canStopEscorting.sqf
index e6a5a0e568..56065a43fc 100644
--- a/addons/captives/functions/fnc_canStopEscorting.sqf
+++ b/addons/captives/functions/fnc_canStopEscorting.sqf
@@ -19,22 +19,10 @@
PARAMS_1(_unit);
DEFAULT_PARAM(1,_target,objNull);
-private ["_isAttached"];
-
if (isNull _target) then {
_target = _unit getVariable [QGVAR(escortedUnit), objNull];
};
-if (isNull _target) exitWith {
- ERROR("Null Target (no ACE_escortedUnit)");
- false
-};
+if (isNull _target) exitWith {false};
-_isAttached = _target in (attachedObjects _unit);
-
-if (_isAttached && (!(_target getVariable [QGVAR(isHandcuffed), false]))) exitWith {
- ERROR("Attached But Not Captive");
- false
-};
-
-_isAttached
+(_target in (attachedObjects _unit)) && {_target getVariable [QGVAR(isHandcuffed), false]}
diff --git a/addons/captives/functions/fnc_canSurrender.sqf b/addons/captives/functions/fnc_canSurrender.sqf
index 238087c62b..3ee687cfc1 100644
--- a/addons/captives/functions/fnc_canSurrender.sqf
+++ b/addons/captives/functions/fnc_canSurrender.sqf
@@ -18,5 +18,12 @@
PARAMS_2(_unit,_newSurrenderState);
-//TODO: any other conditions??
-(!((_unit getVariable [QGVAR(isSurrendering), false]) isEqualTo _newSurrenderState))
+private "_returnValue";
+
+_returnValue = if (_newSurrenderState) then {
+ !(_unit getVariable [QGVAR(isSurrendering), false]); //Not currently surrendering
+} else {
+ (_unit getVariable [QGVAR(isSurrendering), false]); //is Surrendering
+};
+
+_returnValue
diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf
index 299aa81631..08f44a1437 100644
--- a/addons/captives/functions/fnc_doEscortCaptive.sqf
+++ b/addons/captives/functions/fnc_doEscortCaptive.sqf
@@ -51,7 +51,7 @@ if (_state) then {
_unit setVariable [QGVAR(escortedUnit), objNull, true];
};
};
- [_escortFnc, 0.2, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
+ [_escortFnc, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
} else {
_unit setVariable [QGVAR(isEscorting), false, true];
diff --git a/addons/captives/functions/fnc_handleGetIn.sqf b/addons/captives/functions/fnc_handleGetIn.sqf
index 54133e2362..cf7d2c7271 100644
--- a/addons/captives/functions/fnc_handleGetIn.sqf
+++ b/addons/captives/functions/fnc_handleGetIn.sqf
@@ -19,6 +19,12 @@
PARAMS_3(_vehicle,_dontcare,_unit);
-if ((local _unit) && (_unit getVariable [QGVAR(isEscorting), false])) then {
- _unit setVariable [QGVAR(isEscorting), false, true];
+if (local _unit) then {
+ if (_unit getVariable [QGVAR(isEscorting), false]) then {
+ _unit setVariable [QGVAR(isEscorting), false, true];
+ };
+
+ if (_unit getVariable [QGVAR(isSurrendering), false]) then {
+ [_unit, false] call FUNC(setSurrender);
+ };
};
diff --git a/addons/captives/functions/fnc_handleKnockedOut.sqf b/addons/captives/functions/fnc_handleKnockedOut.sqf
deleted file mode 100644
index 3257d544ca..0000000000
--- a/addons/captives/functions/fnc_handleKnockedOut.sqf
+++ /dev/null
@@ -1,2 +0,0 @@
-// by commy2
-
diff --git a/addons/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf
new file mode 100644
index 0000000000..9b73d34485
--- /dev/null
+++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf
@@ -0,0 +1,36 @@
+/*
+ * Author: commy2, PabstMirror
+ * Handles the "medical_onUnconscious" event
+ *
+ * Arguments:
+ * 0: Unit