From 053f34fe1d38728c8bad71cdffdb94ee665cb071 Mon Sep 17 00:00:00 2001 From: nodrog1061 <59317189+nodrog1061@users.noreply.github.com> Date: Sun, 21 Feb 2021 20:07:29 +0000 Subject: [PATCH 1/2] Fix For Bug #2 --- .../addons/SM_tandem_jumping/functions/fn_addonInit.sqf | 1 - .../addons/SM_tandem_jumping/functions/fn_canAttach.sqf | 2 +- .../addons/SM_tandem_jumping/functions/fn_groundAttach.sqf | 5 +++++ .../addons/SM_tandem_jumping/functions/fn_groundDetach.sqf | 2 +- .../addons/SM_tandem_jumping/functions/fn_hotFix.sqf | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_addonInit.sqf b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_addonInit.sqf index 0ac319e..dfc484f 100644 --- a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_addonInit.sqf +++ b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_addonInit.sqf @@ -1,4 +1,3 @@ diag_log "Tandem Mod Loaded"; diag_log "By Armed Excellence Software"; player setVariable ["attached",false]; -player setVariable ["tandem_freeFall",true]; diff --git a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_canAttach.sqf b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_canAttach.sqf index 951d846..37d4929 100644 --- a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_canAttach.sqf +++ b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_canAttach.sqf @@ -1,7 +1,7 @@ /* * Author: Scott Marshall * checks if the player has a tandem harness, isnt attached, has a para as a backpack and returns it requred for ace - * also used as a template for other checks + * also used as a template for other checks (I stole it from my old mod thats why its says blindfold) * * Arguments: * player (object) diff --git a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundAttach.sqf b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundAttach.sqf index 7d5f463..dc00f15 100644 --- a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundAttach.sqf +++ b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundAttach.sqf @@ -6,6 +6,7 @@ * Arguments: * player (object) * target (object) + * state (bool) [false == ground activation true == from vehicle activation] just skips assigment of varibles FROM V4.50 * via [_player,_target] call SM_tandem_jumping_fnc_groundAttach * * Return Value: @@ -17,6 +18,7 @@ _player = param[0,objNull]; _target = param[1,objNull]; +_state = param[3,false]; _player removeItem "SM_Harness"; @@ -55,8 +57,11 @@ if(!(isPlayer _target))then{ player setVariable ["attached",true]; player setVariable ["tandem_inVehicle",false]; +if(!(_state))then{ player setVariable ["tandem_player",_player]; player setVariable ["tandem_target",_target]; +}; + []spawn{waitUntil { sleep 2; if((!isTouchingGround player) || ((velocity player select 2) <= -3) && !(player getVariable "tandem_inVehicle"))exitWith{true};false}; player setVariable ["freefall",true]; diff --git a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundDetach.sqf b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundDetach.sqf index 53f75c7..25df6da 100644 --- a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundDetach.sqf +++ b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundDetach.sqf @@ -16,7 +16,7 @@ _player = param[0,objNull]; _target = param[1,objNull]; -if (_target == objNull || _target =! (player getVariable "tandem_target") || isNull _target) then{ +if ((_target == objNull) || !(_target isEqualTo (player getVariable "tandem_target")) || (isNull _target)) then{ _target = player getVariable "tandem_target"; }; diff --git a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_hotFix.sqf b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_hotFix.sqf index 87390f9..34b3367 100644 --- a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_hotFix.sqf +++ b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_hotFix.sqf @@ -24,7 +24,7 @@ player addEventHandler ["GetOutMan", { if(((typeOf _vehicle) == "Steerable_Parachute_F") || ((typeOf _vehicle) == "NonSteerable_Parachute_F"))then{ []spawn{ sleep 5; - player setVariable ["attached",false]; + [player getVariable "tandem_player",player getVariable "tandem_target"] call SM_tandem_jumping_fnc_groundDetach; }; }; }; From 474c764b5b4d7f22af206b3064646b63d16194bb Mon Sep 17 00:00:00 2001 From: nodrog1061 <59317189+nodrog1061@users.noreply.github.com> Date: Mon, 22 Feb 2021 17:46:39 +0000 Subject: [PATCH 2/2] fix for #1 --- .../addons/SM_tandem_jumping.pbo.TFM.bisign | Bin 556 -> 0 bytes .../addons/SM_tandem_jumping/config.cpp | 68 ++++++++++-------- .../functions/fn_canOrDoSelfDetach.sqf | 39 ++++++++++ .../functions/fn_groundAttach.sqf | 2 +- 4 files changed, 79 insertions(+), 30 deletions(-) delete mode 100644 @Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping.pbo.TFM.bisign create mode 100644 @Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_canOrDoSelfDetach.sqf diff --git a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping.pbo.TFM.bisign b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping.pbo.TFM.bisign deleted file mode 100644 index 1c621d2a4381b907e1d62940538ca9084e4d4d2a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 556 zcmV+{0@M9eMoj>e000060ssI2Bme+XQ$aBR1ONa50097{0PjF&cT%8Jo$L|>$A@g8 zAf;r~KQB%Ga{-#jjTf@p;G3wGxt)QQBt`{;*vc!>LXd0e?=FuYj?!O*bHTf#G5N?^ ze&41aIkB!jW(9BvZn@*zWX}tlju33WWqN z;!nX8fsxvP0002z+PQhFJ#-48D}NA)F)*VQXKCo70%p_U=mPC9!f1Ra{r1tHBvtzX{@d4E zWm*M$<<$p4w~Wh1s;PAIYuOJ5Hm#M{*<)76^xv%Fw@E zE2jTpB(JBN``<7?&#W_m0001{Y}pX1=g3(8(iF&|`#s)Ld3(2|DP{S$)Os~+d&oa=C(zfX!t8|Gz(0gXPdC;eNmP^umKH%r_FyV1|k{{>P2 diff --git a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/config.cpp b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/config.cpp index 1eef951..ac2fe9d 100644 --- a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/config.cpp +++ b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/config.cpp @@ -28,6 +28,7 @@ class CfgFunctions class freeFall{}; //class remoteFreeFall{}; class aiSp{}; + class canOrDoSelfDetach{}; }; }; }; @@ -36,37 +37,46 @@ class CfgVehicles{ class Man; class CAManBase: Man { class ACE_Actions{ - class ACE_MainActions{ - class SM_clipIntoHarness{ - displayName="Clip into Harness"; - condition="[_player,_target] call SM_tandem_jumping_fnc_canGroundAttach"; - statement="[_player,_target] call SM_tandem_jumping_fnc_groundAttach"; - showDisabled=0; - priority=1; - distance=2; - exceptions[] = {"isNotSwimming","isNotInside","isNotSitting","isNotOnLadder","isNotRefueling"}; - }; - class SM_unClipHarness{ - displayName="Remove Clip"; - condition="[_player,_target] call SM_tandem_jumping_fnc_canDetach"; - statement="[_player,_target] call SM_tandem_jumping_fnc_groundDetach"; - exceptions[] = {"isNotSwimming","isNotInside","isNotSitting","isNotOnLadder","isNotRefueling"}; - showDisabled=0; - priority=1; - distance=2; - }; - class SM_ejectWithHarness{ - displayName="Eject with Harnes"; - condition="[_player,_target] call SM_tandem_jumping_fnc_canAirEject"; - statement="[_player,_target] call SM_tandem_jumping_fnc_airEject"; - exceptions[] = {"isNotSwimming","isNotSitting","isNotOnLadder","isNotRefueling"}; - showDisabled=0; - priority=1; - distance=2; - }; - }; + class ACE_MainActions{ + class SM_clipIntoHarness{ + displayName="Clip into Harness"; + condition="[_player,_target] call SM_tandem_jumping_fnc_canGroundAttach"; + statement="[_player,_target] call SM_tandem_jumping_fnc_groundAttach"; + showDisabled=0; + priority=1; + distance=2; + exceptions[] = {"isNotSwimming","isNotInside","isNotSitting","isNotOnLadder","isNotRefueling"}; + }; + class SM_unClipHarness{ + displayName="Remove Clip"; + condition="[_player,_target] call SM_tandem_jumping_fnc_canDetach"; + statement="[_player,_target] call SM_tandem_jumping_fnc_groundDetach"; + exceptions[] = {"isNotSwimming","isNotInside","isNotSitting","isNotOnLadder","isNotRefueling"}; + showDisabled=0; + priority=1; + distance=2; + }; + class SM_ejectWithHarness{ + displayName="Eject with Harnes"; + condition="[_player,_target] call SM_tandem_jumping_fnc_canAirEject"; + statement="[_player,_target] call SM_tandem_jumping_fnc_airEject"; + exceptions[] = {"isNotSwimming","isNotSitting","isNotOnLadder","isNotRefueling"}; + showDisabled=0; + priority=1; + distance=2; + }; }; }; + class ACE_SelfActions { + class SM_unClipHarnessSelf{ + displayName="Unclip Partner"; + condition="[true] call SM_tandem_jumping_fnc_canOrDoSelfDetach"; + statement="[false] call SM_tandem_jumping_fnc_canOrDoSelfDetach"; + exceptions[] = {"isNotSwimming","isNotInside","isNotSitting","isNotOnLadder","isNotRefueling"}; + showDisabled=0; + }; + }; + }; }; class CfgWeapons { diff --git a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_canOrDoSelfDetach.sqf b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_canOrDoSelfDetach.sqf new file mode 100644 index 0000000..3c528e5 --- /dev/null +++ b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_canOrDoSelfDetach.sqf @@ -0,0 +1,39 @@ +/* + * Author: Scott Marshall + * using a if statment script works as a juction box for scripts this is for the self intearct as the getVariable call wont work in in a config so replys false unless the mod has been initalised by the game + * (handles statment and condition for uncliup self interact) + * + * Arguments: + * state (bool) + * + * Return Value: + * Alowed? (bool) + * + * + * Public: Yes + */ + +_state = param[0]; + + +scopeName "main"; +//check if game is acc loaded +if(!isNull player && time > 0)then{ + // true == can? + if(_state)then{ + if([player getVariable "tandem_player",player getVariable "tandem_target"] call SM_tandem_jumping_fnc_canDetach)then{ + true breakOut "main" + }else{ + false breakOut "main" + }; + }; + //false == call the acc ground detach + if(!(_state))then{ + [player getVariable "tandem_player",player getVariable "tandem_target"] call SM_tandem_jumping_fnc_groundDetach; + }; + + false breakOut "main" + +}else{ + false breakOut "main" +}; diff --git a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundAttach.sqf b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundAttach.sqf index dc00f15..427d33d 100644 --- a/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundAttach.sqf +++ b/@Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/functions/fn_groundAttach.sqf @@ -18,7 +18,7 @@ _player = param[0,objNull]; _target = param[1,objNull]; -_state = param[3,false]; +_state = param[2,false]; _player removeItem "SM_Harness";