mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Captive FFV Lock Animation
This commit is contained in:
parent
c35fc35eb3
commit
645e8a63ef
@ -18,6 +18,11 @@ class CfgMovesBasic {
|
||||
default = "ACE_AmovPercMstpSsurWnonDnon";
|
||||
PutDown = "";
|
||||
};
|
||||
class ACE_CivilHandCuffedFFVActions: ACE_CivilStandHandcuffedActions {
|
||||
stop = "ACE_HandcuffedFFV";
|
||||
StopRelaxed = "ACE_HandcuffedFFV";
|
||||
default = "ACE_HandcuffedFFV";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -55,6 +60,14 @@ class CfgMovesMaleSdr: CfgMovesBasic {
|
||||
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1};
|
||||
};
|
||||
|
||||
//Handcuffed-FFV:
|
||||
class ACE_HandcuffedFFV: ACE_AmovPercMstpScapWnonDnon {
|
||||
file = "\A3\cargoposes_F_heli\anim\passenger_flatground_3idleunarmed.rtm";
|
||||
actions = "ACE_CivilHandCuffedFFVActions";
|
||||
ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1};
|
||||
};
|
||||
|
||||
|
||||
//Surrender Anims:
|
||||
class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon: CutSceneAnimationBase {
|
||||
actions = "ACE_CivilStandSurrenderActions";
|
||||
|
@ -17,22 +17,31 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_objects"];
|
||||
params ["_unit", "_target","_vehicle"];
|
||||
|
||||
if (isNull _target) then {
|
||||
_objects = attachedObjects _unit;
|
||||
_objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter);
|
||||
if ((count _objects) > 0) then {_target = _objects select 0;};
|
||||
if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then {
|
||||
//Looking at a vehicle while escorting, get target from attached objects:
|
||||
{
|
||||
if (_x getVariable [QGVAR(isHandcuffed), false]) exitWith {
|
||||
_target = _x;
|
||||
};
|
||||
} forEach (attachedObjects _unit);
|
||||
};
|
||||
if ((isNull _target) || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {false};
|
||||
|
||||
if (isNull _vehicle) then {
|
||||
_objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10];
|
||||
if ((count _objects) > 0) then {_vehicle = _objects select 0;};
|
||||
//Looking at a captive unit, search for nearby vehicles with valid seats:
|
||||
{
|
||||
// if (([_x] call FUNC(findEmptyNonFFVCargoSeat)) != -1) exitWith {
|
||||
if ((_x emptyPositions "cargo") > 0) exitWith {
|
||||
_vehicle = _x;
|
||||
};
|
||||
} forEach (nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]);
|
||||
} else {
|
||||
// if (([_vehicle] call FUNC(findEmptyNonFFVCargoSeat)) == -1) then {
|
||||
if ((_vehicle emptyPositions "cargo") == 0) then {
|
||||
_vehicle = objNull;
|
||||
};
|
||||
};
|
||||
|
||||
(!isNull _target)
|
||||
&& {!isNull _vehicle}
|
||||
&& {_unit getVariable [QGVAR(isEscorting), false]}
|
||||
&& {_target getVariable [QGVAR(isHandcuffed), false]}
|
||||
&& {([_vehicle] call FUNC(findEmptyNonFFVCargoSeat)) != -1}
|
||||
(!isNull _vehicle)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Unit loads the target object into a vehicle.
|
||||
* Unit loads the target object into a vehicle. (logic same as canLoadCaptive)
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit that wants to load a captive <OBJECT>
|
||||
@ -17,24 +17,34 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_objects";
|
||||
|
||||
params ["_unit", "_target","_vehicle"];
|
||||
|
||||
if (isNull _target) then {
|
||||
_objects = attachedObjects _unit;
|
||||
_objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter);
|
||||
if ((count _objects) > 0) then {_target = _objects select 0;};
|
||||
if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then {
|
||||
//Looking at a vehicle while escorting, get target from attached objects:
|
||||
{
|
||||
if (_x getVariable [QGVAR(isHandcuffed), false]) exitWith {
|
||||
_target = _x;
|
||||
};
|
||||
} forEach (attachedObjects _unit);
|
||||
};
|
||||
if (isNull _target) exitWith {};
|
||||
if ((isNull _target) || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {ERROR("");};
|
||||
|
||||
if (isNull _vehicle) then {
|
||||
_objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10];
|
||||
if ((count _objects) > 0) then {_vehicle = _objects select 0;};
|
||||
//Looking at a captive unit, search for nearby vehicles with valid seats:
|
||||
{
|
||||
// if (([_x] call FUNC(findEmptyNonFFVCargoSeat)) != -1) exitWith {
|
||||
if ((_x emptyPositions "cargo") > 0) exitWith {
|
||||
_vehicle = _x;
|
||||
};
|
||||
} forEach (nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]);
|
||||
} else {
|
||||
// if (([_vehicle] call FUNC(findEmptyNonFFVCargoSeat)) == -1) then {
|
||||
if ((_vehicle emptyPositions "cargo") == 0) then {
|
||||
_vehicle = objNull;
|
||||
};
|
||||
};
|
||||
if (isNull _vehicle) exitWith {};
|
||||
|
||||
if ((!isNil "_target") && {!isNil "_vehicle"}) then {
|
||||
_unit setVariable [QGVAR(isEscorting), false, true];
|
||||
["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent);
|
||||
};
|
||||
if (isNull _vehicle) exitWith {ERROR("");};
|
||||
|
||||
_unit setVariable [QGVAR(isEscorting), false, true];
|
||||
["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent);
|
||||
|
@ -48,6 +48,9 @@ if (_state) then {
|
||||
if ((vehicle _unit) == _unit) then {
|
||||
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
} else {
|
||||
[_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation);
|
||||
[_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
//Adds an animation changed eh
|
||||
@ -63,10 +66,11 @@ if (_state) then {
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
} else {
|
||||
|
||||
// _turretPath = [];
|
||||
// {
|
||||
// _x params ["_xUnit", "", "", "_xTurretPath"];
|
||||
// if (_unit == _xUnit) exitWith {_turretPath = _xTurretPath};
|
||||
// _x params ["_xUnit", "", "", "_xTurretPath"];
|
||||
// if (_unit == _xUnit) exitWith {_turretPath = _xTurretPath};
|
||||
// } forEach (fullCrew (vehicle _unit));
|
||||
// TRACE_1("turret Path",_turretPath);
|
||||
// if (_turretPath isEqualTo []) exitWith {};
|
||||
@ -75,6 +79,10 @@ if (_state) then {
|
||||
// TRACE_1("reseting to",_gunnerAction);
|
||||
// [_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation);
|
||||
// [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
|
||||
|
||||
[_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation);
|
||||
[_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
}];
|
||||
_unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];
|
||||
|
@ -20,9 +20,16 @@ private ["_cargoIndex"];
|
||||
|
||||
params ["_target","_vehicle"];
|
||||
|
||||
_cargoIndex = [_vehicle] call FUNC(findEmptyNonFFVCargoSeat);
|
||||
if (_cargoIndex < 0) exitWith {ERROR("No Seat Avail");};
|
||||
// _cargoIndex = [_vehicle] call FUNC(findEmptyNonFFVCargoSeat);
|
||||
// if (_cargoIndex < 0) exitWith {ERROR("No Seat Avail");};
|
||||
// _target moveInCargo [_vehicle, _cargoIndex];
|
||||
|
||||
_target moveInCargo _vehicle;
|
||||
|
||||
_target moveInCargo [_vehicle, _cargoIndex];
|
||||
_target assignAsCargo _vehicle;
|
||||
|
||||
_cargoIndex = _vehicle getCargoIndex _target;
|
||||
_target setVariable [QGVAR(CargoIndex), _cargoIndex, true];
|
||||
|
||||
[_target, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation);
|
||||
[_target, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation);
|
||||
|
@ -1,6 +1,8 @@
|
||||
#define COMPONENT captives
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
|
||||
#ifdef DEBUG_ENABLED_CAPTIVES
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user