From f06f38a10713b2ce06a79d62b35cc014ce7830d1 Mon Sep 17 00:00:00 2001 From: Joko Date: Tue, 19 May 2015 13:45:28 +0200 Subject: [PATCH 01/18] Add Cut Parachute --- addons/parachute/CfgVehicles.hpp | 15 ++++++++++++ addons/parachute/UI/cut_ca.paa | Bin 0 -> 22016 bytes addons/parachute/XEH_postInit.sqf | 2 +- addons/parachute/XEH_preInit.sqf | 3 ++- .../functions/fnc_checkCutParachute.sqf | 18 ++++++++++++++ .../parachute/functions/fnc_cutParachute.sqf | 22 ++++++++++++++++++ addons/parachute/functions/fnc_doLanding.sqf | 1 + addons/parachute/stringtable.xml | 4 ++++ 8 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 addons/parachute/UI/cut_ca.paa create mode 100644 addons/parachute/functions/fnc_checkCutParachute.sqf create mode 100644 addons/parachute/functions/fnc_cutParachute.sqf diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index 04732d0506..9aa4e0e674 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -1,4 +1,5 @@ class CfgVehicles { + class Man; class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { @@ -15,6 +16,20 @@ class CfgVehicles { }; }; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_CutParachute { + displayName = "STR_ACE_Parachute_CutParachute"; + exceptions[] = {"isNotInside"}; + condition = QUOTE([_player] call FUNC(checkCutParachute)); + statement = QUOTE([_player] call FUNC(cutParachute)); + showDisabled = 0; + priority = 2.9; + icon = QUOTE(PATHTOF(UI\cut_ca.paa)); + hotkey = "C"; + }; + }; + }; class B_Parachute; class ACE_NonSteerableParachute: B_Parachute { author = "$STR_ACE_Common_ACETeam"; diff --git a/addons/parachute/UI/cut_ca.paa b/addons/parachute/UI/cut_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..2f5948535bb436409ae1bf4bc7c506587d5849fc GIT binary patch literal 22016 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 ((_this select 0) select 0) + 1) then { ((_this select 0) select 1) playActionNow "Crouch"; diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index d3cdbd9a7d..f20cd8928c 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -49,5 +49,9 @@ Paracadute non manovrabile Para-querdas não controlável + + Cut Parachute + Fallschirm abschneiden + From 75be6a1906436250c62d9695170247758d37871b Mon Sep 17 00:00:00 2001 From: Joko Date: Tue, 19 May 2015 13:47:39 +0200 Subject: [PATCH 02/18] TAAAABBBBSSSSSS --- addons/parachute/stringtable.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index f20cd8928c..0175d61d60 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -49,9 +49,9 @@ Paracadute non manovrabile Para-querdas não controlável - - Cut Parachute - Fallschirm abschneiden + + Cut Parachute + Fallschirm abschneiden From e40310189e9843dfd15b956b5e48735f36f30b97 Mon Sep 17 00:00:00 2001 From: Joko Date: Tue, 19 May 2015 13:55:25 +0200 Subject: [PATCH 03/18] Prevent Respawn bug Change to Macros --- addons/parachute/CfgEventHandlers.hpp | 7 +++++++ addons/parachute/XEH_respawn.sqf | 17 +++++++++++++++++ addons/parachute/functions/fnc_doLanding.sqf | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 addons/parachute/XEH_respawn.sqf diff --git a/addons/parachute/CfgEventHandlers.hpp b/addons/parachute/CfgEventHandlers.hpp index 8c7edda20f..7a1f8119ca 100644 --- a/addons/parachute/CfgEventHandlers.hpp +++ b/addons/parachute/CfgEventHandlers.hpp @@ -8,3 +8,10 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; +class Extended_Respawn_EventHandlers { + class CAManBase { + class ADDON { + respawn = QUOTE(call COMPILE_FILE(XEH_respawn)); + }; + }; +}; \ No newline at end of file diff --git a/addons/parachute/XEH_respawn.sqf b/addons/parachute/XEH_respawn.sqf new file mode 100644 index 0000000000..7ed3ae830a --- /dev/null +++ b/addons/parachute/XEH_respawn.sqf @@ -0,0 +1,17 @@ +/* + * Author: joko // Jonas + * Reset the parachute system. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * None + * + * Public: No + */ +#include "script_component.hpp" +SETVAR(_unit,chuteIsCuted,false); \ No newline at end of file diff --git a/addons/parachute/functions/fnc_doLanding.sqf b/addons/parachute/functions/fnc_doLanding.sqf index c5cb630876..15d8aca4a1 100644 --- a/addons/parachute/functions/fnc_doLanding.sqf +++ b/addons/parachute/functions/fnc_doLanding.sqf @@ -18,7 +18,7 @@ private ["_unit"]; _unit = _this select 0; GVAR(PFH) = false; [_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call EFUNC(common,doAnimation); -_unit setVariable[QGVAR(chuteIsCuted),true]; +SETVAR(_unit,chuteIsCuted,false); [{ if (time >= ((_this select 0) select 0) + 1) then { ((_this select 0) select 1) playActionNow "Crouch"; From 6a5e1265f0c0903b6aedb4f5e2bdf24adeaa8d22 Mon Sep 17 00:00:00 2001 From: Joko Date: Tue, 19 May 2015 14:08:40 +0200 Subject: [PATCH 04/18] Update AUTHORS.txt --- AUTHORS.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index e40b4c8ee6..3fdd12f6df 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,4 +1,4 @@ -# ACE 3 CONTRIBUTOR LIST +j# ACE 3 CONTRIBUTOR LIST # If you contributed, but are not listed here, contact me: # koffeinflummi@gmail.com # @@ -57,7 +57,7 @@ Hamburger SV Harakhti havena Hawkins -jokoho48 +jokoho482 Jonpas Kllrt Legolasindar "Viper" From 44bc4ff66a19d388ddbf95c1577c81fd2d1102f8 Mon Sep 17 00:00:00 2001 From: Joko Date: Tue, 19 May 2015 14:16:41 +0200 Subject: [PATCH 05/18] Fail J in AUTHORS.txt --- AUTHORS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 3fdd12f6df..83f759c0ce 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,4 +1,4 @@ -j# ACE 3 CONTRIBUTOR LIST +# ACE 3 CONTRIBUTOR LIST # If you contributed, but are not listed here, contact me: # koffeinflummi@gmail.com # From 7a012a5acb7a3a6c43520dcd9694e5978d0313ce Mon Sep 17 00:00:00 2001 From: Joko Date: Tue, 19 May 2015 14:20:56 +0200 Subject: [PATCH 06/18] chuteIsCuted -> chuteIsCut --- addons/parachute/XEH_respawn.sqf | 2 +- addons/parachute/functions/fnc_checkCutParachute.sqf | 2 +- addons/parachute/functions/fnc_cutParachute.sqf | 2 +- addons/parachute/functions/fnc_doLanding.sqf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/parachute/XEH_respawn.sqf b/addons/parachute/XEH_respawn.sqf index 7ed3ae830a..2e999c2f45 100644 --- a/addons/parachute/XEH_respawn.sqf +++ b/addons/parachute/XEH_respawn.sqf @@ -14,4 +14,4 @@ * Public: No */ #include "script_component.hpp" -SETVAR(_unit,chuteIsCuted,false); \ No newline at end of file +SETVAR(_unit,chuteIsCut,false); \ No newline at end of file diff --git a/addons/parachute/functions/fnc_checkCutParachute.sqf b/addons/parachute/functions/fnc_checkCutParachute.sqf index dcd83eee2d..b2f15cc655 100644 --- a/addons/parachute/functions/fnc_checkCutParachute.sqf +++ b/addons/parachute/functions/fnc_checkCutParachute.sqf @@ -15,4 +15,4 @@ */ _unit = _this select 0; -if (animationState _unit == "para_pilot" && !(GETVAR(_unit,chuteIsCuted,false))) then {true} else {false}; \ No newline at end of file +if (animationState _unit == "para_pilot" && !(GETVAR(_unit,chuteIsCut,false))) then {true} else {false}; \ No newline at end of file diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index 3979c75020..a92553377d 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -19,4 +19,4 @@ _vehicle = vehicle _unit; _unit action ["GetOut", vehicle _unit]; deleteVehicle _vehicle; _unit addBackpack "B_Parachute"; -SETVAR(_unit,chuteIsCuted,true); \ No newline at end of file +SETVAR(_unit,chuteIsCut,true); \ No newline at end of file diff --git a/addons/parachute/functions/fnc_doLanding.sqf b/addons/parachute/functions/fnc_doLanding.sqf index 15d8aca4a1..7d3ac1ad10 100644 --- a/addons/parachute/functions/fnc_doLanding.sqf +++ b/addons/parachute/functions/fnc_doLanding.sqf @@ -18,7 +18,7 @@ private ["_unit"]; _unit = _this select 0; GVAR(PFH) = false; [_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call EFUNC(common,doAnimation); -SETVAR(_unit,chuteIsCuted,false); +SETVAR(_unit,chuteIsCut,false); [{ if (time >= ((_this select 0) select 0) + 1) then { ((_this select 0) select 1) playActionNow "Crouch"; From 48f44813ea389952498a56e099b8353a7dd4fd1a Mon Sep 17 00:00:00 2001 From: Joko Date: Tue, 19 May 2015 18:17:10 +0200 Subject: [PATCH 07/18] Update to ACE Standarts Fix Adding anytime B_Parachute Fix Reserve Parachute Added if Normal Parachute Open --- addons/parachute/CfgVehicles.hpp | 8 +++-- addons/parachute/XEH_postInit.sqf | 6 ++-- addons/parachute/XEH_preInit.sqf | 3 +- addons/parachute/XEH_respawn.sqf | 2 +- .../functions/fnc_checkCutParachute.sqf | 29 +++++++++-------- .../parachute/functions/fnc_cutParachute.sqf | 32 +++++++++---------- addons/parachute/functions/fnc_doLanding.sqf | 2 +- .../functions/fnc_storeParachute.sqf | 28 ++++++++++++++++ addons/parachute/stringtable.xml | 2 +- .../development/ace3-events-system.md | 2 +- 10 files changed, 74 insertions(+), 40 deletions(-) create mode 100644 addons/parachute/functions/fnc_storeParachute.sqf diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index 9aa4e0e674..0b593d5412 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -1,5 +1,5 @@ class CfgVehicles { - class Man; + class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { @@ -16,20 +16,22 @@ class CfgVehicles { }; }; + class Man; class CAManBase: Man { class ACE_SelfActions { class ACE_CutParachute { - displayName = "STR_ACE_Parachute_CutParachute"; + displayName = "$STR_ACE_Parachute_CutParachute"; exceptions[] = {"isNotInside"}; condition = QUOTE([_player] call FUNC(checkCutParachute)); statement = QUOTE([_player] call FUNC(cutParachute)); showDisabled = 0; priority = 2.9; icon = QUOTE(PATHTOF(UI\cut_ca.paa)); - hotkey = "C"; + hotkey = "C"; // Did this allready Work? }; }; }; + class B_Parachute; class ACE_NonSteerableParachute: B_Parachute { author = "$STR_ACE_Common_ACETeam"; diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index 7e042d04b8..093328a1ea 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -23,7 +23,7 @@ if (!hasInterface) exitWith {}; if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false}; if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then { - [ace_player] call FUNC(showAltimeter); + [ACE_player] call FUNC(showAltimeter); } else { call FUNC(hideAltimeter); }; @@ -41,4 +41,6 @@ GVAR(PFH) = false; }] call EFUNC(common,addEventHandler); // don't show speed and height when in expert mode -["infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call EFUNC(common,addEventHandler); \ No newline at end of file +["infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call EFUNC(common,addEventHandler); +//[ACE_Player,([ACE_player] call EFUNC(common,getAllGear))] call FUNC(storeParachute); +["playerInventoryChanged", FUNC(storeParachute) ] call EFUNC(common,addEventHandler); \ No newline at end of file diff --git a/addons/parachute/XEH_preInit.sqf b/addons/parachute/XEH_preInit.sqf index b483a73ca8..7bc0823215 100644 --- a/addons/parachute/XEH_preInit.sqf +++ b/addons/parachute/XEH_preInit.sqf @@ -22,6 +22,7 @@ PREP(handleInfoDisplayChanged); PREP(hideAltimeter); PREP(onEachFrame); PREP(showAltimeter); -PREP(checkCutParachute); PREP(cutParachute); +PREP(checkCutParachute); +PREP(storeParachute); ADDON = true; diff --git a/addons/parachute/XEH_respawn.sqf b/addons/parachute/XEH_respawn.sqf index 2e999c2f45..64ce0a7cc2 100644 --- a/addons/parachute/XEH_respawn.sqf +++ b/addons/parachute/XEH_respawn.sqf @@ -14,4 +14,4 @@ * Public: No */ #include "script_component.hpp" -SETVAR(_unit,chuteIsCut,false); \ No newline at end of file +_unit setVariable [QGVAR(chuteIsCut), false]; \ No newline at end of file diff --git a/addons/parachute/functions/fnc_checkCutParachute.sqf b/addons/parachute/functions/fnc_checkCutParachute.sqf index b2f15cc655..3c551fa47a 100644 --- a/addons/parachute/functions/fnc_checkCutParachute.sqf +++ b/addons/parachute/functions/fnc_checkCutParachute.sqf @@ -1,18 +1,19 @@ #include "script_component.hpp" /* - Name: check Cut Parachute + * Author: joko // Jonas + * Reset the parachute system. + * + * Arguments: + * 0: Object + * + * Return Value: + * Boolean + * + * Example: + * [player] call FUNC(checkCutParachute); + * + * Public: No + */ - Author: joko // Jonas - - Description: - Check if Parachute can be Cuted - - Parameters: - 0: Object - - Returns: - Boolean -*/ _unit = _this select 0; - -if (animationState _unit == "para_pilot" && !(GETVAR(_unit,chuteIsCut,false))) then {true} else {false}; \ No newline at end of file +(animationState _unit == 'para_pilot' && !(_unit getvariable [QGVAR(chuteIsCut),false])) \ No newline at end of file diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index a92553377d..be050a921c 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -1,22 +1,22 @@ #include "script_component.hpp" /* - Name: Cut Parachute - - Author: joko // Jonas - - Description: - Cut Parachute and delete Old - - Parameters: - 0: Object - - Returns: - Nothing -*/ + * Author: joko // Jonas + * Cut Parachute and delete Old + * + * Arguments: + * 0: Object + * + * Return Value: + * Nothing + * + * Example: + * [player] call FUNC(cutParachute); + * + * Public: No + */ private["_unit","_vehicle"]; -_unit = _this select 0; +PARAMS_1(_unit); _vehicle = vehicle _unit; _unit action ["GetOut", vehicle _unit]; deleteVehicle _vehicle; -_unit addBackpack "B_Parachute"; -SETVAR(_unit,chuteIsCut,true); \ No newline at end of file +_unit setVariable [QGVAR(chuteIsCut), true]; \ No newline at end of file diff --git a/addons/parachute/functions/fnc_doLanding.sqf b/addons/parachute/functions/fnc_doLanding.sqf index 7d3ac1ad10..3e10f521a8 100644 --- a/addons/parachute/functions/fnc_doLanding.sqf +++ b/addons/parachute/functions/fnc_doLanding.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" private ["_unit"]; -_unit = _this select 0; +PARAMS_1(_unit); GVAR(PFH) = false; [_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call EFUNC(common,doAnimation); SETVAR(_unit,chuteIsCut,false); diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf new file mode 100644 index 0000000000..8437745840 --- /dev/null +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -0,0 +1,28 @@ +#include "script_component.hpp" +/* + * Author: joko // Jonas + * Add the Reserve Parachute to Units or Save Backpack if is a Parachute in Unit + * + * Arguments: + * None + * + * Return Value: + * 0: Unit + * 1: getAllGear-Array + * + * Example: + * None + * + * Public: No + */ + +_unit = _this select 0; +_backpack = ((_this select 1) select 6); + +if ((vehicle _unit) isKindOf "ParachuteBase" || (backpack _unit == "")) then { + _unit addbackpack (_unit getVariable[QGVAR(backpackClass),""]); +} else { + if (getText(configfile >> "CfgVehicles" >> _backpack >> "ParachuteClass") in ["NonSteerable_Parachute_F","B_Parachute_02_F","O_Parachute_02_F","I_Parachute_02_F","Steerable_Parachute_F"]) then { + _unit setvariable[QGVAR(backpackClass),_backpack]; + }; +}; \ No newline at end of file diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index 0175d61d60..ce810df6aa 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -52,6 +52,6 @@ Cut Parachute Fallschirm abschneiden - + diff --git a/documentation/development/ace3-events-system.md b/documentation/development/ace3-events-system.md index 77281c9c7c..e9618d1456 100644 --- a/documentation/development/ace3-events-system.md +++ b/documentation/development/ace3-events-system.md @@ -73,7 +73,7 @@ PREP(onTapShoulder); "playerInventoryChanged" Inventory changed common - getAllGear-Array + [_player, getAllGear-Array] local From 4db99894800ceb421a6d6bba7f46ace191243795 Mon Sep 17 00:00:00 2001 From: Joko Date: Tue, 19 May 2015 19:33:24 +0200 Subject: [PATCH 08/18] Add Posible to use Mod Parachutes --- addons/parachute/CfgVehicles.hpp | 12 +++++++++--- addons/parachute/functions/fnc_storeParachute.sqf | 7 +++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index 0b593d5412..c90e680822 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -27,13 +27,19 @@ class CfgVehicles { showDisabled = 0; priority = 2.9; icon = QUOTE(PATHTOF(UI\cut_ca.paa)); - hotkey = "C"; // Did this allready Work? + hotkey = "C"; // Did this realy Work? }; }; }; - - class B_Parachute; + class Helicopter; + class ParachuteBase: Helicopter { + ace_reserveParachute = "ACE_NonSteerableParachute"; + }; + class B_Parachute: ParachuteBase { + ace_reserveParachute = "ACE_NonSteerableParachute"; + }; class ACE_NonSteerableParachute: B_Parachute { + ace_reserveParachute = "ACE_NonSteerableParachute"; author = "$STR_ACE_Common_ACETeam"; scope = 2; displayName = "$STR_ACE_Parachute_NonSteerableParachute"; diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index 8437745840..f2bf08e06c 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -17,12 +17,11 @@ */ _unit = _this select 0; -_backpack = ((_this select 1) select 6); - +_backpack = (_this select 1) select 6 ; if ((vehicle _unit) isKindOf "ParachuteBase" || (backpack _unit == "")) then { _unit addbackpack (_unit getVariable[QGVAR(backpackClass),""]); } else { - if (getText(configfile >> "CfgVehicles" >> _backpack >> "ParachuteClass") in ["NonSteerable_Parachute_F","B_Parachute_02_F","O_Parachute_02_F","I_Parachute_02_F","Steerable_Parachute_F"]) then { - _unit setvariable[QGVAR(backpackClass),_backpack]; + if (getText(configfile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute") != "") then { + _unit setvariable[QGVAR(backpackClass),getText(configfile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute"),"ACE_NonSteerableParachute"]; }; }; \ No newline at end of file From bc535c95ba6f23276020ae93718395b506096956 Mon Sep 17 00:00:00 2001 From: Joko Date: Tue, 19 May 2015 21:46:34 +0200 Subject: [PATCH 09/18] Fixing Privates --- addons/parachute/XEH_respawn.sqf | 2 +- addons/parachute/functions/fnc_checkCutParachute.sqf | 2 +- addons/parachute/functions/fnc_cutParachute.sqf | 2 +- addons/parachute/functions/fnc_doLanding.sqf | 4 ++-- addons/parachute/functions/fnc_storeParachute.sqf | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/parachute/XEH_respawn.sqf b/addons/parachute/XEH_respawn.sqf index 64ce0a7cc2..31e3ff2ae2 100644 --- a/addons/parachute/XEH_respawn.sqf +++ b/addons/parachute/XEH_respawn.sqf @@ -14,4 +14,4 @@ * Public: No */ #include "script_component.hpp" -_unit setVariable [QGVAR(chuteIsCut), false]; \ No newline at end of file +ACE_player setVariable [QGVAR(chuteIsCut), false]; \ No newline at end of file diff --git a/addons/parachute/functions/fnc_checkCutParachute.sqf b/addons/parachute/functions/fnc_checkCutParachute.sqf index 3c551fa47a..8dc322bad8 100644 --- a/addons/parachute/functions/fnc_checkCutParachute.sqf +++ b/addons/parachute/functions/fnc_checkCutParachute.sqf @@ -14,6 +14,6 @@ * * Public: No */ - +privat["_unit"]; _unit = _this select 0; (animationState _unit == 'para_pilot' && !(_unit getvariable [QGVAR(chuteIsCut),false])) \ No newline at end of file diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index be050a921c..a1dad45088 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -15,7 +15,7 @@ * Public: No */ private["_unit","_vehicle"]; -PARAMS_1(_unit); +_unit = _this select 0; _vehicle = vehicle _unit; _unit action ["GetOut", vehicle _unit]; deleteVehicle _vehicle; diff --git a/addons/parachute/functions/fnc_doLanding.sqf b/addons/parachute/functions/fnc_doLanding.sqf index 3e10f521a8..874899f064 100644 --- a/addons/parachute/functions/fnc_doLanding.sqf +++ b/addons/parachute/functions/fnc_doLanding.sqf @@ -14,8 +14,8 @@ * Public: No */ #include "script_component.hpp" -private ["_unit"]; -PARAMS_1(_unit); +private["_unit"]; +_unit = _this select 0; GVAR(PFH) = false; [_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call EFUNC(common,doAnimation); SETVAR(_unit,chuteIsCut,false); diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index f2bf08e06c..f0fab3a800 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -15,13 +15,13 @@ * * Public: No */ - +private ["_unit","_backpack"]; _unit = _this select 0; _backpack = (_this select 1) select 6 ; if ((vehicle _unit) isKindOf "ParachuteBase" || (backpack _unit == "")) then { - _unit addbackpack (_unit getVariable[QGVAR(backpackClass),""]); + _unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); } else { - if (getText(configfile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute") != "") then { - _unit setvariable[QGVAR(backpackClass),getText(configfile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute"),"ACE_NonSteerableParachute"]; + if (getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute") != "") then { + _unit setVariable[QGVAR(backpackClass),getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute")]; }; }; \ No newline at end of file From 8c69ff4573847f0e7b305b7f3aa0ca05de011412 Mon Sep 17 00:00:00 2001 From: Joko Date: Wed, 20 May 2015 22:13:18 +0200 Subject: [PATCH 10/18] reset Form SETVAR to setVariable --- addons/parachute/functions/fnc_doLanding.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/parachute/functions/fnc_doLanding.sqf b/addons/parachute/functions/fnc_doLanding.sqf index 874899f064..33ba2ccfca 100644 --- a/addons/parachute/functions/fnc_doLanding.sqf +++ b/addons/parachute/functions/fnc_doLanding.sqf @@ -18,7 +18,7 @@ private["_unit"]; _unit = _this select 0; GVAR(PFH) = false; [_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call EFUNC(common,doAnimation); -SETVAR(_unit,chuteIsCut,false); +_unit setVariable [QGVAR(chuteIsCut), false]; [{ if (time >= ((_this select 0) select 0) + 1) then { ((_this select 0) select 1) playActionNow "Crouch"; From 41c6ea8b4e153c2ef2cf65771973db2cb94a77e8 Mon Sep 17 00:00:00 2001 From: Joko Date: Thu, 21 May 2015 08:06:59 +0200 Subject: [PATCH 11/18] Fix Reload Bug --- addons/parachute/functions/fnc_checkCutParachute.sqf | 4 ++-- addons/parachute/functions/fnc_cutParachute.sqf | 2 +- addons/parachute/functions/fnc_storeParachute.sqf | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/parachute/functions/fnc_checkCutParachute.sqf b/addons/parachute/functions/fnc_checkCutParachute.sqf index 8dc322bad8..fb9629c598 100644 --- a/addons/parachute/functions/fnc_checkCutParachute.sqf +++ b/addons/parachute/functions/fnc_checkCutParachute.sqf @@ -1,4 +1,3 @@ -#include "script_component.hpp" /* * Author: joko // Jonas * Reset the parachute system. @@ -14,6 +13,7 @@ * * Public: No */ -privat["_unit"]; +#include "script_component.hpp" +private["_unit"]; _unit = _this select 0; (animationState _unit == 'para_pilot' && !(_unit getvariable [QGVAR(chuteIsCut),false])) \ No newline at end of file diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index a1dad45088..97dd373df3 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -1,4 +1,3 @@ -#include "script_component.hpp" /* * Author: joko // Jonas * Cut Parachute and delete Old @@ -14,6 +13,7 @@ * * Public: No */ +#include "script_component.hpp" private["_unit","_vehicle"]; _unit = _this select 0; _vehicle = vehicle _unit; diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index f0fab3a800..d1ea40f579 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -1,4 +1,3 @@ -#include "script_component.hpp" /* * Author: joko // Jonas * Add the Reserve Parachute to Units or Save Backpack if is a Parachute in Unit @@ -15,10 +14,11 @@ * * Public: No */ +#include "script_component.hpp" private ["_unit","_backpack"]; _unit = _this select 0; _backpack = (_this select 1) select 6 ; -if ((vehicle _unit) isKindOf "ParachuteBase" || (backpack _unit == "")) then { +if ((vehicle _unit) isKindOf "ParachuteBase") then { _unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); } else { if (getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute") != "") then { From ccd3fb8b4ade5b4cd20eee2cfdc6dcb701218807 Mon Sep 17 00:00:00 2001 From: Joko Date: Thu, 21 May 2015 14:03:52 +0200 Subject: [PATCH 12/18] Enhance some scripts add New Config Parameter has Reserve Parachute --- addons/parachute/CfgVehicles.hpp | 26 +++++++++++++++---- .../functions/fnc_checkCutParachute.sqf | 2 +- .../parachute/functions/fnc_cutParachute.sqf | 2 +- .../functions/fnc_storeParachute.sqf | 5 ++-- addons/parachute/stringtable.xml | 4 +++ 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index c90e680822..7d0f88d68f 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -1,5 +1,4 @@ class CfgVehicles { - class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { @@ -13,6 +12,10 @@ class CfgVehicles { backpack = "ACE_NonSteerableParachute"; count = 4; }; + class _xx_ACE_ReserveParachute { + backpack = "ACE_ReserveParachute"; + count = 4; + }; }; }; @@ -33,13 +36,16 @@ class CfgVehicles { }; class Helicopter; class ParachuteBase: Helicopter { - ace_reserveParachute = "ACE_NonSteerableParachute"; + ace_hasReserveParachute = 1; + ace_reserveParachute = "ACE_ReserveParachute"; }; class B_Parachute: ParachuteBase { - ace_reserveParachute = "ACE_NonSteerableParachute"; + ace_hasReserveParachute = 1; + ace_reserveParachute = "ACE_ReserveParachute"; }; class ACE_NonSteerableParachute: B_Parachute { - ace_reserveParachute = "ACE_NonSteerableParachute"; + ace_hasReserveParachute = 0; + ace_reserveParachute = ""; author = "$STR_ACE_Common_ACETeam"; scope = 2; displayName = "$STR_ACE_Parachute_NonSteerableParachute"; @@ -50,7 +56,17 @@ class CfgVehicles { maximumLoad = 0; mass = 100; }; - + class ACE_ReserveParachute: ACE_NonSteerableParachute { + author = "$STR_ACE_Common_ACETeam"; + displayName = "$STR_ACE_Parachute_ReserveParachute"; + //picture = "\z\ace\addons\parachute\ui\reserveParachute_icon.paa"; //@todo + //model = "\z\ace\addons\parachute\data\test.p3d"; // @todo + ace_hasReserveParachute = 0; + ace_reserveParachute = ""; + ParachuteClass = "NonSteerable_Parachute_F"; + mass = 70; + scope = 2; + }; class B_Soldier_05_f; class B_Pilot_F: B_Soldier_05_f {backpack = "ACE_NonSteerableParachute";}; class I_Soldier_04_F; class I_pilot_F: I_Soldier_04_F {backpack = "ACE_NonSteerableParachute";}; class O_helipilot_F; class O_Pilot_F: O_helipilot_F {backpack = "ACE_NonSteerableParachute";}; diff --git a/addons/parachute/functions/fnc_checkCutParachute.sqf b/addons/parachute/functions/fnc_checkCutParachute.sqf index fb9629c598..9d804b7f5f 100644 --- a/addons/parachute/functions/fnc_checkCutParachute.sqf +++ b/addons/parachute/functions/fnc_checkCutParachute.sqf @@ -16,4 +16,4 @@ #include "script_component.hpp" private["_unit"]; _unit = _this select 0; -(animationState _unit == 'para_pilot' && !(_unit getvariable [QGVAR(chuteIsCut),false])) \ No newline at end of file +(animationState _unit == 'para_pilot' && !(_unit getvariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) \ No newline at end of file diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index 97dd373df3..e8300012c3 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -17,6 +17,6 @@ private["_unit","_vehicle"]; _unit = _this select 0; _vehicle = vehicle _unit; -_unit action ["GetOut", vehicle _unit]; +_unit action ["GetOut", _vehicle]; deleteVehicle _vehicle; _unit setVariable [QGVAR(chuteIsCut), true]; \ No newline at end of file diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index d1ea40f579..ba2eb7631d 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -18,10 +18,11 @@ private ["_unit","_backpack"]; _unit = _this select 0; _backpack = (_this select 1) select 6 ; -if ((vehicle _unit) isKindOf "ParachuteBase") then { +if ((vehicle _unit) isKindOf "ParachuteBase" && !([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) && !(_unit getVariable [QGVAR(chuteIsCut),false])) then { _unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); } else { - if (getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute") != "") then { + if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then { _unit setVariable[QGVAR(backpackClass),getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute")]; }; + _unit setVariable [QGVAR(hasReserve),[false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))]; }; \ No newline at end of file diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index ce810df6aa..b9ccad48a4 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -53,5 +53,9 @@ Cut Parachute Fallschirm abschneiden + + Reserve Parachute + Reserve Fallschirm + From f8003fd8652448a6e00ec63ca7fb307c1f5444d2 Mon Sep 17 00:00:00 2001 From: Joko Date: Thu, 21 May 2015 14:06:23 +0200 Subject: [PATCH 13/18] fix adding a New Parachute if one already given --- addons/parachute/functions/fnc_storeParachute.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index ba2eb7631d..ad90001349 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -18,7 +18,7 @@ private ["_unit","_backpack"]; _unit = _this select 0; _backpack = (_this select 1) select 6 ; -if ((vehicle _unit) isKindOf "ParachuteBase" && !([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) && !(_unit getVariable [QGVAR(chuteIsCut),false])) then { +if ((vehicle _unit) isKindOf "ParachuteBase" && (backpack _unit == "") && !([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) && !(_unit getVariable [QGVAR(chuteIsCut),false])) then { _unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); } else { if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then { From 9a212f06874d9262307d8adde89ec4f3e361bafb Mon Sep 17 00:00:00 2001 From: Joko Date: Thu, 21 May 2015 14:54:00 +0200 Subject: [PATCH 14/18] Fix gettings anytime a new Parachute --- .../functions/fnc_storeParachute.sqf | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index ad90001349..f469384722 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -1,28 +1,30 @@ /* - * Author: joko // Jonas - * Add the Reserve Parachute to Units or Save Backpack if is a Parachute in Unit - * - * Arguments: - * None - * - * Return Value: - * 0: Unit - * 1: getAllGear-Array - * - * Example: - * None - * - * Public: No - */ -#include "script_component.hpp" -private ["_unit","_backpack"]; -_unit = _this select 0; -_backpack = (_this select 1) select 6 ; -if ((vehicle _unit) isKindOf "ParachuteBase" && (backpack _unit == "") && !([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) && !(_unit getVariable [QGVAR(chuteIsCut),false])) then { - _unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); -} else { - if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then { - _unit setVariable[QGVAR(backpackClass),getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute")]; - }; - _unit setVariable [QGVAR(hasReserve),[false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))]; -}; \ No newline at end of file + * Author: joko // Jonas + * Add the Reserve Parachute to Units or Save Backpack if is a Parachute in Unit + * + * Arguments: + * None + * + * Return Value: + * 0: Unit + * 1: getAllGear-Array + * + * Example: + * None + * + * Public: No + */ + #include "script_component.hpp" + private ["_unit","_backpack"]; + _unit = _this select 0; + _backpack = (_this select 1) select 6 ; + if ((vehicle _unit) isKindOf "ParachuteBase" && backpack player == "" && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) then { + _unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); + } else { + if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then { + _unit setVariable[QGVAR(backpackClass),getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute")]; + }; + if (!(_unit getVariable [QGVAR(chuteIsCut),false]) && !(animationState _unit == 'para_pilot')) then { + _unit setVariable [QGVAR(hasReserve),[false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))]; + }; + }; \ No newline at end of file From c0afd9f10201feae7b02e818f2ee888c9859a11f Mon Sep 17 00:00:00 2001 From: Joko Date: Sat, 23 May 2015 23:50:38 +0200 Subject: [PATCH 15/18] player -> ACE_player --- addons/parachute/functions/fnc_storeParachute.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index f469384722..8c50124c33 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -18,7 +18,7 @@ private ["_unit","_backpack"]; _unit = _this select 0; _backpack = (_this select 1) select 6 ; - if ((vehicle _unit) isKindOf "ParachuteBase" && backpack player == "" && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) then { + if ((vehicle _unit) isKindOf "ParachuteBase" && backpack ACE_player == "" && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) then { _unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); } else { if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then { From 1f5f5a2dcf5babbaaa066b959905e32f466b07ec Mon Sep 17 00:00:00 2001 From: Joko Date: Sat, 23 May 2015 23:50:38 +0200 Subject: [PATCH 16/18] ACE_player -> _unit --- addons/parachute/functions/fnc_storeParachute.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index f469384722..45889b05b6 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -18,7 +18,7 @@ private ["_unit","_backpack"]; _unit = _this select 0; _backpack = (_this select 1) select 6 ; - if ((vehicle _unit) isKindOf "ParachuteBase" && backpack player == "" && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) then { + if ((vehicle _unit) isKindOf "ParachuteBase" && backpack _unit == "" && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) then { _unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); } else { if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then { From e0722452b7d6a2f038652feb97fecb24edff0a08 Mon Sep 17 00:00:00 2001 From: Joko Date: Mon, 25 May 2015 01:09:28 +0200 Subject: [PATCH 17/18] add Compatibilty to mods where the Animation are not "para_pilot" --- addons/parachute/functions/fnc_checkCutParachute.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/parachute/functions/fnc_checkCutParachute.sqf b/addons/parachute/functions/fnc_checkCutParachute.sqf index 9d804b7f5f..8301007fa3 100644 --- a/addons/parachute/functions/fnc_checkCutParachute.sqf +++ b/addons/parachute/functions/fnc_checkCutParachute.sqf @@ -16,4 +16,4 @@ #include "script_component.hpp" private["_unit"]; _unit = _this select 0; -(animationState _unit == 'para_pilot' && !(_unit getvariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) \ No newline at end of file +(vehicle _unit isKindOf 'ParachuteBase' && !(_unit getvariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) \ No newline at end of file From 30111b4f1596e7ae78b53f19c6e76474c2874c77 Mon Sep 17 00:00:00 2001 From: Joko Date: Wed, 1 Jul 2015 03:03:51 +0200 Subject: [PATCH 18/18] Fix Merge Problems Use CString Macro --- addons/parachute/CfgVehicles.hpp | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index bc5ecbd60f..43bf3ecc8d 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -12,9 +12,35 @@ class CfgVehicles { backpack = "ACE_NonSteerableParachute"; count = 4; }; + class _xx_ACE_ReserveParachute { + backpack = "ACE_ReserveParachute"; + count = 4; + }; }; }; + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_CutParachute { + displayName = CSTRING("CutParachute"); + exceptions[] = {"isNotInside"}; + condition = QUOTE([_player] call FUNC(checkCutParachute)); + statement = QUOTE([_player] call FUNC(cutParachute)); + showDisabled = 0; + priority = 2.9; + icon = QUOTE(PATHTOF(UI\cut_ca.paa)); + hotkey = "C"; // Did this realy Work? + }; + }; + }; + + class Helicopter; + class ParachuteBase: Helicopter { + ace_hasReserveParachute = 1; + ace_reserveParachute = "ACE_ReserveParachute"; + }; + class B_Parachute; class ACE_NonSteerableParachute: B_Parachute { author = ECSTRING(common,ACETeam); @@ -28,6 +54,16 @@ class CfgVehicles { mass = 100; }; + class ACE_ReserveParachute: ACE_NonSteerableParachute { + author = ECSTRING(common,ACETeam); + displayName = CSTRING(ReserveParachute); + scope = 2; + mass = 70; + ParachuteClass = "NonSteerable_Parachute_F"; + ace_reserveParachute = ""; + ace_hasReserveParachute = 0; + }; + class B_Soldier_05_f; class B_Pilot_F: B_Soldier_05_f {backpack = "ACE_NonSteerableParachute";}; class I_Soldier_04_F; class I_pilot_F: I_Soldier_04_F {backpack = "ACE_NonSteerableParachute";}; class O_helipilot_F; class O_Pilot_F: O_helipilot_F {backpack = "ACE_NonSteerableParachute";};