diff --git a/addons/main/CfgVehicles.hpp b/addons/main/CfgVehicles.hpp
index 74a9e40..ca62753 100644
--- a/addons/main/CfgVehicles.hpp
+++ b/addons/main/CfgVehicles.hpp
@@ -98,6 +98,14 @@ class CfgVehicles {
class AnyPerson2 : AnyPerson1 {};
};
};
+ class Buoy_base_F;
+ class GVAR(float): Buoy_base_F {
+ author = "Ampersand";
+ displayName = "Float";
+ _generalMacro = QGVAR(float);
+ model = QPATHTOF(data\float.p3d);
+ scope = 2;
+ };
class Man;
class CAManBase: Man {
class ACE_SelfActions {
@@ -133,6 +141,12 @@ class CfgVehicles {
condition = QUOTE([_player] call FUNC(canCutLoweringLine));
statement = QUOTE([_player] call FUNC(actionCutLoweringLine));
};
+ class GVAR(discardParachute) : GVAR(onChest) {
+ displayName = CSTRING(DiscardParachute);
+ exceptions[] = {"isNotSwimming"};
+ condition = QUOTE([_player] call FUNC(canDiscardParachute));
+ statement = QUOTE([_player] call FUNC(actionDiscardParachute));
+ };
};
};
};
diff --git a/addons/main/Stringtable.xml b/addons/main/Stringtable.xml
index 82777f6..4bf4073 100644
--- a/addons/main/Stringtable.xml
+++ b/addons/main/Stringtable.xml
@@ -112,5 +112,9 @@
Cut Lowering Line
Cut Lowering Line
+
+ Discard Parachute
+ Discard Parachute
+
diff --git a/addons/main/XEH_PREP.hpp b/addons/main/XEH_PREP.hpp
index 8e0cae9..807e070 100644
--- a/addons/main/XEH_PREP.hpp
+++ b/addons/main/XEH_PREP.hpp
@@ -2,9 +2,11 @@ PREP(ace_arsenal_onButtonClick);
PREP(ace_arsenal_opened);
PREP(ace_arsenal_updateUI);
PREP(actionCutLoweringLine);
+PREP(actionDiscardParachute);
PREP(actionLower);
PREP(actionOnBack);
PREP(actionOnChest);
+PREP(actionOnChest);
PREP(actionSwap);
PREP(addChestpack);
PREP(addItemToChestpack);
@@ -15,8 +17,10 @@ PREP(arsenal_postInit);
PREP(arsenal_updateUI);
PREP(canAddItemToChestpack);
PREP(canCutLoweringLine);
+PREP(canDiscardParachute);
PREP(canMovePack);
PREP(canLower);
+PREP(checkLandedPFH);
PREP(chestpack);
PREP(chestpackContainer);
PREP(chestpackLoadout);
@@ -30,6 +34,7 @@ PREP(EHGetIn);
PREP(EHGetOut);
PREP(EHHandleDisconnect);
PREP(EHKilled);
+PREP(floatPack);
PREP(itemMass);
PREP(moduleAdd);
PREP(moduleOnChest);
diff --git a/addons/main/XEH_postInit.sqf b/addons/main/XEH_postInit.sqf
index 2abff8b..25ac834 100644
--- a/addons/main/XEH_postInit.sqf
+++ b/addons/main/XEH_postInit.sqf
@@ -15,7 +15,14 @@
// Clear inventory of every backpack in a container
[QGVAR(clearCargoBackpacks), {call FUNC(clearCargoBackpacks)}] call CBA_fnc_addEventHandler;
+[QGVAR(floatPack), {call FUNC(floatPack)}] call CBA_fnc_addEventHandler;
+
if (isServer) then {
+ [QGVAR(hideObjectGlobal), {
+ params ["_object", "_isHidden"];
+ _object hideObjectGlobal _isHidden;
+ }] call CBA_fnc_addEventHandler;
+
[QGVAR(handleDisconnect), {
addMissionEventHandler ["HandleDisconnect", FUNC(EHHandleDisconnect)];
}] call CBA_fnc_addEventHandler;
@@ -24,22 +31,11 @@ if (isServer) then {
// holding the backpack have landed
[QGVAR(checkLandedPFH), {
params ["_ropeTop", "_holder"];
- [{
- params ["_ropeTop", "_pfhID"];
- if (speed _ropeTop < 1 && {getPos _ropeTop # 2 < 1}) exitWith {
- deleteVehicle _ropeTop;
- [_pfhID] call CBA_fnc_removePerFrameHandler;
- };
- }, 1, _ropeTop] call CBA_fnc_addPerFrameHandler;
- [{
- params ["_holder", "_pfhID"];
- if (speed _holder < 1 && {getPos _holder # 2 < 1}) exitWith {
- private _pos = getPos _holder;
- _pos set [2, 0];
- _holder setPos _pos;
- [_pfhID] call CBA_fnc_removePerFrameHandler;
- };
- }, 1, _holder] call CBA_fnc_addPerFrameHandler;
+ _ropeTop addEventHandler ["RopeBreak", {
+ //params ["_ropeTop", "_rope", "_holder"];
+ deleteVehicle (_this select 0);
+ }];
+ [{call FUNC(checkLandedPFH)}, 1, _this] call CBA_fnc_addPerFrameHandler;
}] call CBA_fnc_addEventHandler;
};
diff --git a/addons/main/data/float.p3d b/addons/main/data/float.p3d
new file mode 100644
index 0000000..e97743e
Binary files /dev/null and b/addons/main/data/float.p3d differ
diff --git a/addons/main/functions/fnc_EHGetIn.sqf b/addons/main/functions/fnc_EHGetIn.sqf
index 11f9867..ebc8b19 100644
--- a/addons/main/functions/fnc_EHGetIn.sqf
+++ b/addons/main/functions/fnc_EHGetIn.sqf
@@ -26,9 +26,9 @@ private _chestpack = [_unit] call FUNC(chestpackContainer);
if (_veh isKindOf "ParachuteBase") then {
_chestpack attachTo [_veh, [0, -0.03, -0.5]];
_chestpack setVectorDirAndUp [[-0.25, -1, 0], [0, 0, 1]];
- _chestpack hideObjectGlobal false;
+ [QGVAR(hideObjectGlobal), [_chestpack, false]] call CBA_fnc_serverEvent;
} else {
detach _chestpack;
- hideObjectGlobal _chestpack;
_chestpack setPos [-10000,-10000,-100];
+ [QGVAR(hideObjectGlobal), [_chestpack, true]] call CBA_fnc_serverEvent;
};
diff --git a/addons/main/functions/fnc_EHGetOut.sqf b/addons/main/functions/fnc_EHGetOut.sqf
index ac828cc..20b0962 100644
--- a/addons/main/functions/fnc_EHGetOut.sqf
+++ b/addons/main/functions/fnc_EHGetOut.sqf
@@ -27,7 +27,7 @@ private _chestpackClass = [_unit] call FUNC(chestpack);
if !(_chestpackClass in GVAR(exceptions)) then {
_chestpack attachTo [_unit,[0,-0.03,-0.5],"pelvis"];
_chestpack setVectorDirAndUp [[-0.25,-1,0],[0,0,1]];
- _chestpack hideObjectGlobal false;
+ [QGVAR(hideObjectGlobal), [_chestpack, false]] call CBA_fnc_serverEvent;
};
if (GVAR(walk)) then {
diff --git a/addons/main/functions/fnc_EHKilled.sqf b/addons/main/functions/fnc_EHKilled.sqf
index c4200db..c3f8e5c 100644
--- a/addons/main/functions/fnc_EHKilled.sqf
+++ b/addons/main/functions/fnc_EHKilled.sqf
@@ -21,7 +21,8 @@ private _chestpack = [_unit] call FUNC(chestpack);
private _chestpackLoadout = [_unit] call FUNC(chestpackLoadout);
private _chestpackVariables = [_unit] call FUNC(chestpackVariables);
-private _holder = createVehicle ["WeaponHolderSimulated", (getPos _unit), [], 0, "CAN_COLLIDE"];
+private _holder = createVehicle ["WeaponHolderSimulated", [0, 0, 0], [], 0, "CAN_COLLIDE"];
+_holder setPosASL getPosASL _unit;
//add pack
_holder addBackpackCargoGlobal [_chestpack, 1];
diff --git a/addons/main/functions/fnc_actionCutLoweringLine.sqf b/addons/main/functions/fnc_actionCutLoweringLine.sqf
index 7809f39..d246f48 100644
--- a/addons/main/functions/fnc_actionCutLoweringLine.sqf
+++ b/addons/main/functions/fnc_actionCutLoweringLine.sqf
@@ -16,17 +16,24 @@
*/
params ["_unit"];
-private _chute = vehicle _unit;
-private _ropeTop = _chute getVariable [QGVAR(loweringLine), objNull];
+private _vehicle = vehicle _unit;
+private _ropeTop = _vehicle getVariable [QGVAR(loweringLine), objNull];
+_vehicle setVariable [QGVAR(loweringLine), objNull, true];
if (!isNull _ropeTop) then {
private _rope = ropes _ropeTop # 0;
- private _holder = ropeAttachedObjects _ropeTop # 0;
- _holder ropeDetach _rope;
- // ace_fastroping_helper is a helicopter and kind of autorotates down instead
- // of falling, much slower than a falling object. Attaching to the holder
- // also looks like the rope snapping under tension once cut
- _ropeTop attachTo [_holder, [0.1,-0.45,-0.6]];
-
- _chute setVariable [QGVAR(loweringLine), objNull, true];
+ private _attachedObjects = ropeAttachedObjects _ropeTop;
+ if (_attachedObjects isEqualTo []) then {
+ deleteVehicle _ropeTop;
+ } else {
+ private _holder = _attachedObjects # 0;
+ _holder ropeDetach _rope;
+ // ace_fastroping_helper is a helicopter and kind of autorotates down instead
+ // of falling, much slower than a falling object. Attaching to the holder
+ // also looks like the rope snapping under tension once cut
+ [{
+ params ["_ropeTop", "_holder"];
+ _ropeTop attachTo [_holder, [0.1,-0.45,-0.6]];
+ }, [_ropeTop, _holder]] call CBA_fnc_execNextFrame;
+ };
};
diff --git a/addons/main/functions/fnc_actionDiscardParachute.sqf b/addons/main/functions/fnc_actionDiscardParachute.sqf
new file mode 100644
index 0000000..b42c21a
--- /dev/null
+++ b/addons/main/functions/fnc_actionDiscardParachute.sqf
@@ -0,0 +1,31 @@
+#include "script_component.hpp"
+/*
+ * Author: Ampersand
+ * Triggered by the discard-reserve-action.
+ * Puts the reserve parachute into WeaponHolderSimulated to sink and
+ * moves the chestpack to back if present.
+ *
+ * Arguments:
+ * 0: Unit