diff --git a/addons/captives/$PBOPREFIX$ b/addons/captives/$PBOPREFIX$
new file mode 100644
index 0000000000..aac16576c4
--- /dev/null
+++ b/addons/captives/$PBOPREFIX$
@@ -0,0 +1 @@
+z\ace\addons\captives
\ No newline at end of file
diff --git a/addons/captives/CfgEventHandlers.hpp b/addons/captives/CfgEventHandlers.hpp
new file mode 100644
index 0000000000..eb08f7e865
--- /dev/null
+++ b/addons/captives/CfgEventHandlers.hpp
@@ -0,0 +1,57 @@
+class Extended_PreInit_EventHandlers {
+ class ADDON {
+ init = QUOTE(call COMPILE_FILE(XEH_preInit));
+ };
+};
+
+class Extended_PostInit_EventHandlers {
+ class ADDON {
+ clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient));
+ };
+};
+
+//release escorted captive when entering a vehicle
+class Extended_GetIn_EventHandlers {
+ class All {
+ class GVAR(AutoDetachCaptive) {
+ getIn = "if (local (_this select 2) && {(_this select 2) getVariable ['ACE_isEscorting', false]}) then {(_this select 2) setVariable ['ACE_isEscorting', false, true]}";
+ };
+ };
+};
+
+//reset captive animation after leaving vehicle
+class Extended_GetOut_EventHandlers {
+ class All {
+ class GVAR(AutoDetachCaptive) {
+ getOut = "if (local (_this select 2) && {(_this select 2) getVariable ['ACE_isCaptive', false]}) then {_this call ACE_Captives_fnc_handleGetOut}";
+ };
+ };
+};
+
+//reset captivity and escorting status when getting killed
+class Extended_Killed_EventHandlers {
+ class CAManBase {
+ class GVAR(AutoDetachCaptive) {
+ killed = "if ((_this select 0) getVariable ['ACE_isCaptive', false]) then {(_this select 0) setVariable ['ACE_isCaptive', false, true]}; if ((_this select 0) getVariable ['ACE_isEscorting', false]) then {(_this select 0) setVariable ['ACE_isEscorting', false, true]};";
+ };
+ };
+};
+
+//handle captive and unconsciousness state
+class Extended_Init_EventHandlers {
+ class CAManBase {
+ class GVAR(AutoDetachCaptive) {
+ init = "_this call ACE_Captives_fnc_initUnit";
+ };
+ };
+};
+
+//mission start
+class Extended_InitPost_EventHandlers {
+ class CAManBase {
+ class GVAR(InitPost) {
+ init = "if (local (_this select 0)) then {_this call ACE_Captives_fnc_initPost};";
+ };
+ };
+};
+
diff --git a/addons/captives/CfgMoves.hpp b/addons/captives/CfgMoves.hpp
new file mode 100644
index 0000000000..da43b21aae
--- /dev/null
+++ b/addons/captives/CfgMoves.hpp
@@ -0,0 +1,90 @@
+class CfgMovesBasic {
+ class Actions {
+ class CivilStandActions;
+ class ACE_CivilStandCaptiveActions: CivilStandActions {
+ turnL = "";
+ turnR = "";
+ stop = "ACE_AmovPercMstpScapWnonDnon";
+ StopRelaxed = "ACE_AmovPercMstpScapWnonDnon";
+ default = "ACE_AmovPercMstpScapWnonDnon";
+ getOver = "";
+ throwPrepare = "";
+ throwGrenade[] = {"","Gesture"};
+ };
+ };
+};
+
+class CfgMovesMaleSdr: CfgMovesBasic {
+ class StandBase;
+ class States {
+ class AmovPercMstpSnonWnonDnon: StandBase {
+ ConnectTo[] += {"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1};
+ };
+
+ class CutSceneAnimationBase;
+ class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon: CutSceneAnimationBase {
+ actions = "ACE_CivilStandCaptiveActions";
+ file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_EaseIn";
+ speed = 1;
+ looped = 0;
+ interpolationRestart = 2;
+ ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1};
+ InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
+ };
+
+ class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
+ file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease";
+ speed = 0;
+ ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
+ InterpolateTo[] = {"Unconscious",0.01};
+ looped = 1;
+ };
+
+ class ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
+ actions = "CivilStandActions";
+ file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\amovpercmstpsnonwnondnon_easeout";
+ ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1};
+ InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1};
+ };
+ };
+};
+
+/*
+player playMove "ACE_AmovPercMstpScapWnonDnon";
+player switchMove "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon";
+*/
+
+/*class CfgMovesBasic;
+class CfgMovesMaleSdr: CfgMovesBasic {
+ class States {
+ class CutSceneAnimationBase;
+ class AmovPercMstpSnonWnonDnon_EaseIn: CutSceneAnimationBase {
+ head = "headDefault";
+ static = 1;
+ disableWeapons = 0;
+ forceAim = 0;
+ InterpolateTo[] = {"AmovPercMstpSnonWnonDnon_EaseOut",0.02,"Unconscious",0.1};
+ };
+ class AmovPercMstpSnonWnonDnon_Ease: AmovPercMstpSnonWnonDnon_EaseIn {
+ looped = 1;
+ InterpolateTo[] = {"Unconscious",0.1};
+ };
+ class AmovPercMstpSnonWnonDnon_EaseOut: AmovPercMstpSnonWnonDnon_EaseIn {
+ InterpolateTo[] = {"AmovPercMstpSnonWnonDnon_EaseIn",0.02,"Unconscious",0.1};
+ };
+
+ class AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon: CutSceneAnimationBase {
+ InterpolateTo[] = {"Unconscious",0.01,"AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
+ };
+
+ class AmovPercMstpSsurWnonDnon: AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
+ looped = 1;
+ InterpolateTo[] = {"Unconscious",0.01};
+ };
+
+ class AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
+ InterpolateTo[] = {"Unconscious",0.01,"AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon",0.1};
+ };
+ };
+};*/
+
diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp
new file mode 100644
index 0000000000..3036ccf196
--- /dev/null
+++ b/addons/captives/CfgVehicles.hpp
@@ -0,0 +1,157 @@
+class CfgVehicles {
+ class Man;
+ class CAManBase: Man {
+ class ACE_Actions {
+ class ACE_SetCaptive {
+ displayName = "$STR_ACE_Captives_SetCaptive";
+ distance = 4;
+ condition = "'ACE_CableTie' in items _player && {alive _target} && {!(_target getVariable ['ACE_isCaptive', false])}";
+ statement = "player removeItem 'ACE_CableTie'; [_target, true] call ACE_Captives_fnc_setCaptive";
+ showDisabled = 0;
+ priority = 2.4;
+ icon = "\ACE_Captives\UI\handcuff_ca.paa";
+ hotkey = "C";
+ };
+ class ACE_ReleaseCaptive {
+ displayName = "$STR_ACE_Captives_ReleaseCaptive";
+ distance = 4;
+ condition = "_target getVariable ['ACE_isCaptive', false] && {isNull (attachedTo _target)}";
+ statement = "[_target, false] call ACE_Captives_fnc_setCaptive";
+ exceptions[] = {"ACE_Interaction_isNotEscorting"};
+ showDisabled = 0;
+ priority = 2.4;
+ icon = "\ACE_Captives\UI\handcuff_ca.paa";
+ hotkey = "R";
+ };
+ class ACE_EscortCaptive {
+ displayName = "$STR_ACE_Captives_EscortCaptive";
+ distance = 4;
+ condition = "_target getVariable ['ACE_isCaptive', false] && {isNull (attachedTo _target)} && {alive _target} && {!(_target getVariable ['ACE_isUnconscious', false])}";
+ statement = "[_target, true] call ACE_Captives_fnc_escortCaptive";
+ exceptions[] = {"ACE_Interaction_isNotEscorting"};
+ showDisabled = 0;
+ icon = "\ACE_Captives\UI\captive_ca.paa";
+ priority = 2.3;
+ hotkey = "E";
+ };
+ class ACE_StopEscorting {
+ displayName = "$STR_ACE_Captives_StopEscorting";
+ distance = 4;
+ condition = "_target getVariable ['ACE_isCaptive', false] && {_target in attachedObjects _player}";
+ statement = "[_target, false] call ACE_Captives_fnc_escortCaptive";
+ exceptions[] = {"ACE_Interaction_isNotEscorting"};
+ showDisabled = 0;
+ icon = "\ACE_Captives\UI\captive_ca.paa";
+ priority = 2.3;
+ hotkey = "E";
+ };
+ class ACE_LoadCaptive {
+ displayName = "$STR_ACE_Captives_LoadCaptive";
+ distance = 4;
+ condition = "[_player, _target, objNull] call ACE_Captives_fnc_canLoadCaptive";
+ statement = "[_player, _target, objNull] call ACE_Captives_fnc_loadCaptive";
+ exceptions[] = {"ACE_Interaction_isNotEscorting"};
+ showDisabled = 0;
+ icon = "\ACE_Captives\UI\captive_ca.paa";
+ priority = 2.2;
+ hotkey = "L";
+ };
+ class ACE_FriskPerson {
+ displayName = "$STR_ACE_Captives_FriskPerson";
+ distance = 2;
+ condition = "[_player, _target] call ACE_Captives_fnc_canFriskPerson";
+ statement = "[_player, _target] call ACE_Captives_fnc_openFriskMenu";
+ showDisabled = 0;
+ //icon = ""; //@todo
+ priority = 3;
+ hotkey = "F";
+ };
+ };
+
+ class ACE_SelfActions {
+ class ACE_StopEscortingSelf {
+ displayName = "$STR_ACE_Captives_StopEscorting";
+ condition = "(_player getVariable ['ACE_escortedUnit', objNull]) getVariable ['ACE_isCaptive', false] && {(_player getVariable ['ACE_escortedUnit', objNull]) in attachedObjects _player}";
+ statement = "[_player getVariable ['ACE_escortedUnit', objNull], false] call ACE_Captives_fnc_escortCaptive;";
+ exceptions[] = {"ACE_Interaction_isNotEscorting"};
+ showDisabled = 0;
+ priority = 2.3;
+ hotkey = "C";
+ };
+ /*class ACE_LoadCaptiveSelf {
+ displayName = "$STR_ACE_Captives_LoadCaptive";
+ condition = "[_player, objNull, objNull] call ACE_Captives_fnc_canLoadCaptiveIntoVehicle";
+ statement = "[_player, objNull, objNull] call ACE_Captives_fnc_loadCaptiveIntoVehicle";
+ exceptions[] = {"ACE_Interaction_isNotEscorting"};
+ showDisabled = 0;
+ priority = 2.2;
+ hotkey = "K";
+ };*/
+ };
+ };
+
+ #define MACRO_LOADUNLOADCAPTIVE \
+ class ACE_Actions { \
+ class ACE_LoadCaptive { \
+ displayName = "$STR_ACE_Captives_LoadCaptive"; \
+ distance = 4; \
+ condition = "[_player, objNull, _target] call ACE_Captives_fnc_canLoadCaptive"; \
+ statement = "[_player, objNull, _target] call ACE_Captives_fnc_loadCaptive"; \
+ exceptions[] = {"ACE_Interaction_isNotEscorting"}; \
+ showDisabled = 0; \
+ priority = 1.2; \
+ hotkey = "L"; \
+ }; \
+ class ACE_UnloadCaptive { \
+ displayName = "$STR_ACE_Captives_UnloadCaptive"; \
+ distance = 4; \
+ condition = "[_player, _target] call ACE_Captives_fnc_canUnloadCaptive"; \
+ statement = "[_player, _target] call ACE_Captives_fnc_unloadCaptive"; \
+ showDisabled = 0; \
+ priority = 1.2; \
+ hotkey = "C"; \
+ }; \
+ };
+
+ class LandVehicle;
+ class Car: LandVehicle {
+ MACRO_LOADUNLOADCAPTIVE
+ };
+ class Tank: LandVehicle {
+ MACRO_LOADUNLOADCAPTIVE
+ };
+
+ class Air;
+ class Helicopter: Air {
+ MACRO_LOADUNLOADCAPTIVE
+ };
+ class Plane: Air {
+ MACRO_LOADUNLOADCAPTIVE
+ };
+
+ class Ship;
+ class Ship_F: Ship {
+ MACRO_LOADUNLOADCAPTIVE
+ };
+
+ class StaticWeapon: LandVehicle {
+ MACRO_LOADUNLOADCAPTIVE
+ };
+
+ class StaticMortar;
+ class Mortar_01_base_F: StaticMortar {
+ 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)
+ };
+ };
+};
diff --git a/addons/captives/CfgWeapons.hpp b/addons/captives/CfgWeapons.hpp
new file mode 100644
index 0000000000..3005a2fa5c
--- /dev/null
+++ b/addons/captives/CfgWeapons.hpp
@@ -0,0 +1,15 @@
+class CfgWeapons {
+ class ACE_ItemCore;
+ class InventoryItem_Base_F;
+
+ class ACE_CableTie: ACE_ItemCore {
+ displayName = "$STR_ACE_Captives_CableTie";
+ descriptionShort = "$STR_ACE_Captives_CableTieDescription";
+ model = QUOTE(PATHTOF(models\ace_cabletie.p3d));
+ picture = QUOTE(PATHTOF(UI\ace_cabletie_ca.paa));
+ scope = 2;
+ class ItemInfo: InventoryItem_Base_F {
+ mass = 1;
+ };
+ };
+};
diff --git a/addons/captives/UI/agm_cabletie_x_ca.paa b/addons/captives/UI/ace_cabletie_ca.paa
similarity index 100%
rename from addons/captives/UI/agm_cabletie_x_ca.paa
rename to addons/captives/UI/ace_cabletie_ca.paa
diff --git a/addons/captives/XEH_postInitClient.sqf b/addons/captives/XEH_postInitClient.sqf
new file mode 100644
index 0000000000..a08c5d4239
--- /dev/null
+++ b/addons/captives/XEH_postInitClient.sqf
@@ -0,0 +1,3 @@
+// by commy2
+
+[missionNamespace, "playerChanged", {_this call ACE_Captives_fnc_handlePlayerChanged}] call ACE_Core_fnc_addCustomEventhandler;
diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf
new file mode 100644
index 0000000000..5e6f35bc48
--- /dev/null
+++ b/addons/captives/XEH_preInit.sqf
@@ -0,0 +1,22 @@
+#include "script_component.hpp"
+
+ADDON = false;
+
+PREP(empty);
+PREP(canFriskPerson);
+PREP(canLoadCaptive);
+PREP(canUnloadCaptive);
+PREP(escortCaptive);
+PREP(handleGetOut);
+PREP(handleKnockedOut);
+PREP(handlePlayerChanged);
+PREP(handleWokeUp);
+PREP(initPost);
+PREP(initUnit);
+PREP(loadCaptive);
+PREP(openFriskMenu);
+PREP(setCaptive);
+PREP(surrender);
+PREP(unloadCaptive);
+
+ADDON = true;
diff --git a/addons/captives/agm_cabletie.p3d b/addons/captives/agm_cabletie.p3d
deleted file mode 100644
index e0804b8c5f..0000000000
Binary files a/addons/captives/agm_cabletie.p3d and /dev/null differ
diff --git a/addons/captives/clientInit.sqf b/addons/captives/clientInit.sqf
deleted file mode 100644
index bb7c5ebbb0..0000000000
--- a/addons/captives/clientInit.sqf
+++ /dev/null
@@ -1,3 +0,0 @@
-// by commy2
-
-[missionNamespace, "playerChanged", {_this call AGM_Captives_fnc_handlePlayerChanged}] call AGM_Core_fnc_addCustomEventhandler;
diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp
index 56b3f8bc32..7aaa310183 100644
--- a/addons/captives/config.cpp
+++ b/addons/captives/config.cpp
@@ -1,363 +1,28 @@
+#include "script_component.hpp"
+
class CfgPatches {
- class AGM_Captives {
- units[] = {};
- weapons[] = {"AGM_CableTie"};
- requiredVersion = 0.60;
- requiredAddons[] = {AGM_Core, AGM_Interaction};
- version = "0.95";
- versionStr = "0.95";
- versionAr[] = {0,95,0};
- author[] = {"commy2", "KoffeinFlummi"};
- authorUrl = "https://github.com/commy2/";
- };
+ class ADDON {
+ units[] = {};
+ weapons[] = {"ACE_CableTie"};
+ requiredVersion = REQUIRED_VERSION;
+ requiredAddons[] = {"ACE_Interaction"};
+ author[] = {"commy2", "KoffeinFlummi"};
+ authorUrl = "https://github.com/commy2/";
+ VERSION_CONFIG;
+ };
};
-class CfgFunctions {
- class AGM_Captives {
- class AGM_Captives {
- file = "\AGM_Captives\functions";
- class canFriskPerson;
- class canLoadCaptive;
- class canUnloadCaptive;
- class escortCaptive;
- class handleGetOut;
- class handleKnockedOut;
- class handlePlayerChanged;
- class handleWokeUp;
- class initPost;
- class initUnit;
- class loadCaptive;
- class openFriskMenu;
- class setCaptive;
- class surrender;
- class unloadCaptive;
+#include "CfgEventHandlers.hpp"
+
+
+class ACE_Core_canInteractConditions {
+ class ACE_Interaction_isNotEscorting {
+ condition = "!(_player getVariable ['ACE_isEscorting', false])";
+ };
+ class ACE_Interaction_isNotCaptive {
+ condition = "!(_player getVariable ['ACE_isCaptive', false])";
+ };
+ class ACE_Interaction_isNotSurrendering {
+ condition = "!(_player getVariable ['ACE_isSurrender', false])";
};
- };
};
-
-//release escorted captive when entering a vehicle
-class Extended_GetIn_EventHandlers {
- class All {
- class AGM_Captives_AutoDetachCaptive {
- getIn = "if (local (_this select 2) && {(_this select 2) getVariable ['AGM_isEscorting', false]}) then {(_this select 2) setVariable ['AGM_isEscorting', false, true]}";
- };
- };
-};
-
-//reset captive animation after leaving vehicle
-class Extended_GetOut_EventHandlers {
- class All {
- class AGM_Captives_LeaveVehicle {
- getOut = "if (local (_this select 2) && {(_this select 2) getVariable ['AGM_isCaptive', false]}) then {_this call AGM_Captives_fnc_handleGetOut}";
- };
- };
-};
-
-//reset captivity and escorting status when getting killed
-class Extended_Killed_EventHandlers {
- class CAManBase {
- class AGM_Captives_AutoDetachCaptive {
- killed = "if ((_this select 0) getVariable ['AGM_isCaptive', false]) then {(_this select 0) setVariable ['AGM_isCaptive', false, true]}; if ((_this select 0) getVariable ['AGM_isEscorting', false]) then {(_this select 0) setVariable ['AGM_isEscorting', false, true]};";
- };
- };
-};
-
-//handle captive and unconsciousness state
-class Extended_Init_EventHandlers {
- class CAManBase {
- class AGM_Captives_AutoDetachCaptive {
- init = "_this call AGM_Captives_fnc_initUnit";
- };
- };
-};
-
-//mission start
-class Extended_InitPost_EventHandlers {
- class CAManBase {
- class AGM_Captives_InitPost {
- init = "if (local (_this select 0)) then {_this call AGM_Captives_fnc_initPost};";
- };
- };
-};
-
-class Extended_PostInit_EventHandlers {
- class AGM_Captives {
- clientInit = "call compile preprocessFileLineNumbers '\AGM_Captives\clientInit.sqf'";
- };
-};
-
-class AGM_Core_canInteractConditions {
- class AGM_Interaction_isNotEscorting {
- condition = "!(_player getVariable ['AGM_isEscorting', false])";
- };
- class AGM_Interaction_isNotCaptive {
- condition = "!(_player getVariable ['AGM_isCaptive', false])";
- };
- class AGM_Interaction_isNotSurrendering {
- condition = "!(_player getVariable ['AGM_isSurrender', false])";
- };
-};
-
-class CfgVehicles {
- class Man;
- class CAManBase: Man {
- class AGM_Actions {
- class AGM_SetCaptive {
- displayName = "$STR_AGM_Captives_SetCaptive";
- distance = 4;
- condition = "'AGM_CableTie' in items _player && {alive _target} && {!(_target getVariable ['AGM_isCaptive', false])}";
- statement = "player removeItem 'AGM_CableTie'; [_target, true] call AGM_Captives_fnc_setCaptive";
- showDisabled = 0;
- priority = 2.4;
- icon = "\AGM_Captives\UI\handcuff_ca.paa";
- hotkey = "C";
- };
- class AGM_ReleaseCaptive {
- displayName = "$STR_AGM_Captives_ReleaseCaptive";
- distance = 4;
- condition = "_target getVariable ['AGM_isCaptive', false] && {isNull (attachedTo _target)}";
- statement = "[_target, false] call AGM_Captives_fnc_setCaptive";
- exceptions[] = {"AGM_Interaction_isNotEscorting"};
- showDisabled = 0;
- priority = 2.4;
- icon = "\AGM_Captives\UI\handcuff_ca.paa";
- hotkey = "R";
- };
- class AGM_EscortCaptive {
- displayName = "$STR_AGM_Captives_EscortCaptive";
- distance = 4;
- condition = "_target getVariable ['AGM_isCaptive', false] && {isNull (attachedTo _target)} && {alive _target} && {!(_target getVariable ['AGM_isUnconscious', false])}";
- statement = "[_target, true] call AGM_Captives_fnc_escortCaptive";
- exceptions[] = {"AGM_Interaction_isNotEscorting"};
- showDisabled = 0;
- icon = "\AGM_Captives\UI\captive_ca.paa";
- priority = 2.3;
- hotkey = "E";
- };
- class AGM_StopEscorting {
- displayName = "$STR_AGM_Captives_StopEscorting";
- distance = 4;
- condition = "_target getVariable ['AGM_isCaptive', false] && {_target in attachedObjects _player}";
- statement = "[_target, false] call AGM_Captives_fnc_escortCaptive";
- exceptions[] = {"AGM_Interaction_isNotEscorting"};
- showDisabled = 0;
- icon = "\AGM_Captives\UI\captive_ca.paa";
- priority = 2.3;
- hotkey = "E";
- };
- class AGM_LoadCaptive {
- displayName = "$STR_AGM_Captives_LoadCaptive";
- distance = 4;
- condition = "[_player, _target, objNull] call AGM_Captives_fnc_canLoadCaptive";
- statement = "[_player, _target, objNull] call AGM_Captives_fnc_loadCaptive";
- exceptions[] = {"AGM_Interaction_isNotEscorting"};
- showDisabled = 0;
- icon = "\AGM_Captives\UI\captive_ca.paa";
- priority = 2.2;
- hotkey = "L";
- };
- class AGM_FriskPerson {
- displayName = "$STR_AGM_Captives_FriskPerson";
- distance = 2;
- condition = "[_player, _target] call AGM_Captives_fnc_canFriskPerson";
- statement = "[_player, _target] call AGM_Captives_fnc_openFriskMenu";
- showDisabled = 0;
- //icon = ""; //@todo
- priority = 3;
- hotkey = "F";
- };
- };
-
- class AGM_SelfActions {
- class AGM_StopEscortingSelf {
- displayName = "$STR_AGM_Captives_StopEscorting";
- condition = "(_player getVariable ['AGM_escortedUnit', objNull]) getVariable ['AGM_isCaptive', false] && {(_player getVariable ['AGM_escortedUnit', objNull]) in attachedObjects _player}";
- statement = "[_player getVariable ['AGM_escortedUnit', objNull], false] call AGM_Captives_fnc_escortCaptive;";
- exceptions[] = {"AGM_Interaction_isNotEscorting"};
- showDisabled = 0;
- priority = 2.3;
- hotkey = "C";
- };
- /*class AGM_LoadCaptiveSelf {
- displayName = "$STR_AGM_Captives_LoadCaptive";
- condition = "[_player, objNull, objNull] call AGM_Captives_fnc_canLoadCaptiveIntoVehicle";
- statement = "[_player, objNull, objNull] call AGM_Captives_fnc_loadCaptiveIntoVehicle";
- exceptions[] = {"AGM_Interaction_isNotEscorting"};
- showDisabled = 0;
- priority = 2.2;
- hotkey = "K";
- };*/
- };
- };
-
- #define MACRO_LOADUNLOADCAPTIVE \
- class AGM_Actions { \
- class AGM_LoadCaptive { \
- displayName = "$STR_AGM_Captives_LoadCaptive"; \
- distance = 4; \
- condition = "[_player, objNull, _target] call AGM_Captives_fnc_canLoadCaptive"; \
- statement = "[_player, objNull, _target] call AGM_Captives_fnc_loadCaptive"; \
- exceptions[] = {"AGM_Interaction_isNotEscorting"}; \
- showDisabled = 0; \
- priority = 1.2; \
- hotkey = "L"; \
- }; \
- class AGM_UnloadCaptive { \
- displayName = "$STR_AGM_Captives_UnloadCaptive"; \
- distance = 4; \
- condition = "[_player, _target] call AGM_Captives_fnc_canUnloadCaptive"; \
- statement = "[_player, _target] call AGM_Captives_fnc_unloadCaptive"; \
- showDisabled = 0; \
- priority = 1.2; \
- hotkey = "C"; \
- }; \
- };
-
- class LandVehicle;
- class Car: LandVehicle {
- MACRO_LOADUNLOADCAPTIVE
- };
- class Tank: LandVehicle {
- MACRO_LOADUNLOADCAPTIVE
- };
-
- class Air;
- class Helicopter: Air {
- MACRO_LOADUNLOADCAPTIVE
- };
- class Plane: Air {
- MACRO_LOADUNLOADCAPTIVE
- };
-
- class Ship;
- class Ship_F: Ship {
- MACRO_LOADUNLOADCAPTIVE
- };
-
- class StaticWeapon: LandVehicle {
- MACRO_LOADUNLOADCAPTIVE
- };
-
- class StaticMortar;
- class Mortar_01_base_F: StaticMortar {
- MACRO_LOADUNLOADCAPTIVE
- };
-
- #define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
- name = #ITEM; \
- count = COUNT; \
- };
-
- class Box_NATO_Support_F;
- class AGM_Box_Misc: Box_NATO_Support_F {
- class TransportItems {
- MACRO_ADDITEM(AGM_CableTie,12)
- };
- };
-};
-
-class CfgWeapons {
- class AGM_ItemCore;
- class InventoryItem_Base_F;
-
- class AGM_CableTie: AGM_ItemCore {
- displayName = "$STR_AGM_Captives_CableTie";
- descriptionShort = "$STR_AGM_Captives_CableTieDescription";
- model = "\AGM_Captives\agm_cabletie.p3d";
- picture = "\AGM_Captives\UI\agm_cabletie_x_ca.paa";
- scope = 2;
- class ItemInfo: InventoryItem_Base_F {
- mass = 1;
- };
- };
-};
-
-/*class CfgMovesBasic;
-class CfgMovesMaleSdr: CfgMovesBasic {
- class States {
- class CutSceneAnimationBase;
- class AmovPercMstpSnonWnonDnon_EaseIn: CutSceneAnimationBase {
- head = "headDefault";
- static = 1;
- disableWeapons = 0;
- forceAim = 0;
- InterpolateTo[] = {"AmovPercMstpSnonWnonDnon_EaseOut",0.02,"Unconscious",0.1};
- };
- class AmovPercMstpSnonWnonDnon_Ease: AmovPercMstpSnonWnonDnon_EaseIn {
- looped = 1;
- InterpolateTo[] = {"Unconscious",0.1};
- };
- class AmovPercMstpSnonWnonDnon_EaseOut: AmovPercMstpSnonWnonDnon_EaseIn {
- InterpolateTo[] = {"AmovPercMstpSnonWnonDnon_EaseIn",0.02,"Unconscious",0.1};
- };
-
- class AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon: CutSceneAnimationBase {
- InterpolateTo[] = {"Unconscious",0.01,"AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
- };
-
- class AmovPercMstpSsurWnonDnon: AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
- looped = 1;
- InterpolateTo[] = {"Unconscious",0.01};
- };
-
- class AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
- InterpolateTo[] = {"Unconscious",0.01,"AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon",0.1};
- };
- };
-};*/
-
-class CfgMovesBasic {
- class Actions {
- class CivilStandActions;
- class AGM_CivilStandCaptiveActions: CivilStandActions {
- turnL = "";
- turnR = "";
- stop = "AGM_AmovPercMstpScapWnonDnon";
- StopRelaxed = "AGM_AmovPercMstpScapWnonDnon";
- default = "AGM_AmovPercMstpScapWnonDnon";
- getOver = "";
- throwPrepare = "";
- throwGrenade[] = {"","Gesture"};
- };
- };
-};
-
-class CfgMovesMaleSdr: CfgMovesBasic {
- class StandBase;
- class States {
- class AmovPercMstpSnonWnonDnon: StandBase {
- ConnectTo[] += {"AGM_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1};
- };
-
- class CutSceneAnimationBase;
- class AGM_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon: CutSceneAnimationBase {
- actions = "AGM_CivilStandCaptiveActions";
- file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_EaseIn";
- speed = 1;
- looped = 0;
- interpolationRestart = 2;
- ConnectTo[] = {"AGM_AmovPercMstpScapWnonDnon",0.1};
- InterpolateTo[] = {"Unconscious",0.01,"AGM_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
- };
-
- class AGM_AmovPercMstpScapWnonDnon: AGM_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
- file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease";
- speed = 0;
- ConnectTo[] = {"AGM_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
- InterpolateTo[] = {"Unconscious",0.01};
- looped = 1;
- };
-
- class AGM_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon: AGM_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
- actions = "CivilStandActions";
- file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\amovpercmstpsnonwnondnon_easeout";
- ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1};
- InterpolateTo[] = {"Unconscious",0.01,"AGM_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1};
- };
- };
-};
-
-/*
-player playMove "AGM_AmovPercMstpScapWnonDnon";
-player switchMove "AGM_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon";
-*/
diff --git a/addons/captives/functions/fn_canFriskPerson.sqf b/addons/captives/functions/fn_canFriskPerson.sqf
deleted file mode 100644
index 77ad6f6446..0000000000
--- a/addons/captives/functions/fn_canFriskPerson.sqf
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * By: bux578
- *
- * Checks the conditions for being able to frisk a unit
- *
- * Arguments:
- * 0: caller (player) (Object)
- * 1: target (Object)
- *
- * Return Value:
- * Boolean
- */
-
-private ["_unit", "_target"];
-
-_unit = _this select 0;
-_target = _this select 1;
-
- _target getVariable ["AGM_isCaptive", false]
-|| {_target getVariable ["AGM_isSearchable", false]}
-|| {_target getVariable ["AGM_isUnconscious", false]}
diff --git a/addons/captives/functions/fn_canLoadCaptive.sqf b/addons/captives/functions/fn_canLoadCaptive.sqf
deleted file mode 100644
index 637a4889af..0000000000
--- a/addons/captives/functions/fn_canLoadCaptive.sqf
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Author: commy2
- *
- * Check if the unit can load the target object into a vehicle.
- *
- * Argument:
- * 0: Unit that wants to load a captive (Object)
- * 1: A captive. ObjNull for the first escorted captive (Object)
- * 2: Vehicle to load the captive into. ObjNull for the nearest vehicle (Object)
- *
- * Return value:
- * Boolean (Bool)
- */
-
-private ["_unit", "_target", "_vehicle", "_objects"];
-
-_unit = _this select 0;
-_target = _this select 1;
-_vehicle = _this select 2;
-
-if (isNull _target) then {
- _objects = attachedObjects _unit;
- _objects = [_objects, {_this getVariable ["AGM_isCaptive", false]}] call AGM_Core_fnc_filter;
- _target = _objects select 0;
-};
-
-if (isNull _vehicle) then {
- _objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship_F"], 10];
- _vehicle = _objects select 0;
-};
-
-_unit getVariable ["AGM_isEscorting", false]
-&& {!isNil "_target"}
-&& {!isNil "_vehicle"}
-&& {_vehicle emptyPositions "cargo" > 0}
diff --git a/addons/captives/functions/fn_canUnloadCaptive.sqf b/addons/captives/functions/fn_canUnloadCaptive.sqf
deleted file mode 100644
index 8c52bac0b0..0000000000
--- a/addons/captives/functions/fn_canUnloadCaptive.sqf
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Author: commy2
- *
- * Check if the unit can unload a captive from the vehicle.
- *
- * Argument:
- * 0: Unit that wants to unload a captive (Object)
- * 1: Vehicle to unload a captive from. (Object)
- *
- * Return value:
- * Boolean (Bool)
- */
-
-private ["_unit", "_vehicle", "_cargo"];
-
-_unit = _this select 0;
-_vehicle = _this select 1;
-
-_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway.
-
-_cargo = [_cargo, {_this getVariable ["AGM_isCaptive", false]}] call AGM_Core_fnc_filter;
-
-count _cargo > 0
diff --git a/addons/captives/functions/fn_escortCaptive.sqf b/addons/captives/functions/fn_escortCaptive.sqf
deleted file mode 100644
index 55244cf2f8..0000000000
--- a/addons/captives/functions/fn_escortCaptive.sqf
+++ /dev/null
@@ -1,43 +0,0 @@
-//author : Nic547
-//Attaches a Captive to the player
-
-private ["_unit", "_state"];
-
-_unit = _this select 0;
-_state = _this select 1;
-
-if !("AGM_Handcuffed" in ([_unit] call AGM_Core_fnc_getCaptivityStatus)) exitWith {
- [localize "STR_AGM_Captives_NoCaptive"] call AGM_Core_fnc_displayTextStructured;
-};
-
-if (_state) then {
- if (player getVariable ["AGM_isEscorting", false]) exitWith {};
-
- [player, _unit] call AGM_Core_fnc_claim;
- player setVariable ["AGM_isEscorting", true, true];
-
- _unit attachTo [player, [0, 1, 0]];
-
- player setVariable ["AGM_escortedUnit", _unit, true];
- _actionID = player addAction [format ["%1", localize "STR_AGM_Captives_StopEscorting"], "[player getVariable ['AGM_escortedUnit', objNull], false] call AGM_Captives_fnc_escortCaptive;", nil, 20, false, true, "", "!isNull (player getVariable ['AGM_escortedUnit', objNull])"];
-
- [_unit, _actionID] spawn {
- _unit = _this select 0;
- _actionID = _this select 1;
-
- while {player getVariable ["AGM_isEscorting", false]} do {
- sleep 0.2;
-
- if (!alive _unit || {!alive player} || {!canStand _unit} || {!canStand player} || {_unit getVariable ["AGM_isUnconscious", false]} || {player getVariable ["AGM_isUnconscious", false]} || {!isNull (attachedTo player)}) then {
- player setVariable ["AGM_isEscorting", false, true];
- };
- };
- [objNull, _unit] call AGM_Core_fnc_claim;
-
- detach _unit;
- player removeAction _actionID;
- };
-} else {
- player setVariable ["AGM_isEscorting", false, true];
- player setVariable ["AGM_escortedUnit", objNull, true];
-};
diff --git a/addons/captives/functions/fn_handleGetOut.sqf b/addons/captives/functions/fn_handleGetOut.sqf
deleted file mode 100644
index 0cb88b0a8e..0000000000
--- a/addons/captives/functions/fn_handleGetOut.sqf
+++ /dev/null
@@ -1,14 +0,0 @@
-// by commy2
-
-private ["_vehicle", "_unit", "_cargoIndex"];
-
-_vehicle = _this select 0;
-_unit = _this select 2;
-
-_cargoIndex = _unit getVariable ["AGM_Captives_CargoIndex", -1];
-
-if (_cargoIndex != -1) exitWith {
- _unit moveInCargo [_vehicle, _cargoIndex];
-};
-
-[_unit, 'AGM_AmovPercMstpScapWnonDnon', 2] call AGM_Core_fnc_doAnimation;
diff --git a/addons/captives/functions/fn_handlePlayerChanged.sqf b/addons/captives/functions/fn_handlePlayerChanged.sqf
deleted file mode 100644
index 5bece824f9..0000000000
--- a/addons/captives/functions/fn_handlePlayerChanged.sqf
+++ /dev/null
@@ -1,12 +0,0 @@
-// by commy2
-
-private ["_unit", "_oldUnit"];
-
-_unit = _this select 0;
-_oldUnit = _this select 1;
-
-if (_unit getVariable ["AGM_isCaptive", false]) then {
- showHUD false;
-} else {
- showHUD true;
-};
diff --git a/addons/captives/functions/fn_handleWokeUp.sqf b/addons/captives/functions/fn_handleWokeUp.sqf
deleted file mode 100644
index facbf9b31f..0000000000
--- a/addons/captives/functions/fn_handleWokeUp.sqf
+++ /dev/null
@@ -1,10 +0,0 @@
-// by commy2
-
-private "_unit";
-
-_unit = _this select 0;
-
-if (_unit getVariable ["AGM_isCaptive", false] && {vehicle _unit == _unit}) then {
- [_unit] call AGM_Core_fnc_fixLoweredRifleAnimation;
- [_unit, "AGM_AmovPercMstpScapWnonDnon", 0] call AGM_Core_fnc_doAnimation;
-};
diff --git a/addons/captives/functions/fn_initPost.sqf b/addons/captives/functions/fn_initPost.sqf
deleted file mode 100644
index 73c9674f7a..0000000000
--- a/addons/captives/functions/fn_initPost.sqf
+++ /dev/null
@@ -1,11 +0,0 @@
-// by commy2
-
-private "_unit";
-
-_unit = _this select 0;
-
-// reset status on mission start
-if (_unit getVariable ["AGM_isCaptive", false]) then {
- _unit setVariable ["AGM_isCaptive", false];
- [_unit, true] call AGM_Captives_fnc_setCaptive;
-};
diff --git a/addons/captives/functions/fn_initUnit.sqf b/addons/captives/functions/fn_initUnit.sqf
deleted file mode 100644
index 76d4671b7f..0000000000
--- a/addons/captives/functions/fn_initUnit.sqf
+++ /dev/null
@@ -1,12 +0,0 @@
-// by commy2
-
-[_this select 0, "knockedOut", {
- if (local (_this select 0)) then {_this call AGM_Captives_fnc_handleKnockedOut};
-}] call AGM_Core_fnc_addCustomEventhandler;
-
-[_this select 0, "wokeUp", {
- if (local (_this select 0)) then {_this call AGM_Captives_fnc_handleWokeUp};
-}] call AGM_Core_fnc_addCustomEventhandler;
-
-// prevent players from throwing grenades
-[_this select 0, "Throw", {(_this select 1) getVariable ["AGM_isCaptive", false]}, {}] call AGM_Core_fnc_addActionEventhandler;
diff --git a/addons/captives/functions/fn_setCaptive.sqf b/addons/captives/functions/fn_setCaptive.sqf
deleted file mode 100644
index a2e4ed7e3e..0000000000
--- a/addons/captives/functions/fn_setCaptive.sqf
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Author: Nic547, commy2
- *
- * Makes a civilian unable to move.
- *
- * Argument:
- * 0: Unit (Object)
- * 1: True to take captive, false to release captive (Object)
- *
- * Return value:
- * Nothing
- */
-
-private ["_unit", "_state"];
-
-_unit = _this select 0;
-_state = _this select 1;
-
-if (!local _unit) exitWith {[[_unit, _state, true], _fnc_scriptName, _unit] call AGM_Core_fnc_execRemoteFnc};
-
-if (_state) then {
- if (_unit getVariable ["AGM_isCaptive", false]) exitWith {};
-
- _unit setVariable ["AGM_isCaptive", true, true];
-
- // fix anim on mission start (should work on dedicated servers)
- _unit spawn {
- [_this, "AGM_Handcuffed", true] call AGM_Core_fnc_setCaptivityStatus;
-
- if (_this getVariable ["AGM_isCaptive", false] && {vehicle _this == _this}) then {
- [_this] call AGM_Core_fnc_fixLoweredRifleAnimation;
- [_this, "AGM_AmovPercMstpScapWnonDnon", 0] spawn AGM_Core_fnc_doAnimation;
- };
- };
-
- _unit setVariable ["AGM_Captives_CargoIndex", vehicle _unit getCargoIndex _unit, true];
-
- if (_unit == AGM_player) then {
- showHUD false;
- };
-} else {
- if !(_unit getVariable ["AGM_isCaptive", false]) exitWith {};
-
- _unit setVariable ["AGM_isCaptive", false, true];
- [_unit, "AGM_Handcuffed", false] call AGM_Core_fnc_setCaptivityStatus;
- if (vehicle _unit == _unit) then {
- [_unit, "AGM_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call AGM_Core_fnc_doAnimation;
- };
-
- if (_unit getVariable ["AGM_Captives_CargoIndex", -1] != -1) then {
- _unit setVariable ["AGM_Captives_CargoIndex", -1, true];
- };
-
- if (_unit == AGM_player) then {
- showHUD true;
- };
-};
diff --git a/addons/captives/functions/fn_unloadCaptive.sqf b/addons/captives/functions/fn_unloadCaptive.sqf
deleted file mode 100644
index e7849f1c0e..0000000000
--- a/addons/captives/functions/fn_unloadCaptive.sqf
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Author: commy2
- *
- * Unit unloads a captive from a vehicle.
- *
- * Argument:
- * 0: Unit that wants to unload a captive (Object)
- * 1: Vehicle to unload a captive from. (Object)
- *
- * Return value:
- * Nothing
- */
-
-private ["_unit", "_vehicle", "_cargo", "_target"];
-
-_unit = _this select 0;
-_vehicle = _this select 1;
-
-_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway.
-
-_cargo = [_cargo, {_this getVariable ["AGM_isCaptive", false]}] call AGM_Core_fnc_filter;
-
-if (count _cargo > 0) then {
- _target = _cargo select 0;
-
- _target setVariable ["AGM_Captives_CargoIndex", -1, true];
-
- moveOut _target;
- [_target, "AGM_AmovPercMstpScapWnonDnon", 2] call AGM_Core_fnc_doAnimation;
- [_target, "{unassignVehicle _this}", _target] call AGM_Core_fnc_execRemoteFnc;
-};
diff --git a/addons/captives/functions/fnc_canFriskPerson.sqf b/addons/captives/functions/fnc_canFriskPerson.sqf
new file mode 100644
index 0000000000..62d5a06742
--- /dev/null
+++ b/addons/captives/functions/fnc_canFriskPerson.sqf
@@ -0,0 +1,23 @@
+/*
+ * Author: bux578
+ * Checks the conditions for being able to frisk a unit
+ *
+ * Arguments:
+ * 0: caller (player)