Captives First Pass

This commit is contained in:
PabstMirror 2015-02-02 20:04:50 -06:00
parent 3865598095
commit 982f3b230a
42 changed files with 907 additions and 695 deletions

View File

@ -0,0 +1 @@
z\ace\addons\captives

View File

@ -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};";
};
};
};

View File

@ -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};
};
};
};*/

View File

@ -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)
};
};
};

View File

@ -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;
};
};
};

View File

@ -0,0 +1,3 @@
// by commy2
[missionNamespace, "playerChanged", {_this call ACE_Captives_fnc_handlePlayerChanged}] call ACE_Core_fnc_addCustomEventhandler;

View File

@ -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;

Binary file not shown.

View File

@ -1,3 +0,0 @@
// by commy2
[missionNamespace, "playerChanged", {_this call AGM_Captives_fnc_handlePlayerChanged}] call AGM_Core_fnc_addCustomEventhandler;

View File

@ -1,363 +1,28 @@
#include "script_component.hpp"
class CfgPatches {
class AGM_Captives {
class ADDON {
units[] = {};
weapons[] = {"AGM_CableTie"};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core, AGM_Interaction};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
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"
//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}";
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])";
};
};
};
//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";
*/

View File

@ -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]}

View File

@ -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}

View File

@ -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

View File

@ -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 ["<t color='#FF0000'>%1</t>", 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];
};

View File

@ -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;

View File

@ -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;
};

View File

@ -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;
};

View File

@ -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;
};

View File

@ -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;

View File

@ -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;
};
};

View File

@ -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;
};

View File

@ -0,0 +1,23 @@
/*
* Author: bux578
* Checks the conditions for being able to frisk a unit
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: target <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* -
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_target);
_target getVariable ["ACE_isCaptive", false]
|| {_target getVariable ["ACE_isSearchable", false]}
|| {_target getVariable ["ACE_isUnconscious", false]}

View File

@ -0,0 +1,38 @@
/*
* Author: commy2
* Check if the unit can load the target object into a vehicle.
*
* Arguments:
* 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:
* The return value <BOOL>
*
* Example:
* -
*
* Public: No
*/
#include "script_component.hpp"
private ["_objects"];
PARAMS_3(_unit,_target,_vehicle);
if (isNull _target) then {
_objects = attachedObjects _unit;
_objects = [_objects, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,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 ["ACE_isEscorting", false]
&& {!isNil "_target"}
&& {!isNil "_vehicle"}
&& {_vehicle emptyPositions "cargo" > 0}

View File

@ -0,0 +1,28 @@
/*
* Author: commy2
* Check if the unit can unload a captive from the vehicle.
*
* Arguments:
* 0: Unit that wants to unload a captive <OBJECT>
* 1: A captive. ObjNull for the first escorted captive <OBJECT>
* 2: Vehicle to unload a captive from <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* -
*
* Public: No
*/
#include "script_component.hpp"
private ["_cargo"];
PARAMS_2(_unit,_vehicle);
_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway.
_cargo = [_cargo, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter);
count _cargo > 0

View File

@ -0,0 +1,55 @@
/*
* Author: Nic547
* Attaches a Captive to the player
*
* Arguments:
* 0: _unit <OBJECT>
* 1: _state <BOOL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* -
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_state);
if !("ACE_Handcuffed" in ([_unit] call ACE_Core_fnc_getCaptivityStatus)) exitWith {
[localize "STR_ACE_Captives_NoCaptive"] call EFUNC(common,displayTextStructured);
};
if (_state) then {
if (player getVariable ["ACE_isEscorting", false]) exitWith {};
[player, _unit] call EFUNC(common,claim);
player setVariable ["ACE_isEscorting", true, true];
_unit attachTo [player, [0, 1, 0]];
player setVariable ["ACE_escortedUnit", _unit, true];
_actionID = player addAction [format ["<t color='#FF0000'>%1</t>", localize "STR_ACE_Captives_StopEscorting"], "[player getVariable ['ACE_escortedUnit', objNull], false] call ACE_Captives_fnc_escortCaptive;", nil, 20, false, true, "", "!isNull (player getVariable ['ACE_escortedUnit', objNull])"];
[_unit, _actionID] spawn {
_unit = _this select 0;
_actionID = _this select 1;
while {player getVariable ["ACE_isEscorting", false]} do {
sleep 0.2;
if (!alive _unit || {!alive player} || {!canStand _unit} || {!canStand player} || {_unit getVariable ["ACE_isUnconscious", false]} || {player getVariable ["ACE_isUnconscious", false]} || {!isNull (attachedTo player)}) then {
player setVariable ["ACE_isEscorting", false, true];
};
};
[objNull, _unit] call EFUNC(common,claim);
detach _unit;
player removeAction _actionID;
};
} else {
player setVariable ["ACE_isEscorting", false, true];
player setVariable ["ACE_escortedUnit", objNull, true];
};

View File

@ -0,0 +1,29 @@
/*
* Author: commy2
* X
*
* Arguments:
* 0: _vehicle <OBJECT>
* 1: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* -
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_vehicle,_unit);
private ["_cargoIndex"];
_cargoIndex = _unit getVariable ["ACE_Captives_CargoIndex", -1];
if (_cargoIndex != -1) exitWith {
_unit moveInCargo [_vehicle, _cargoIndex];
};
[_unit, 'ACE_AmovPercMstpScapWnonDnon', 2] call EFUNC(common,doAnimation);

View File

@ -0,0 +1,25 @@
/*
* Author: commy2
* TODO
*
* Arguments:
* 0: _unit <OBJECT>
* 1: _oldUnit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* TODO
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_oldUnit);
if (_unit getVariable ["ACE_isCaptive", false]) then {
showHUD false;
} else {
showHUD true;
};

View File

@ -0,0 +1,23 @@
/*
* Author: commy2
* TODO
*
* Arguments:
* 0: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* TODO
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_unit);
if (_unit getVariable ["ACE_isCaptive", false] && {vehicle _unit == _unit}) then {
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation);
};

View File

@ -0,0 +1,24 @@
/*
* Author: commy2
* TODO
*
* Arguments:
* 0: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* TODO
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_unit);
// reset status on mission start
if (_unit getVariable ["ACE_isCaptive", false]) then {
_unit setVariable ["ACE_isCaptive", false];
[_unit, true] call ACE_Captives_fnc_setCaptive;
};

View File

@ -0,0 +1,29 @@
/*
* Author: commy2
* TODO
*
* Arguments:
* 0: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* TODO
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_unit);
[_unit, "knockedOut", {
if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut};
}] call ACE_Core_fnc_addCustomEventhandler;
[_unit, "wokeUp", {
if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp};
}] call ACE_Core_fnc_addCustomEventhandler;
// prevent players from throwing grenades
[_unit, "Throw", {(_this select 1) getVariable ["ACE_isCaptive", false]}, {}] call ACE_Core_fnc_addActionEventhandler;

View File

@ -1,26 +1,27 @@
/*
* Author: commy2
*
* Unit loads 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)
* Arguments:
* 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:
* Return Value:
* Nothing
*
* Example:
* TODO
*
* Public: No
*/
#include "script_component.hpp"
private ["_unit", "_target", "_vehicle", "_objects"];
_unit = _this select 0;
_target = _this select 1;
_vehicle = _this select 2;
PARAMS_1(_unit,_target,_vehicle);
if (isNull _target) then {
_objects = attachedObjects _unit;
_objects = [_objects, {_this getVariable ["AGM_isCaptive", false]}] call AGM_Core_fnc_filter;
_objects = [_objects, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter);
_target = _objects select 0;
};
@ -30,6 +31,6 @@ if (isNull _vehicle) then {
};
if (!isNil "_target" && {!isNil "_vehicle"}) then {
_unit setVariable ["AGM_isEscorting", false];
[[_target, _vehicle], "{(_this select 0) moveInCargo (_this select 1); (_this select 0) assignAsCargo (_this select 1); (_this select 0) setVariable ['AGM_Captives_CargoIndex', (_this select 1) getCargoIndex (_this select 0), true];}", _target] call AGM_Core_fnc_execRemoteFnc;
_unit setVariable ["ACE_isEscorting", false];
[[_target, _vehicle], "{(_this select 0) moveInCargo (_this select 1); (_this select 0) assignAsCargo (_this select 1); (_this select 0) setVariable ['ACE_Captives_CargoIndex', (_this select 1) getCargoIndex (_this select 0), true];}", _target] call ACE_Core_fnc_execRemoteFnc;
};

View File

@ -1,33 +1,33 @@
/*
Name: AGM_Captives_fnc_openFriskMenu
Author: bux578
Description:
Open the select menu with the "personal" items of a frisked unit
It only shows "handgunWeapon", "uniformItems", "vestItems", "backpackItems" and "assignedItems" because every other item is visible on the character
Parameters:
0: Object - player unit
1: Object - unit
Returns:
Nothing
* Author: bux578
* Open the select menu with the "personal" items of a frisked unit. It only shows "handgunWeapon", "uniformItems", "vestItems", "backpackItems" and "assignedItems" because every other item is visible on the character
*
* Arguments:
* 0: player unit <OBJECT>
* 1: unit <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* TODO
*
* Public: No
*/
#include "script_component.hpp"
private ["_player", "_unit", "_weapon", "_listedItemClasses", "_actions", "_allGear"];
private ["_weapon", "_listedItemClasses", "_actions", "_allGear"];
_player = _this select 0;
_unit = _this select 1;
PARAMS_2(_player,_unit);
_weapon = currentWeapon _player;
if (_weapon == primaryWeapon _player && {_weapon != ""}) then {
[_player, "AmovPercMstpSlowWrflDnon", 0] call AGM_Core_fnc_doAnimation;
[_player, "AmovPercMstpSlowWrflDnon", 0] call EFUNC(common,doAnimation);
};
_listedItemClasses = [];
_actions = [localize "STR_AGM_Captives_FriskMenuHeader", localize "STR_AGM_Captives_CancelSelection"] call AGM_Interaction_fnc_prepareSelectMenu;
_actions = [localize "STR_ACE_Captives_FriskMenuHeader", localize "STR_ACE_Captives_CancelSelection"] call ACE_Interaction_fnc_prepareSelectMenu;
_allGear = [];
@ -59,12 +59,12 @@ if (count (assignedItems _unit) > 0) then {
if (isNil "_item" || str _item == "") then { //str _item ?
_item = configFile >> "CfgWeapons" >> _x;
};
_actions = [_actions, getText(_item >> "displayName"), getText(_item >> "picture"), _x] call AGM_Interaction_fnc_addSelectableItem;
_actions = [_actions, getText(_item >> "displayName"), getText(_item >> "picture"), _x] call ACE_Interaction_fnc_addSelectableItem;
_listedItemClasses pushBack _x;
};
} forEach (_allGear);
[_actions, {call AGM_Interaction_fnc_hideMenu;}, {call AGM_Interaction_fnc_hideMenu;}] call AGM_Interaction_fnc_openSelectMenu;
[_actions, {call ACE_Interaction_fnc_hideMenu;}, {call ACE_Interaction_fnc_hideMenu;}] call ACE_Interaction_fnc_openSelectMenu;
// don't need an "Ok" Button
ctrlShow [8860, false];

View File

@ -0,0 +1,59 @@
/*
* Author: Nic547, commy2
* Makes a civilian unable to move.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: True to take captive, false to release captive <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* TODO
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_state);
if (!local _unit) exitWith {[[_unit, _state, true], _fnc_scriptName, _unit] call ACE_Core_fnc_execRemoteFnc};
if (_state) then {
if (_unit getVariable ["ACE_isCaptive", false]) exitWith {};
_unit setVariable ["ACE_isCaptive", true, true];
// fix anim on mission start (should work on dedicated servers)
_unit spawn {
[_this, "ACE_Handcuffed", true] call ACE_Core_fnc_setCaptivityStatus;
if (_this getVariable ["ACE_isCaptive", false] && {vehicle _this == _this}) then {
[_this] call EFUNC(common,fixLoweredRifleAnimation);
[_this, "ACE_AmovPercMstpScapWnonDnon", 0] spawn EFUNC(common,doAnimation);
};
};
_unit setVariable ["ACE_Captives_CargoIndex", vehicle _unit getCargoIndex _unit, true];
if (_unit == ACE_player) then {
showHUD false;
};
} else {
if !(_unit getVariable ["ACE_isCaptive", false]) exitWith {};
_unit setVariable ["ACE_isCaptive", false, true];
[_unit, "ACE_Handcuffed", false] call ACE_Core_fnc_setCaptivityStatus;
if (vehicle _unit == _unit) then {
[_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
};
if (_unit getVariable ["ACE_Captives_CargoIndex", -1] != -1) then {
_unit setVariable ["ACE_Captives_CargoIndex", -1, true];
};
if (_unit == ACE_player) then {
showHUD true;
};
};

View File

@ -1,17 +1,30 @@
// by commy2
/*
* Author: commy2
* TODO
*
* Arguments:
* 0: Unit <OBJECT>
* 1: State <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* TODO
*
* Public: No
*/
#include "script_component.hpp"
private ["_unit", "_state"];
PARAMS_2(_unit,_state);
_unit = _this select 0;
_state = _this select 1;
if (!local _unit) exitWith {[_this, _fnc_scriptName, _unit] call AGM_Core_fnc_execRemoteFnc};
if (!local _unit) exitWith {[_this, _fnc_scriptName, _unit] call ACE_Core_fnc_execRemoteFnc};
if (_state) then {
if (_unit getVariable ["AGM_isSurrender", false]) exitWith {};
if (_unit getVariable ["ACE_isSurrender", false]) exitWith {};
_unit setVariable ["AGM_isSurrender", true, true];
[_unit, "AGM_Surrendered", true] call AGM_Core_fnc_setCaptivityStatus;
_unit setVariable ["ACE_isSurrender", true, true];
[_unit, "ACE_Surrendered", true] call ACE_Core_fnc_setCaptivityStatus;
_unit spawn {
// fix for lowered rifle animation glitch
@ -19,29 +32,29 @@ if (_state) then {
_this playMove "amovpercmstpsraswrfldnon";
};
while {_this getVariable ["AGM_isSurrender", false]} do {
while {_this getVariable ["ACE_isSurrender", false]} do {
sleep 0.001; //sleep in UI
if (isPlayer _this) then {showHUD false};
if (!alive _this || {_this getVariable ["AGM_isUnconscious", false]}) then {
_this setVariable ["AGM_isSurrender", false, true];
if (!alive _this || {_this getVariable ["ACE_isUnconscious", false]}) then {
_this setVariable ["ACE_isSurrender", false, true];
} else {
_this playMove "amovpercmstpsnonwnondnon_amovpercmstpssurwnondnon";
};
};
if !(_this getVariable ["AGM_isUnconscious", false]) then {
if !(_this getVariable ["ACE_isUnconscious", false]) then {
_this playMoveNow "AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon";
} else {
_this playMoveNow "unconscious";
};
[_this, "AGM_Surrendered", false] call AGM_Core_fnc_setCaptivityStatus;
[_this, "ACE_Surrendered", false] call ACE_Core_fnc_setCaptivityStatus;
if (isPlayer _this) then {showHUD true};
};
} else {
_unit setVariable ["AGM_isSurrender", false, true];
_unit setVariable ["ACE_isSurrender", false, true];
};
/*

View File

@ -0,0 +1,35 @@
/*
* Author: commy2
* Unit unloads a captive from a vehicle.
*
* Arguments:
* 0: Unit that wants to unload a captive <OBJECT>
* 1: Vehicle to unload a captive from. <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* TODO
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_vehicle);
private ["_cargo", "_target"];
_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway.
_cargo = [_cargo, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter);
if (count _cargo > 0) then {
_target = _cargo select 0;
_target setVariable ["ACE_Captives_CargoIndex", -1, true];
moveOut _target;
[_target, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
[_target, "{unassignVehicle _this}", _target] call ACE_Core_fnc_execRemoteFnc;
};

View File

@ -0,0 +1 @@
#include "\z\ace\addons\blank\script_component.hpp"

Binary file not shown.

View File

@ -0,0 +1,79 @@
ambient[]={1,1,1,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.01,0.01,0.01,1}; //amount of glossiness - the higher the number, the higher the glossiness
specularPower=500; //area of glossiness - the higher the number, the smaller the area
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1 {
texture="#(rgb,1,1,1)color(0.5,0.5,1,1)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage2 {
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage3 {
texture="#(argb,8,8,3)color(0,0,0,0,mc)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage4 {
texture="#(argb,8,8,3)color(1,1,1,1,as)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,1};
};
};
class Stage5 {
texture="#(rgb,1,1,1)color(0.2,0.2,1,1)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage6 {
texture="#(ai,64,64,1)fresnel(4.7,1.2)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,0};
};
};
class Stage7 {
texture="a3\data_f\env_land_ca.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,0};
};
};

View File

@ -0,0 +1,12 @@
#define COMPONENT captives
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_CAPTIVES
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_CAPTIVES
#define DEBUG_SETTINGS DEBUG_SETTINGS_CAPTIVES
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-16 -->
<Project name="AGM">
<Project name="ACE">
<Package name="Captives">
<Key ID="STR_AGM_Captives_SetCaptive">
<Key ID="STR_ACE_Captives_SetCaptive">
<English>Take Prisoner</English>
<German>Gefangen nehmen</German>
<Spanish>Tomar prisionero</Spanish>
@ -14,7 +14,7 @@
<Hungarian>Foglyul ejtés</Hungarian>
<Russian>Взять в плен</Russian>
</Key>
<Key ID="STR_AGM_Captives_ReleaseCaptive">
<Key ID="STR_ACE_Captives_ReleaseCaptive">
<English>Free Prisoner</English>
<German>Gefangenen freilassen</German>
<Spanish>Liberar prisionero</Spanish>
@ -26,7 +26,7 @@
<Hungarian>Fogoly szabadon elengedése</Hungarian>
<Russian>Освободить пленника</Russian>
</Key>
<Key ID="STR_AGM_Captives_EscortCaptive">
<Key ID="STR_ACE_Captives_EscortCaptive">
<English>Escort Prisoner</English>
<German>Gefangenen eskortieren</German>
<Spanish>Escoltar prisionero</Spanish>
@ -38,7 +38,7 @@
<Hungarian>Fogoly kísérése</Hungarian>
<Russian>Конвоировать пленника</Russian>
</Key>
<Key ID="STR_AGM_Captives_StopEscorting">
<Key ID="STR_ACE_Captives_StopEscorting">
<English>Release Prisoner</English>
<German>Gefangenen loslassen</German>
<Spanish>Soltar prisionero</Spanish>
@ -50,7 +50,7 @@
<Hungarian>Fogoly elengedése</Hungarian>
<Russian>Прекратить конвоирование</Russian>
</Key>
<Key ID="STR_AGM_Captives_NoCaptive">
<Key ID="STR_ACE_Captives_NoCaptive">
<English>You need to take him as prisoner first!</English>
<German>Du must ihn zuerst gefangen nehmen.</German>
<Spanish>Necesitas hacerle prisionero primero!</Spanish>
@ -62,7 +62,7 @@
<Hungarian>Először foglyul kell ejtened!</Hungarian>
<Russian>Вы должны сначала взять его в плен!</Russian>
</Key>
<Key ID="STR_AGM_Captives_LoadCaptive">
<Key ID="STR_ACE_Captives_LoadCaptive">
<English>Load Captive</English>
<German>Gefangenen einladen</German>
<Spanish>Cargar prisionero</Spanish>
@ -72,7 +72,7 @@
<Hungarian>Fogoly berakása</Hungarian>
<Russian>Загрузить пленного</Russian>
</Key>
<Key ID="STR_AGM_Captives_UnloadCaptive">
<Key ID="STR_ACE_Captives_UnloadCaptive">
<English>Unload Captive</English>
<German>Gefangenen ausladen</German>
<Spanish>Descargar prisionero</Spanish>
@ -82,7 +82,7 @@
<Hungarian>Fogoly kivevése</Hungarian>
<Russian>Выгрузить пленного</Russian>
</Key>
<Key ID="STR_AGM_Captives_CableTie">
<Key ID="STR_ACE_Captives_CableTie">
<English>Cable Tie</English>
<German>Kabelbinder</German>
<Polish>Opaska zaciskowa</Polish>
@ -94,7 +94,7 @@
<Hungarian>Gyorskötöző</Hungarian>
<Russian>Кабельная стяжка</Russian>
</Key>
<Key ID="STR_AGM_Captives_CableTieDescription">
<Key ID="STR_ACE_Captives_CableTieDescription">
<English>Cable ties that allow you to restrain prisoners.</English>
<German>Kabelbinder ermöglichen es, Gefangene zu fesseln.</German>
<Polish>Opaska zaciskowa pozwala na skrępowanie dłoni u więźnia.</Polish>
@ -106,7 +106,7 @@
<Hungarian>Gyorskötöző emberek fogjulejtéséhez.</Hungarian>
<Russian>Кабельные стяжки позволяют связывать пленников.</Russian>
</Key>
<Key ID="STR_AGM_Captives_FriskMenuHeader">
<Key ID="STR_ACE_Captives_FriskMenuHeader">
<English>Inventory of frisked person</English>
<German>Inventar der durchsuchten Person</German>
<French>Inventaire de la fouille</French>
@ -116,7 +116,7 @@
<Polish>Ekwipunek rewidowanej osoby</Polish>
<Russian>Инвентарь обысканных лиц</Russian>
</Key>
<Key ID="STR_AGM_Captives_FriskPerson">
<Key ID="STR_ACE_Captives_FriskPerson">
<English>Frisk person</English>
<German>Person durchsuchen</German>
<French>Fouiller</French>