Jump to content
duda123

Advanced Rappelling

Recommended Posts

Hey I've been poking around coding and with some help I have managed to create a bit of code that creates an array of all of the cargo + FFV seats (no they are not the same, FFV seats are considered turrets in most vehicles).

I would love to see the Advanced Rappelling get and action "Rappel All units from cargo". So player can be the pilot and rappel AI squads and such, its one thing I really miss from the addon.
 

_crewCargoAndFFV = fullCrew [_VEHICLE_YOU_WANT_TO_RAPPEL_UNITS_FROM, "", false] select {_x select 1 == "cargo" || _x select 4} apply {_x select 0};

Then you just need "forEach _crewCargoAndFFV" to go through each unit in the array. Tested true in my unload waypoint script.

Share this post


Link to post
Share on other sites

My unit is experiencing som trouble with this mod.
We tried on several helicopters. When the team is either using "rappel self" or pilot uses "deploy ropes" the first guy on the ropes usually gets down fine. The others get out on the rope at then falls down to the ground, like they get stuck. Anyone else know of this issue? 
 

Share this post


Link to post
Share on other sites
On 1/8/2018 at 3:07 PM, taro8 said:

Hey I've been poking around coding and with some help I have managed to create a bit of code that creates an array of all of the cargo + FFV seats (no they are not the same, FFV seats are considered turrets in most vehicles).

I would love to see the Advanced Rappelling get and action "Rappel All units from cargo". So player can be the pilot and rappel AI squads and such, its one thing I really miss from the addon.
 


_crewCargoAndFFV = fullCrew [_VEHICLE_YOU_WANT_TO_RAPPEL_UNITS_FROM, "", false] select {_x select 1 == "cargo" || _x select 4} apply {_x select 0};

Then you just need "forEach _crewCargoAndFFV" to go through each unit in the array. Tested true in my unload waypoint script.

 

 

Formatting got all messed up, but give this a try. Stick it in your init.sqf.

 

(Haven't tested the code yet)

AR_Rappel_All_Cargo_Now = {
	params ["_vehicle"];
	if(!local _vehicle) exitWith { [_this,"AR_Rappel_All_Cargo_Now",_vehicle] call AR_RemoteExec };
	private _cargoCrew = (fullCrew _vehicle) select {(_x select 1 == "cargo" || _x select 4) && alive _x};
	private _rappelUnits = _cargoCrew apply {_x select 0};
  private _unitsOutsideVehicle = [];
  while { count _unitsOutsideVehicle != count _rappelUnits } do { 	
		{
      [_x, _vehicle] call AR_Rappel_From_Heli;					
      sleep 1;
    } forEach (_rappelUnits-_unitsOutsideVehicle);
    {
      if!(_x in _vehicle) then {
        _unitsOutsideVehicle pushBack _x;
      };
    } forEach (_rappelUnits-_unitsOutsideVehicle);
    sleep 2;
  };
};

AR_Rappel_Cargo_From_Heli_Action_Check = {
	params ["_player"];
  private _vehicle = vehicle _player;
  if(_vehicle == _player) exitWith {false}; 
  if(driver _vehicle != _player) exitWith {false}; 
	private _cargoCrew = (fullCrew _vehicle) select {(_x select 1 == "cargo" || _x select 4) && alive _x};
	private _rappelUnits = _cargoCrew apply {_x select 0};
	_canRappelOne = false;
	{
    if([_x, _vehicle] call AR_Rappel_From_Heli_Action_Check) exitWith {
      _canRappelOne = true;
    };
  } forEach _rappelUnits;
	_canRappelOne;
};

if(!isDedicated) then {
	[] spawn {
		while {true} do {
			if(!isNull player && isPlayer player) then {
				if!(player getVariable ["AR_Rappel_Cargo_Loaded",false] ) then {

          _player addAction ["Rappel All Cargo", { 
            [vehicle player] call AR_Rappel_All_Cargo_Now;
          }, nil, 0, false, true, "", "[player] call AR_Rappel_Cargo_From_Heli_Action_Check"];

          _player addEventHandler ["Respawn", {
            player setVariable ["AR_Rappel_Cargo_Loaded",false];
          }];
          
					player setVariable ["AR_Rappel_Cargo_Loaded",true];
          
				};
			};
			sleep 5;
		};
	};
};

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
23 hours ago, duda123 said:

 

 

Formatting got all messed up, but give this a try. Stick it in your init.sqf.

 

(Haven't tested the code yet)


AR_Rappel_All_Cargo_Now = {
	params ["_vehicle"];
	if(!local _vehicle) exitWith { [_this,"AR_Rappel_All_Cargo_Now",_vehicle] call AR_RemoteExec };
	private _cargoCrew = (fullCrew _vehicle) select {(_x select 1 == "cargo" || _x select 4) && alive _x};
	private _rappelUnits = _cargoCrew apply {_x select 0};
  private _unitsOutsideVehicle = [];
  while { count _unitsOutsideVehicle != count _rappelUnits } do { 	
		{
      [_x, _vehicle] call AR_Rappel_From_Heli;					
      sleep 1;
    } forEach (_rappelUnits-_unitsOutsideVehicle);
    {
      if!(_x in _vehicle) then {
        _unitsOutsideVehicle pushBack _x;
      };
    } forEach (_rappelUnits-_unitsOutsideVehicle);
    sleep 2;
  };
};

AR_Rappel_Cargo_From_Heli_Action_Check = {
	params ["_player"];
  private _vehicle = vehicle _player;
  if(_vehicle == _player) exitWith {false}; 
  if(driver _vehicle != _player) exitWith {false}; 
	private _cargoCrew = (fullCrew _vehicle) select {(_x select 1 == "cargo" || _x select 4) && alive _x};
	private _rappelUnits = _cargoCrew apply {_x select 0};
	_canRappelOne = false;
	{
    if([_x, _vehicle] call AR_Rappel_From_Heli_Action_Check) exitWith {
      _canRappelOne = true;
    };
  } forEach _rappelUnits;
	_canRappelOne;
};

if(!isDedicated) then {
	[] spawn {
		while {true} do {
			if(!isNull player && isPlayer player) then {
				if!(player getVariable ["AR_Rappel_Cargo_Loaded",false] ) then {

          _player addAction ["Rappel All Cargo", { 
            [vehicle player] call AR_Rappel_All_Cargo_Now;
          }, nil, 0, false, true, "", "[player] call AR_Rappel_Cargo_From_Heli_Action_Check"];

          _player addEventHandler ["Respawn", {
            player setVariable ["AR_Rappel_Cargo_Loaded",false];
          }];
          
					player setVariable ["AR_Rappel_Cargo_Loaded",true];
          
				};
			};
			sleep 5;
		};
	};
};

 


Hey guys!

Has any one else implemented this code or tested it for Duda? I have tried to use it in SP, Local host and dedicated box environments, and haven't been able to get the scroll wheel option to show up, and I am not sure if I am just missing something or doing something wrong, as I see a few people liked the post.

Share this post


Link to post
Share on other sites

We are having an issue right now with both Adv Rappelling and Urban we believe is related to use in conjunction with Enhanced Movement.

 

When using on a wall, using the sprint key breaks the rope.   When using on a wall or out of a helicopter, when someone else appears to 'clip' you, your rope breaks.  Lovely mod tho!

  • Thanks 1

Share this post


Link to post
Share on other sites

I am consistently getting an error that I have not been able to reproduce under similar, or any, circumstances. Three errors in the .rpt to be exact with the second one repeating as I'm on the rope:

 

_bottomRope

13:24:06 Error in expression <evice, [-0.15,0,0], _bottomRopeLength];_bottomRope allowDamage false;_topRopeL>
13:24:06   Error position: <_bottomRope allowDamage false;_topRopeL>
13:24:06   Error Undefined variable in expression: _bottomrope
13:24:06 File \AR_AdvancedRappelling\functions\fn_advancedRappellingInit.sqf [SA_fnc_advancedRappellingInit], line 382

 

_topRope (shows an error the entire time I'm on the rope)

13:24:07 Error in expression <ecendSpeedMetersPerSecond);ropeUnwind [_topRope, _decendSpeedMetersPerSecond, _>
13:24:07   Error position: <_topRope, _decendSpeedMetersPerSecond, _>
13:24:07   Error Undefined variable in expression: _toprope
13:24:07 File \AR_AdvancedRappelling\functions\fn_advancedRappellingInit.sqf [SA_fnc_advancedRappellingInit], line 495

_topRope (after getting off the rope)

13:52:26 Error in expression <r allowDamage true;};};ropeDestroy _topRope;ropeDestroy _bottomRope;del>
13:52:26   Error position: <_topRope;ropeDestroy _bottomRope;del>
13:52:26   Error Undefined variable in expression: _toprope
13:52:26 File \AR_AdvancedRappelling\functions\fn_advancedRappellingInit.sqf [SA_fnc_advancedRappellingInit], line 573

 

This doesn't occur in SP, but does in hosted MP (unsure on dedi). The mission starts with:

AR_DISABLE_SHOOTING_OVERRIDE = true;

AR_SUPPORTED_VEHICLES_OVERRIDE = [];

The helicopter being rappelled from has just come out of a BIS_fnc_unitPlay and is positioned about 10m above a Concrete Block, then:

AR_SUPPORTED_VEHICLES_OVERRIDE = ["B_Heli_Light_01_F"];
publicVariable "AR_SUPPORTED_VEHICLES_OVERRIDE";

is run to allow players to rappel. No other variables are being changed and the rappelling is all done by mouse wheel. This occurs for both host and connected clients.

 

I'm sorry I can't provide more details, and it seems like it is a once-off thing after doing all I could think of to reproduce it. Has anyone else come across this?

Share this post


Link to post
Share on other sites

After doing a lot of testing there is a conflict between 2 great mods, advanced rappelling and enhanced movement. Does anyone have a fix for this.

  • Sad 2

Share this post


Link to post
Share on other sites

Has anyone ever thought of reverse engineering this scrips so that the heli can hover and deploy a single rope, which then adds an add action to the player group to extract by rope ladder/SABO rig?

Share this post


Link to post
Share on other sites
AR_Rappel_All_Cargo_Now = {
	params ["_vehicle"];
	if(!local _vehicle) exitWith { [_this,"AR_Rappel_All_Cargo_Now",_vehicle] call AR_RemoteExec };
	private _cargoCrew = (fullCrew _vehicle) select {(_x select 1 == "cargo" || _x select 4) && alive player};
	private _rappelUnits = _cargoCrew apply {_x select 0};
  private _unitsOutsideVehicle = [];
  while { count _unitsOutsideVehicle != count _rappelUnits } do { 	
		{
      [_x, _vehicle] call AR_Rappel_From_Heli;					
      sleep 1;
    } forEach (_rappelUnits-_unitsOutsideVehicle);
    {
      if!(_x in _vehicle) then {
        _unitsOutsideVehicle pushBack _x;
      };
    } forEach (_rappelUnits-_unitsOutsideVehicle);
    sleep 2;
  };
};

AR_Rappel_Cargo_From_Heli_Action_Check = {
	params ["_player"];
  private _vehicle = vehicle _player;
  if(_vehicle == _player) exitWith {false}; 
  if(driver _vehicle != _player) exitWith {false}; 
	private _cargoCrew = (fullCrew _vehicle) select {(_x select 1 == "cargo" || _x select 4) && alive player};
	private _rappelUnits = _cargoCrew apply {_x select 0};
	_canRappelOne = false;
	{
    if([_x, _vehicle] call AR_Rappel_From_Heli_Action_Check) exitWith {
      _canRappelOne = true;
    };
  } forEach _rappelUnits;
	_canRappelOne;
};

if(!isDedicated) then {
	[] spawn {
		while {true} do {
			if(!isNull player && isPlayer player) then {
				if!(player getVariable ["AR_Rappel_Cargo_Loaded",false] ) then {

          player addAction ["Rappel All Cargo", { 
            [vehicle player] call AR_Rappel_All_Cargo_Now;
          }, nil, 0, false, true, "", "[player] call AR_Rappel_Cargo_From_Heli_Action_Check"];

          player addEventHandler ["Respawn", {
            player setVariable ["AR_Rappel_Cargo_Loaded",false];
          }];
          
					player setVariable ["AR_Rappel_Cargo_Loaded",true];
          
				};
			};
			sleep 5;
		};
	};
};
On 2/22/2018 at 6:43 PM, LeClair said:


Hey guys!

Has any one else implemented this code or tested it for Duda? I have tried to use it in SP, Local host and dedicated box environments, and haven't been able to get the scroll wheel option to show up, and I am not sure if I am just missing something or doing something wrong, as I see a few people liked the post.

 

Seems like there were a few errors in @duda123 post. I did a quick and dirty fix just to get rid of the exceptions. It works in SP, however because I made these changes without knowing what I'm doing I could be introducing other problems. I'll see if I can properly fix it later. 

 

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×