Skip to content

Commit

Permalink
Merge pull request #3 from nodrog1061/Dev
Browse files Browse the repository at this point in the history
Dev Merge to stable to fix #1 #2
  • Loading branch information
nodrog1061 authored Feb 22, 2021
2 parents f1b1b93 + 474c764 commit 2331c0f
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 33 deletions.
Binary file not shown.
68 changes: 39 additions & 29 deletions @Marshall_Ace3_Tandem_mod/addons/SM_tandem_jumping/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class CfgFunctions
class freeFall{};
//class remoteFreeFall{};
class aiSp{};
class canOrDoSelfDetach{};
};
};
};
Expand All @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
diag_log "Tandem Mod Loaded";
diag_log "By Armed Excellence Software";
player setVariable ["attached",false];
player setVariable ["tandem_freeFall",true];
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
};
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -17,6 +18,7 @@

_player = param[0,objNull];
_target = param[1,objNull];
_state = param[2,false];

_player removeItem "SM_Harness";

Expand Down Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
};
};
Expand Down

0 comments on commit 2331c0f

Please sign in to comment.