Merge branch 'BaerMitUmlaut-fr-fixes'

This commit is contained in:
esteldunedain 2016-03-08 15:08:15 -03:00
commit 035f411f43
16 changed files with 149 additions and 40 deletions

View File

@ -1,3 +1,9 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart));
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));

View File

@ -35,11 +35,8 @@ class CfgVehicles {
};
};
class Helicopter_Base_F;
class ACE_friesBase: Helicopter_Base_F {
destrType = "";
class Turrets {};
class Helicopter;
class Helicopter_Base_F: Helicopter {
class ACE_SelfActions {
class ACE_prepareFRIES {
displayName = CSTRING(Interaction_prepareFRIES);
@ -71,6 +68,10 @@ class CfgVehicles {
};
};
};
class ACE_friesBase: Helicopter_Base_F {
destrType = "";
class Turrets {};
};
class ACE_friesAnchorBar: ACE_friesBase {
author = "jokoho48";
scope = 1;
@ -110,10 +111,20 @@ class CfgVehicles {
initPhase = 0;
animPeriod = 0;
};
class hideGantryLeft {
source = "user";
initPhase = 0;
animPeriod = 0;
};
class hideGantryRight {
source = "user";
initPhase = 0;
animPeriod = 0;
};
};
};
class ACE_friesGantryReverse: ACE_friesGantry {
class AnimationSources {
class AnimationSources: AnimationSources {
class adjustWidth {
source = "user";
initPhase = 0.213;
@ -165,10 +176,28 @@ class CfgVehicles {
class Heli_Transport_02_base_F: Helicopter_Base_H {
GVAR(enabled) = 1;
GVAR(ropeOrigins)[] = {{0.94, -4.82, -1.16}, {-0.94, -4.82, -1.16}};
GVAR(onPrepare) = QFUNC(onPrepareCommon);
GVAR(onCut) = QFUNC(onCutCommon);
class UserActions {
class Ramp_Open;
class Ramp_Close: Ramp_Open {
condition = QUOTE([ARR_5(this,'CargoRamp_Open',[[0],[1],[2]])] call FUNC(canCloseRamp));
};
};
};
class Heli_Transport_03_base_F: Helicopter_Base_H {
GVAR(enabled) = 1;
GVAR(ropeOrigins)[] = {{0.75, -5.29, -0.11}, {-0.87, -5.29, -0.11}};
GVAR(onPrepare) = QFUNC(onPrepareCommon);
GVAR(onCut) = QFUNC(onCutCommon);
class UserActions {
class Ramp_Open;
class Ramp_Close: Ramp_Open {
condition = QUOTE([ARR_5(this,'Door_rear_source',[[0],[3],[4]])] call FUNC(canCloseRamp));
};
};
};
class Heli_light_03_base_F: Helicopter_Base_F {
GVAR(enabled) = 2;
@ -184,7 +213,9 @@ class CfgVehicles {
GVAR(friesAttachmentPoint)[] = {-1.07, 3.26, -0.5};
EQUIP_FRIES_ATTRIBUTE;
};
class Heli_Transport_04_base_F;
class Heli_Transport_04_base_F: Helicopter_Base_H {
class UserActions;
};
class O_Heli_Transport_04_bench_F: Heli_Transport_04_base_F {
GVAR(enabled) = 1;
GVAR(ropeOrigins)[] = {{1.03, 1.6, -0.23}, {1.03, -1.36, -0.23}, {-1.23, 1.6, -0.23}, {-1.23, -1.36, -0.23}};
@ -192,5 +223,14 @@ class CfgVehicles {
class O_Heli_Transport_04_covered_F: Heli_Transport_04_base_F {
GVAR(enabled) = 1;
GVAR(ropeOrigins)[] = {{0.83, -4.7, -0.03}, {-1.02, -4.7, -0.03}};
GVAR(onPrepare) = QFUNC(onPrepareCommon);
GVAR(onCut) = QFUNC(onCutCommon);
class UserActions: UserActions {
class CloseDoor_6;
class Ramp_Close: CloseDoor_6 {
condition = QUOTE([ARR_6(this,'Door_6_source',[[0],[1],[2],[3]])] call FUNC(canCloseRamp));
};
};
};
};

View File

@ -0,0 +1,17 @@
PREP(canCloseRamp);
PREP(canCutRopes);
PREP(canDeployRopes);
PREP(canFastRope);
PREP(canPrepareFRIES);
PREP(checkVehicleThread);
PREP(cutRopes);
PREP(deployRopes);
PREP(equipFRIES);
PREP(fastRope);
PREP(fastRopeLocalPFH);
PREP(fastRopeServerPFH);
PREP(moduleEquipFRIES);
PREP(onCutCommon);
PREP(onPrepareCommon);
PREP(onRopeBreak);
PREP(prepareFRIES);

View File

@ -7,8 +7,3 @@
[QGVAR(startFastRope), {
[FUNC(fastRopeServerPFH), 0, _this] call CBA_fnc_addPerFrameHandler;
}] call EFUNC(common,addEventHandler);
[QGVAR(ropeDetach), {
params ["_object", "_rope"];
_object ropeDetach _rope;
}] call EFUNC(common,addEventHandler);

View File

@ -2,21 +2,6 @@
ADDON = false;
PREP(canCutRopes);
PREP(canDeployRopes);
PREP(canFastRope);
PREP(canPrepareFRIES);
PREP(checkVehicleThread);
PREP(cutRopes);
PREP(deployRopes);
PREP(equipFRIES);
PREP(fastRope);
PREP(fastRopeLocalPFH);
PREP(fastRopeServerPFH);
PREP(moduleEquipFRIES);
PREP(onCutCommon);
PREP(onPrepareCommon);
PREP(onRopeBreak);
PREP(prepareFRIES);
#include "XEH_PREP.hpp"
ADDON = true;

View File

@ -0,0 +1,3 @@
#include "script_component.hpp"
#include "XEH_PREP.hpp"

View File

@ -90,6 +90,24 @@ class CfgModels {
angle0 = "rad 0";
angle1 = "rad 360";
};
class hideGantryLeft {
type = "hide";
source = "";
selection = "gantryLeft";
animPeriod = 0;
minValue = 0;
maxValue = 1;
hideValue = 0.99999;
};
class hideGantryRight {
type = "hide";
source = "";
selection = "gantryRight";
animPeriod = 0;
minValue = 0;
maxValue = 1;
hideValue = 0.99999;
};
};
};
};

View File

@ -0,0 +1,29 @@
/*
* Author: BaerMitUmlaut
* Checks if the player can close the ramp of the given helo.
*
* Arguments:
* 0: The helicopter <OBJECT>
* 1: The ramp animation name <STRING>
* 2: Turret paths that can close the ramp <ARRAY>
*
* Return Value:
* Able to close ramp <BOOL>
*
* Example:
* [_player, _vehicle] call ace_fastroping_fnc_canCloseRamp
*
* Public: No
*/
#include "script_component.hpp"
params ["_vehicle", "_door", "_turretPaths"];
(_vehicle doorPhase _door > 0.5) &&
{alive _vehicle} &&
{(_vehicle getVariable ["bis_disabled_Ramp", 0]) != 1} &&
{!(_vehicle getVariable [QGVAR(doorsLocked), false])} &&
{
(ACE_player == driver _vehicle) ||
{((assignedVehicleRole ACE_player) param [1, []]) in _turretPaths}
}

View File

@ -19,7 +19,6 @@ params ["_vehicle"];
private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
(isNumber (_config >> QGVAR(enabled)) &&
{(getNumber (_config >> QGVAR(enabled)) == 1) || {!(isNull (_vehicle getVariable [QGVAR(FRIES), objNull]))}} &&
((getNumber (_config >> QGVAR(enabled)) == 1) || {!(isNull (_vehicle getVariable [QGVAR(FRIES), objNull]))}) &&
{(_vehicle getVariable [QGVAR(deploymentStage), 0]) == 0} &&
{isText (_config >> QGVAR(onPrepare))})
{getText (_config >> QGVAR(onPrepare)) != ""}

View File

@ -32,8 +32,10 @@ _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
};
};
[QGVAR(ropeDetach), [_hook, _ropeTop]] call EFUNC(common,serverEvent);
[{{deleteVehicle _x} count _this}, [_ropeTop, _ropeBottom, _dummy, _hook], 60] call EFUNC(common,waitAndExecute);
detach _dummy;
deleteVehicle _ropeTop;
deleteVehicle _hook;
[{{deleteVehicle _x} count _this}, [_ropeBottom, _dummy], 60] call EFUNC(common,waitAndExecute);
} count _deployedRopes;
_vehicle setVariable [QGVAR(deployedRopes), [], true];

View File

@ -35,13 +35,14 @@ _hookAttachment = _vehicle getVariable [QGVAR(FRIES), _vehicle];
_origin = getPosATL _hook;
_dummy = createVehicle [QGVAR(helper), _origin vectorAdd [0, 0, -1], [], 0, "CAN_COLLIDE"];
_dummy = createVehicle [QGVAR(helper), _origin, [], 0, "CAN_COLLIDE"];
_dummy allowDamage false;
_dummy disableCollisionWith _vehicle;
_dummy attachTo [_hook, [0, 0, 0]];
_ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5];
_ropeBottom = ropeCreate [_dummy, [0, 0, 0], 1];
ropeUnwind [_ropeBottom, 30, 34.5, false];
ropeUnwind [_ropeBottom, 30, 35, false];
_ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}];
_ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}];

View File

@ -24,7 +24,7 @@ _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
_usableRope = _deployedRopes select 0;
_usableRopeIndex = 0;
{
if !(_x select 6) exitWith {
if !(_x select 5) exitWith {
_usableRope = _x;
_usableRopeIndex = _forEachIndex;
};

View File

@ -26,6 +26,7 @@ if (vehicle _unit != _unit) exitWith {};
//Start fast roping
if (animationState _unit != "ACE_FastRoping") exitWith {
detach _dummy;
_unit disableCollisionWith _dummy;
_unit attachTo [_dummy, [0, 0, -1.45]];
[_unit, "ACE_FastRoping", 2] call EFUNC(common,doAnimation);

View File

@ -54,14 +54,14 @@ if (((getPos _unit select 2) < 0.2) || {ropeLength _ropeTop == 34.5} || {vectorM
deleteVehicle _ropeBottom;
_origin = getPosASL _hook;
_dummy setPosASL (_origin vectorAdd [0, 0, -1]);
_dummy attachTo [_hook, [0, 0, 0]];
//Restore original mass and center of mass
_dummy setMass 40;
_dummy setCenterOfMass [0.000143227,0.00105986,-0.246147];
_ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5];
_ropeBottom = ropeCreate [_dummy, [0, 0, 0], 34.5];
_ropeBottom = ropeCreate [_dummy, [0, 0, 0], 35];
_ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}];
_ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}];

View File

@ -24,16 +24,24 @@ if !(isNull _fries) then {
[{
_this animateDoor ["door_R", 0];
_this animateDoor ["door_L", 0];
_vehicle animate ["dvere1_posunZ", 0];
_vehicle animate ["dvere2_posunZ", 0];
_this animateDoor ["CargoRamp_Open", 0];
_this animateDoor ["Door_rear_source", 0];
_this animateDoor ["Door_6_source", 0];
_this animate ["dvere1_posunZ", 0];
_this animate ["dvere2_posunZ", 0];
_this setVariable [QGVAR(doorsLocked), false, true];
}, _vehicle, 2] call EFUNC(common,waitAndExecute);
4
} else {
_vehicle animateDoor ["door_R", 0];
_vehicle animateDoor ["door_L", 0];
_vehicle animateDoor ["CargoRamp_Open", 0];
_vehicle animateDoor ["Door_rear_source", 0];
_vehicle animateDoor ["Door_6_source", 0];
_vehicle animate ["dvere1_posunZ", 0];
_vehicle animate ["dvere2_posunZ", 0];
_vehicle setVariable [QGVAR(doorsLocked), false, true];
2
};

View File

@ -22,9 +22,14 @@ _waitTime = 2;
_vehicle animateDoor ["door_R", 1];
_vehicle animateDoor ["door_L", 1];
_vehicle animateDoor ["CargoRamp_Open", 1];
_vehicle animateDoor ["Door_rear_source", 1];
_vehicle animateDoor ["Door_6_source", 1];
_vehicle animate ["dvere1_posunZ", 1];
_vehicle animate ["dvere2_posunZ", 1];
_vehicle setVariable [QGVAR(doorsLocked), true, true];
_fries = _vehicle getVariable [QGVAR(FRIES), objNull];
if !(isNull _fries) then {
[{