Captives Progress

This commit is contained in:
PabstMirror 2015-02-03 00:42:34 -06:00
parent 982f3b230a
commit 4156143ecf
8 changed files with 45 additions and 38 deletions

View File

@ -23,7 +23,7 @@ class Extended_GetIn_EventHandlers {
class Extended_GetOut_EventHandlers { class Extended_GetOut_EventHandlers {
class All { class All {
class GVAR(AutoDetachCaptive) { class GVAR(AutoDetachCaptive) {
getOut = "if (local (_this select 2) && {(_this select 2) getVariable ['ACE_isCaptive', false]}) then {_this call ACE_Captives_fnc_handleGetOut}"; getOut = QUOTE(_this call FUNC(handleGetOut));
}; };
}; };
}; };

View File

@ -5,62 +5,62 @@ class CfgVehicles {
class ACE_SetCaptive { class ACE_SetCaptive {
displayName = "$STR_ACE_Captives_SetCaptive"; displayName = "$STR_ACE_Captives_SetCaptive";
distance = 4; distance = 4;
condition = "'ACE_CableTie' in items _player && {alive _target} && {!(_target getVariable ['ACE_isCaptive', false])}"; condition = QUOTE(('ACE_CableTie' in (items _player)) && {alive _target} && {!(_target getVariable ['ACE_isCaptive', false])});
statement = "player removeItem 'ACE_CableTie'; [_target, true] call ACE_Captives_fnc_setCaptive"; statement = QUOTE(_player removeItem 'ACE_CableTie'; [ARR_2(_target, true)] call FUNC(setCaptive););
showDisabled = 0; showDisabled = 0;
priority = 2.4; priority = 2.4;
icon = "\ACE_Captives\UI\handcuff_ca.paa"; icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
hotkey = "C"; hotkey = "C";
}; };
class ACE_ReleaseCaptive { class ACE_ReleaseCaptive {
displayName = "$STR_ACE_Captives_ReleaseCaptive"; displayName = "$STR_ACE_Captives_ReleaseCaptive";
distance = 4; distance = 4;
condition = "_target getVariable ['ACE_isCaptive', false] && {isNull (attachedTo _target)}"; condition = QUOTE(_target getVariable ['ACE_isCaptive', false] && {isNull (attachedTo _target)});
statement = "[_target, false] call ACE_Captives_fnc_setCaptive"; statement = QUOTE([ARR_2(_target, false)] call FUNC(setCaptive));
exceptions[] = {"ACE_Interaction_isNotEscorting"}; exceptions[] = {"ACE_Interaction_isNotEscorting"};
showDisabled = 0; showDisabled = 0;
priority = 2.4; priority = 2.4;
icon = "\ACE_Captives\UI\handcuff_ca.paa"; icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
hotkey = "R"; hotkey = "R";
}; };
class ACE_EscortCaptive { class ACE_EscortCaptive {
displayName = "$STR_ACE_Captives_EscortCaptive"; displayName = "$STR_ACE_Captives_EscortCaptive";
distance = 4; distance = 4;
condition = "_target getVariable ['ACE_isCaptive', false] && {isNull (attachedTo _target)} && {alive _target} && {!(_target getVariable ['ACE_isUnconscious', false])}"; condition = QUOTE((_target getVariable ['ACE_isCaptive', false]) && {isNull (attachedTo _target)} && {alive _target} && {!(_target getVariable ['ACE_isUnconscious', false])});
statement = "[_target, true] call ACE_Captives_fnc_escortCaptive"; statement = QUOTE([ARR_2(_target, true)] call FUNC(escortCaptive));
exceptions[] = {"ACE_Interaction_isNotEscorting"}; exceptions[] = {"ACE_Interaction_isNotEscorting"};
showDisabled = 0; showDisabled = 0;
icon = "\ACE_Captives\UI\captive_ca.paa"; icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.3; priority = 2.3;
hotkey = "E"; hotkey = "E";
}; };
class ACE_StopEscorting { class ACE_StopEscorting {
displayName = "$STR_ACE_Captives_StopEscorting"; displayName = "$STR_ACE_Captives_StopEscorting";
distance = 4; distance = 4;
condition = "_target getVariable ['ACE_isCaptive', false] && {_target in attachedObjects _player}"; condition = QUOTE((_target getVariable ['ACE_isCaptive', false]) && {_target in (attachedObjects _player)});
statement = "[_target, false] call ACE_Captives_fnc_escortCaptive"; statement = QUOTE([ARR_2(_target, false)] call FUNC(escortCaptive));
exceptions[] = {"ACE_Interaction_isNotEscorting"}; exceptions[] = {"ACE_Interaction_isNotEscorting"};
showDisabled = 0; showDisabled = 0;
icon = "\ACE_Captives\UI\captive_ca.paa"; icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.3; priority = 2.3;
hotkey = "E"; hotkey = "E";
}; };
class ACE_LoadCaptive { class ACE_LoadCaptive {
displayName = "$STR_ACE_Captives_LoadCaptive"; displayName = "$STR_ACE_Captives_LoadCaptive";
distance = 4; distance = 4;
condition = "[_player, _target, objNull] call ACE_Captives_fnc_canLoadCaptive"; condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive));
statement = "[_player, _target, objNull] call ACE_Captives_fnc_loadCaptive"; statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(loadCaptive));
exceptions[] = {"ACE_Interaction_isNotEscorting"}; exceptions[] = {"ACE_Interaction_isNotEscorting"};
showDisabled = 0; showDisabled = 0;
icon = "\ACE_Captives\UI\captive_ca.paa"; icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.2; priority = 2.2;
hotkey = "L"; hotkey = "L";
}; };
class ACE_FriskPerson { class ACE_FriskPerson {
displayName = "$STR_ACE_Captives_FriskPerson"; displayName = "$STR_ACE_Captives_FriskPerson";
distance = 2; distance = 2;
condition = "[_player, _target] call ACE_Captives_fnc_canFriskPerson"; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canFriskPerson));
statement = "[_player, _target] call ACE_Captives_fnc_openFriskMenu"; statement = QUOTE([ARR_2(_player, _target)] call FUNC(openFriskMenu));
showDisabled = 0; showDisabled = 0;
//icon = ""; //@todo //icon = ""; //@todo
priority = 3; priority = 3;
@ -71,8 +71,8 @@ class CfgVehicles {
class ACE_SelfActions { class ACE_SelfActions {
class ACE_StopEscortingSelf { class ACE_StopEscortingSelf {
displayName = "$STR_ACE_Captives_StopEscorting"; displayName = "$STR_ACE_Captives_StopEscorting";
condition = "(_player getVariable ['ACE_escortedUnit', objNull]) getVariable ['ACE_isCaptive', false] && {(_player getVariable ['ACE_escortedUnit', objNull]) in attachedObjects _player}"; condition = QUOTE(((_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;"; statement = QUOTE([ARR_2((_player getVariable ['ACE_escortedUnit', objNull]), false)] call FUNC(_escortCaptive););
exceptions[] = {"ACE_Interaction_isNotEscorting"}; exceptions[] = {"ACE_Interaction_isNotEscorting"};
showDisabled = 0; showDisabled = 0;
priority = 2.3; priority = 2.3;
@ -95,8 +95,8 @@ class CfgVehicles {
class ACE_LoadCaptive { \ class ACE_LoadCaptive { \
displayName = "$STR_ACE_Captives_LoadCaptive"; \ displayName = "$STR_ACE_Captives_LoadCaptive"; \
distance = 4; \ distance = 4; \
condition = "[_player, objNull, _target] call ACE_Captives_fnc_canLoadCaptive"; \ condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \
statement = "[_player, objNull, _target] call ACE_Captives_fnc_loadCaptive"; \ statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(loadCaptive)); \
exceptions[] = {"ACE_Interaction_isNotEscorting"}; \ exceptions[] = {"ACE_Interaction_isNotEscorting"}; \
showDisabled = 0; \ showDisabled = 0; \
priority = 1.2; \ priority = 1.2; \
@ -105,8 +105,8 @@ class CfgVehicles {
class ACE_UnloadCaptive { \ class ACE_UnloadCaptive { \
displayName = "$STR_ACE_Captives_UnloadCaptive"; \ displayName = "$STR_ACE_Captives_UnloadCaptive"; \
distance = 4; \ distance = 4; \
condition = "[_player, _target] call ACE_Captives_fnc_canUnloadCaptive"; \ condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \
statement = "[_player, _target] call ACE_Captives_fnc_unloadCaptive"; \ statement = QUOTE([ARR_2(_player, _target)] call FUNC(unloadCaptive)); \
showDisabled = 0; \ showDisabled = 0; \
priority = 1.2; \ priority = 1.2; \
hotkey = "C"; \ hotkey = "C"; \

View File

@ -1,8 +1,7 @@
#include "script_component.hpp" #include "script_component.hpp"
ADDON = false; ADDON = false;
PREP(empty);
PREP(canFriskPerson); PREP(canFriskPerson);
PREP(canLoadCaptive); PREP(canLoadCaptive);
PREP(canUnloadCaptive); PREP(canUnloadCaptive);

View File

@ -13,6 +13,9 @@ class CfgPatches {
}; };
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
#include "CfgMoves.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
class ACE_Core_canInteractConditions { class ACE_Core_canInteractConditions {

View File

@ -1,9 +1,10 @@
/* /*
* Author: commy2 * Author: commy2
* X * Handles when a captive unit gets out of a vehicle.
* *
* Arguments: * Arguments:
* 0: _vehicle <OBJECT> * 0: _vehicle <OBJECT>
* 2: dunno <OBJECT>
* 1: _unit <OBJECT> * 1: _unit <OBJECT>
* *
* Return Value: * Return Value:
@ -16,14 +17,18 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_vehicle,_unit); PARAMS_3(_vehicle,_dontcare,_unit);
if (!local _unit) exitWith {};
if (!(_unit getVariable ["ACE_isCaptive", false])) exitWith {};
private ["_cargoIndex"]; private ["_cargoIndex"];
_cargoIndex = _unit getVariable ["ACE_Captives_CargoIndex", -1]; _cargoIndex = _unit getVariable ["ACE_Captives_CargoIndex", -1];
//If captive was not "unloaded", then move them back into the vehicle.
if (_cargoIndex != -1) exitWith { if (_cargoIndex != -1) exitWith {
_unit moveInCargo [_vehicle, _cargoIndex]; _unit moveInCargo [_vehicle, _cargoIndex];
}; };
[_unit, 'ACE_AmovPercMstpScapWnonDnon', 2] call EFUNC(common,doAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);

View File

@ -20,9 +20,9 @@
PARAMS_1(_unit,_target,_vehicle); PARAMS_1(_unit,_target,_vehicle);
if (isNull _target) then { if (isNull _target) then {
_objects = attachedObjects _unit; // _objects = attachedObjects _unit;
_objects = [_objects, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter); // _objects = [_objects, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter);
_target = _objects select 0; // _target = _objects select 0;
}; };
if (isNull _vehicle) then { if (isNull _vehicle) then {

View File

@ -25,11 +25,11 @@ _cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turr
_cargo = [_cargo, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter); _cargo = [_cargo, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter);
if (count _cargo > 0) then { if (count _cargo > 0) then {
_target = _cargo select 0; _target = _cargo select 0;
_target setVariable ["ACE_Captives_CargoIndex", -1, true]; _target setVariable ["ACE_Captives_CargoIndex", -1, true];
moveOut _target; moveOut _target;
[_target, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation); [_target, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
[_target, "{unassignVehicle _this}", _target] call ACE_Core_fnc_execRemoteFnc; [_target, "{unassignVehicle _this}", _target] call ACE_Core_fnc_execRemoteFnc;
}; };

View File

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