CH53 Fastroping and other fixes (#4713)

* CH53 Fastroping and Fixes

Added fastrope points for CH53.

The getOut EH is required to keep the doors open when a unit exits the
vehicle and it uses the vehicle animation "doorHandler_R" or
"doorHandler_L" as a placeholder to determine if the doors are
open(1)/close(0).
eg. In UH1Y (Unarmed), when the right door is opened using the
useraction, "doorRB" and "doorHandler_R" will be set to 1.

* Changed TAB to 4 spaces

* Moved bracket to follow guidelines
This commit is contained in:
magicsh0tz 2017-05-30 01:55:53 +08:00 committed by PabstMirror
parent ff212d5b3d
commit cd852477c8
4 changed files with 36 additions and 23 deletions

View File

@ -184,12 +184,6 @@ class CfgVehicles {
condition = QUOTE([ARR_2(this,'doorLB')] call FUNC(canCloseDoor)); condition = QUOTE([ARR_2(this,'doorLB')] call FUNC(canCloseDoor));
}; };
}; };
class EventHandlers: EventHandlers {
class RHSUSF_EventHandlers: RHSUSF_EventHandlers {
getOut = QUOTE(if !((_this select 0) getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)]) then {_this call rhs_fnc_uh60_doors});
};
};
}; };
class Helicopter_Base_H: Helicopter_Base_F { class Helicopter_Base_H: Helicopter_Base_F {
@ -226,11 +220,6 @@ class CfgVehicles {
condition = QUOTE([ARR_2(this,'doorLB')] call FUNC(canCloseDoor)); condition = QUOTE([ARR_2(this,'doorLB')] call FUNC(canCloseDoor));
}; };
}; };
class EventHandlers: EventHandlers {
class RHSUSF_EventHandlers {
getOut = QUOTE(if !((_this select 0) getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)]) then {_this call rhs_fnc_uh60_doors});
};
};
EQUIP_FRIES_ATTRIBUTE; EQUIP_FRIES_ATTRIBUTE;
}; };
@ -266,6 +255,20 @@ class CfgVehicles {
}; };
}; };
class rhsusf_CH53E_USMC: Helicopter_Base_H {
EGVAR(fastroping,enabled) = 1;
EGVAR(fastroping,ropeOrigins)[] = {{0,-9.5,2.6}};
EGVAR(fastroping,onCut) = QFUNC(onCut);
EGVAR(fastroping,onPrepare) = QFUNC(onPrepare);
class UserActions {
class RampOpen;
class RampClose: RampOpen {
condition = QUOTE([ARR_2(this,'ramp_bottom')] call FUNC(canCloseDoor));
};
};
};
class Heli_Attack_01_base_F: Helicopter_Base_F {}; class Heli_Attack_01_base_F: Helicopter_Base_F {};
class RHS_AH1Z_base: Heli_Attack_01_base_F { class RHS_AH1Z_base: Heli_Attack_01_base_F {

View File

@ -18,19 +18,21 @@
#include "script_component.hpp" #include "script_component.hpp"
params ["_vehicle", "_door"]; params ["_vehicle", "_door"];
( (alive _vehicle) &&
if (_vehicle isKindOf "RHS_CH_47F") then {
(_vehicle animationSourcePhase _door) > 0
} else {
(_vehicle doorPhase _door) > 0
}
) &&
{alive _vehicle} &&
{!(_vehicle getVariable [QEGVAR(fastroping,doorsLocked),false])} && {!(_vehicle getVariable [QEGVAR(fastroping,doorsLocked),false])} &&
{ {
if (_vehicle isKindOf "RHS_CH_47F") then { switch (true) do {
ACE_player in [driver _vehicle, _vehicle turretUnit [3], _vehicle turretUnit [4]] case (_vehicle isKindOf "rhsusf_CH53E_USMC"): {
} else { ((_vehicle animationPhase _door) > 0) &&
ACE_player in _vehicle {ACE_player == (driver _vehicle)}
};
case (_vehicle isKindOf "RHS_CH_47F"): {
((_vehicle animationSourcePhase _door) > 0) &&
{ACE_player in [driver _vehicle, _vehicle turretUnit [3], _vehicle turretUnit [4]]}
};
default {
((_vehicle doorPhase _door) > 0) &&
{ACE_player in _vehicle}
};
} }
} }

View File

@ -26,11 +26,15 @@ if !(isNull _fries) then {
[{ [{
_this animateDoor ["doorRB", 0]; _this animateDoor ["doorRB", 0];
_this animateDoor ["doorLB", 0]; _this animateDoor ["doorLB", 0];
_this animate ["doorHandler_R",0];
_this animate ["doorHandler_L",0];
}, _vehicle, 2] call CBA_fnc_waitAndExecute; }, _vehicle, 2] call CBA_fnc_waitAndExecute;
4 4
} else { } else {
_vehicle animateDoor ["ramp_anim", 0]; _vehicle animateDoor ["ramp_anim", 0];
_vehicle animate ["ramp_bottom",0];
_vehicle animate ["ramp_top",0];
2 2
}; };

View File

@ -23,7 +23,11 @@ private _waitTime = 2;
_vehicle animateDoor ["doorRB", 1]; _vehicle animateDoor ["doorRB", 1];
_vehicle animateDoor ["doorLB", 1]; _vehicle animateDoor ["doorLB", 1];
_vehicle animate ["doorHandler_R",1];
_vehicle animate ["doorHandler_L",1];
_vehicle animateDoor ["ramp_anim", 1]; _vehicle animateDoor ["ramp_anim", 1];
_vehicle animate ["ramp_bottom",0.56];
_vehicle animate ["ramp_top",1];
private _fries = _vehicle getVariable [QEGVAR(fastroping,FRIES), objNull]; private _fries = _vehicle getVariable [QEGVAR(fastroping,FRIES), objNull];
if !(isNull _fries) then { if !(isNull _fries) then {