Jump to content
zealot111

Helicopter fastrope script

Recommended Posts

Anyone have a working edit of ZLT_fastrope that cooperates with Bad Bensons Enhanced movement?

 

The death bug after you hit the ground is a known issue with EM.  BB said he was working on a fix.  Sadly it appears the forum trolls have driven away yet another contributor as he has locked his thread and no longer appears to be developing his excellent EM mod.

 

Maybe there is a way to wok it out through editing ZLT_fastrope.

Share this post


Link to post
Share on other sites

Is sombody still working on this mod??

 

I am looking for a script to use with deltagamers chinook packet

Share this post


Link to post
Share on other sites

Does anyone have an updated repository of coordinates for non Vanilla Choppers?  I saw bits and pieces in here of some but didn't know if all of the Russian RHS, Massi Choppers, and 3CB Merlin, etc. coordinates were discovered.

 

It would be a big help if anyone had any of these.  This is a great script.

Share this post


Link to post
Share on other sites

Here you go:
 
RHS

// v1g Fast Rope by [STELS]Zealot

#define MAX_SPEED_WHILE_FASTROPING 10
#define MAX_SPEED_ROPES_AVAIL 30


#define STR_TOSS_ROPES "Toss Ropes"
#define STR_FAST_ROPE "Fast Rope"
#define STR_CUT_ROPES "Cut Ropes"


if (isdedicated) exitwith {};
waituntil {player == player};

zlt_rope_ropes = [];
zlt_mutexAction = false;

zlt_rope_helis = ["RHS_UH60M", "RHS_UH60M_d", "RHS_UH60M_MEV2_d", "RHS_UH60M_MEV2", "RHS_UH60M_MEV_d", "RHS_UH60M_MEV", "RHS_CH_47F_light", "RHS_CH_47F_10", "RHS_CH_47F", "B_Heli_Light_01_F"];
zlt_rope_helidata = 
[
	[
		["RHS_UH60M", "RHS_UH60M_d", "RHS_UH60M_MEV2_d", "RHS_UH60M_MEV2", "RHS_UH60M_MEV_d", "RHS_UH60M_MEV"],
		[1.35,1.98,-25.4],
		[]
	],
	[
		["RHS_CH_47F_light", "RHS_CH_47F_10", "RHS_CH_47F"],
		[0,-0.4,-25.5],
		[]
	],	
	[
		["B_Heli_Light_01_F"],
		[1.0,1.4,-25.45],
		[-1.17,1.4,-25.45]
	]
];


zlt_fnc_tossropes = {
	private ["_heli","_ropes","_oropes","_rope"];
	_heli = _this;
	_ropes = [];
	_oropes = _heli getvariable ["zlt_ropes",[]];
	if (count _oropes != 0 ) exitwith {};
	_i = 0;
	{
		if ((typeof _heli) in (_x select 0)) exitwith {
			_ropes = _ropes + [_x select 1];
			if ( count (_x select 2) !=0 ) then { 
				_ropes = _ropes + [_x select 2];
			};
		};
		_i = _i +1;
	} foreach zlt_rope_helidata;
	
	sleep random 0.3;
	if ( count (_heli getvariable ["zlt_ropes",[]]) != 0 ) exitwith { zlt_mutexAction = false; };
	_heli animateDoor ['door_R', 1];
	_heli animateDoor ['door_L', 1];
	{
		_rope = createVehicle ["land_rope_f", [0,0,0], [], 0, "CAN_COLLIDE"];
		_rope setdir (getdir _heli);
		_rope attachto [_heli, _x];
		_oropes = _oropes + [_rope];
	} foreach _ropes;
	_heli setvariable ["zlt_ropes",_oropes,true];
	
	_heli spawn {
		private ["_heli","_ropes"];
		_heli = _this;
		while {alive _heli and count (_heli getvariable ["zlt_ropes", []]) != 0 and abs (speed _heli) < MAX_SPEED_ROPES_AVAIL } do {
			sleep 0.3;
		};
		_ropes = (_heli getvariable ["zlt_ropes", []]);
		{deletevehicle _x} foreach _ropes;
		_heli setvariable ["zlt_ropes", [], true];
	};

};

zlt_fnc_ropes_cond = {
	_veh = vehicle player;
	_flag = (_veh != player) and {(not zlt_mutexAction)} and {count (_veh getvariable ["zlt_ropes", []]) == 0} and { (typeof _veh) in zlt_rope_helis } and {alive player and alive _veh and (abs (speed _veh) < MAX_SPEED_ROPES_AVAIL ) };
	_flag;

};

zlt_fnc_fastropeaiunits = {
		private ["_heli","_grunits"];
		diag_log ["zlt_fnc_fastropeaiunits", _this];
		_heli = _this select 0;
		_grunits = _this select 1;

		dostop (driver _heli );
		(driver _heli) setBehaviour "Careless"; 
		(driver _heli) setCombatMode "Blue"; 
		
		_heli spawn zlt_fnc_tossropes;

		[_heli, _grunits] spawn {
			private ["_units","_heli"];
			sleep random 0.5;
			_units = _this select 1;
			_heli = (_this select 0);
			_units = _units - [player];
			_units = _units - [driver _heli];
			{if (!alive _x or isplayer _x or vehicle _x != _heli) then {_units = _units - [_x];}; } foreach _units;
						
			{ sleep (0.5 + random 0.7); _x spawn zlt_fnc_fastropeUnit; } foreach _units;
			waituntil {sleep 0.5; { (getpos _x select 2) < 1 } count _units == count _units; };
			sleep 10;
			(driver _heli) doFollow (leader group (driver _heli ));
			(driver _heli) setBehaviour "Aware"; 
			(driver _heli) setCombatMode "White"; 
			_heli call zlt_fnc_cutropes;
			
		};
};


zlt_fnc_fastrope = {
	diag_log ["fastrope", _this];
	zlt_mutexAction = true;
	sleep random 0.3;
	if (player == leader group player) then {
		[vehicle player, units group player] call zlt_fnc_fastropeaiunits;
	};
	player call zlt_fnc_fastropeUnit;
	zlt_mutexAction = false;
};

zlt_fnc_fastropeUnit = {
	private ["_unit","_heli","_ropes","_rope","_zmax","_zdelta","_zc"];
	_unit = _this;
	_heli = vehicle _unit;
	if (_unit == _heli) exitWith {};

	_ropes = (_heli getvariable ["zlt_ropes", []]);
	if (count _ropes == 0) exitwith {};
	
	_rope = _ropes call BIS_fnc_selectRandom;
	_zmax = 22;
	_zdelta = 7 / 10  ;
	
	_zc = _zmax;
	unassignvehicle _unit;
	_unit action ["eject", _heli];
	_unit switchmove "gunner_standup01";
	
	_unit setpos [(getpos _unit select 0), (getpos _unit select 1), 0 max ((getpos _unit select 2) - 3)];
	while {alive _unit and (getpos _unit select 2) > 1 and (abs (speed _heli)) < MAX_SPEED_WHILE_FASTROPING  and _zc > -24} do {
		_unit attachTo [_rope, [0,0,_zc]];
		_zc = _zc - _zdelta;
		sleep 0.1;
	};
	_unit switchmove "";
	detach _unit;

};


zlt_fnc_cutropes = {
	_veh = _this;
	_ropes = (_veh getvariable ["zlt_ropes", []]);
	{deletevehicle _x} foreach _ropes;
	_veh setvariable ["zlt_ropes", [], true];
	_veh animateDoor ['door_R', 0];
	_veh animateDoor ['door_L', 0];

};

zlt_fnc_removeropes = {
	(vehicle player) call zlt_fnc_cutropes;
};

zlt_fnc_createropes = {
	zlt_mutexAction = true;
	(vehicle player) call zlt_fnc_tossropes;
	zlt_mutexAction = false;
};



player createDiarySubject [STR_SCRIPTS_NAME,STR_SCRIPTS_NAME];
player createDiaryRecord [STR_SCRIPTS_NAME,[STR_SCRIPT_NAME, STR_HELP]];

player addAction["<t color='#ffff00'>"+STR_TOSS_ROPES+"</t>", zlt_fnc_createropes, [], -1, false, false, '','[] call zlt_fnc_ropes_cond'];
player addAction["<t color='#ff0000'>"+STR_CUT_ROPES+"</t>", zlt_fnc_removeropes, [], -1, false, false, '','not zlt_mutexAction and count ((vehicle player) getvariable ["zlt_ropes", []]) != 0'];
player addAction["<t color='#00ff00'>"+STR_FAST_ROPE+"</t>", zlt_fnc_fastrope, [], 15, false, false, '','not zlt_mutexAction and count ((vehicle player) getvariable ["zlt_ropes", []]) != 0 and player != driver vehicle player'];

player addEventHandler ["Respawn", {
	player addAction["<t color='#ffff00'>"+STR_TOSS_ROPES+"</t>", zlt_fnc_createropes, [], -1, false, false, '','[] call zlt_fnc_ropes_cond'];
	player addAction["<t color='#ff0000'>"+STR_CUT_ROPES+"</t>", zlt_fnc_removeropes, [], -1, false, false, '','not zlt_mutexAction and count ((vehicle player) getvariable ["zlt_ropes", []]) != 0'];
	player addAction["<t color='#00ff00'>"+STR_FAST_ROPE+"</t>", zlt_fnc_fastrope, [], 15, false, false, '','not zlt_mutexAction and count ((vehicle player) getvariable ["zlt_ropes", []]) != 0 and player != driver vehicle player'];
}];

MASSI

// v1g Fast Rope by [STELS]Zealot

#define MAX_SPEED_WHILE_FASTROPING 10
#define MAX_SPEED_ROPES_AVAIL 30


#define STR_TOSS_ROPES "Toss Ropes"
#define STR_FAST_ROPE "Fast Rope"
#define STR_CUT_ROPES "Cut Ropes"


if (isdedicated) exitwith {};
waituntil {player == player};

zlt_rope_ropes = [];
zlt_mutexAction = false;

zlt_rope_helis = ["B_mas_CH_47F","B_mas_UH1Y_F","B_mas_UH1Y_MEV_F","B_mas_UH1Y_UNA_F","B_mas_UH60M","B_mas_UH60M_SF","B_mas_mar_Heli_Light_01_F","B_mas_mar_Heli_Med_01_F","B_mas_mar_Heli_Transport_01_F","B_mas_mar_UH1Y_F","B_mas_mar_UH1Y_MEV_F","B_mas_mar_UH1Y_UNA_F","B_mas_usr_CH_47F","B_mas_usr_Heli_Light_01_F","B_mas_usr_Heli_Med_01_F","B_mas_usr_Heli_Transport_01_F","B_mas_usr_UH60M","B_mas_usr_UH60M_SF","I_mas_MI8","I_mas_MI8MTV","O_mas_MI8","O_mas_MI8MTV"];
zlt_rope_helidata = 
[
	[
		["B_mas_UH60M","B_mas_UH60M_SF","B_mas_usr_UH60M_SF","B_mas_usr_UH60M"],
		[1.35,1.98,-25.4],
		[]
	],
	[
		["B_mas_CH_47F","B_mas_usr_CH_47F"],
		[0,-0.4,-25.5],
		[]
	],	
	[
		["B_mas_mar_Heli_Light_01_F","B_mas_usr_Heli_Light_01_F"],
		[1.0,1.4,-25.45],
		[-1.17,1.4,-25.45]
	],
	[
		["B_mas_mar_Heli_Med_01_F","B_mas_mar_Heli_Transport_01_F","B_mas_usr_Heli_Med_01_F","B_mas_usr_Heli_Transport_01_F"],
		[-1.11,2.5,-24.7],
		[1.11,2.5,-24.7]
	],
	[
		["B_mas_UH1Y_F","B_mas_UH1Y_MEV_F","B_mas_UH1Y_UNA_F","B_mas_mar_UH1Y_F","B_mas_mar_UH1Y_MEV_F","B_mas_mar_UH1Y_UNA_F"],
		[-1.0,-3.55,-25.1],
		[]
	],
	[
		["I_mas_MI8","O_mas_MI8","O_mas_MI8MTV","I_mas_MI8MTV"],
		[-1.42,3.0,-26.7],
		[]
	]
];


zlt_fnc_tossropes = {
	private ["_heli","_ropes","_oropes","_rope"];
	_heli = _this;
	_ropes = [];
	_oropes = _heli getvariable ["zlt_ropes",[]];
	if (count _oropes != 0 ) exitwith {};
	_i = 0;
	{
		if ((typeof _heli) in (_x select 0)) exitwith {
			_ropes = _ropes + [_x select 1];
			if ( count (_x select 2) !=0 ) then { 
				_ropes = _ropes + [_x select 2];
			};
		};
		_i = _i +1;
	} foreach zlt_rope_helidata;
	
	sleep random 0.3;
	if ( count (_heli getvariable ["zlt_ropes",[]]) != 0 ) exitwith { zlt_mutexAction = false; };
	_heli animateDoor ['door_R', 1];
	_heli animateDoor ['door_L', 1];
	{
		_rope = createVehicle ["land_rope_f", [0,0,0], [], 0, "CAN_COLLIDE"];
		_rope setdir (getdir _heli);
		_rope attachto [_heli, _x];
		_oropes = _oropes + [_rope];
	} foreach _ropes;
	_heli setvariable ["zlt_ropes",_oropes,true];
	
	_heli spawn {
		private ["_heli","_ropes"];
		_heli = _this;
		while {alive _heli and count (_heli getvariable ["zlt_ropes", []]) != 0 and abs (speed _heli) < MAX_SPEED_ROPES_AVAIL } do {
			sleep 0.3;
		};
		_ropes = (_heli getvariable ["zlt_ropes", []]);
		{deletevehicle _x} foreach _ropes;
		_heli setvariable ["zlt_ropes", [], true];
	};

};

zlt_fnc_ropes_cond = {
	_veh = vehicle player;
	_flag = (_veh != player) and {(not zlt_mutexAction)} and {count (_veh getvariable ["zlt_ropes", []]) == 0} and { (typeof _veh) in zlt_rope_helis } and {alive player and alive _veh and (abs (speed _veh) < MAX_SPEED_ROPES_AVAIL ) };
	_flag;

};

zlt_fnc_fastropeaiunits = {
		private ["_heli","_grunits"];
		diag_log ["zlt_fnc_fastropeaiunits", _this];
		_heli = _this select 0;
		_grunits = _this select 1;

		dostop (driver _heli );
		(driver _heli) setBehaviour "Careless"; 
		(driver _heli) setCombatMode "Blue"; 
		
		_heli spawn zlt_fnc_tossropes;

		[_heli, _grunits] spawn {
			private ["_units","_heli"];
			sleep random 0.5;
			_units = _this select 1;
			_heli = (_this select 0);
			_units = _units - [player];
			_units = _units - [driver _heli];
			{if (!alive _x or isplayer _x or vehicle _x != _heli) then {_units = _units - [_x];}; } foreach _units;
						
			{ sleep (0.5 + random 0.7); _x spawn zlt_fnc_fastropeUnit; } foreach _units;
			waituntil {sleep 0.5; { (getpos _x select 2) < 1 } count _units == count _units; };
			sleep 10;
			(driver _heli) doFollow (leader group (driver _heli ));
			(driver _heli) setBehaviour "Aware"; 
			(driver _heli) setCombatMode "White"; 
			_heli call zlt_fnc_cutropes;
			
		};
};


zlt_fnc_fastrope = {
	diag_log ["fastrope", _this];
	zlt_mutexAction = true;
	sleep random 0.3;
	if (player == leader group player) then {
		[vehicle player, units group player] call zlt_fnc_fastropeaiunits;
	};
	player call zlt_fnc_fastropeUnit;
	zlt_mutexAction = false;
};

zlt_fnc_fastropeUnit = {
	private ["_unit","_heli","_ropes","_rope","_zmax","_zdelta","_zc"];
	_unit = _this;
	_heli = vehicle _unit;
	if (_unit == _heli) exitWith {};

	_ropes = (_heli getvariable ["zlt_ropes", []]);
	if (count _ropes == 0) exitwith {};
	
	_rope = _ropes call BIS_fnc_selectRandom;
	_zmax = 22;
	_zdelta = 7 / 10  ;
	
	_zc = _zmax;
	unassignvehicle _unit;
	_unit action ["eject", _heli];
	_unit switchmove "gunner_standup01";
	
	_unit setpos [(getpos _unit select 0), (getpos _unit select 1), 0 max ((getpos _unit select 2) - 3)];
	while {alive _unit and (getpos _unit select 2) > 1 and (abs (speed _heli)) < MAX_SPEED_WHILE_FASTROPING  and _zc > -24} do {
		_unit attachTo [_rope, [0,0,_zc]];
		_zc = _zc - _zdelta;
		sleep 0.1;
	};
	_unit switchmove "";
	detach _unit;

};


zlt_fnc_cutropes = {
	_veh = _this;
	_ropes = (_veh getvariable ["zlt_ropes", []]);
	{deletevehicle _x} foreach _ropes;
	_veh setvariable ["zlt_ropes", [], true];
	_veh animateDoor ['door_R', 0];
	_veh animateDoor ['door_L', 0];

};

zlt_fnc_removeropes = {
	(vehicle player) call zlt_fnc_cutropes;
};

zlt_fnc_createropes = {
	zlt_mutexAction = true;
	(vehicle player) call zlt_fnc_tossropes;
	zlt_mutexAction = false;
};



player createDiarySubject [STR_SCRIPTS_NAME,STR_SCRIPTS_NAME];
player createDiaryRecord [STR_SCRIPTS_NAME,[STR_SCRIPT_NAME, STR_HELP]];

player addAction["<t color='#ffff00'>"+STR_TOSS_ROPES+"</t>", zlt_fnc_createropes, [], -1, false, false, '','[] call zlt_fnc_ropes_cond'];
player addAction["<t color='#ff0000'>"+STR_CUT_ROPES+"</t>", zlt_fnc_removeropes, [], -1, false, false, '','not zlt_mutexAction and count ((vehicle player) getvariable ["zlt_ropes", []]) != 0'];
player addAction["<t color='#00ff00'>"+STR_FAST_ROPE+"</t>", zlt_fnc_fastrope, [], 15, false, false, '','not zlt_mutexAction and count ((vehicle player) getvariable ["zlt_ropes", []]) != 0 and player != driver vehicle player'];

player addEventHandler ["Respawn", {
	player addAction["<t color='#ffff00'>"+STR_TOSS_ROPES+"</t>", zlt_fnc_createropes, [], -1, false, false, '','[] call zlt_fnc_ropes_cond'];
	player addAction["<t color='#ff0000'>"+STR_CUT_ROPES+"</t>", zlt_fnc_removeropes, [], -1, false, false, '','not zlt_mutexAction and count ((vehicle player) getvariable ["zlt_ropes", []]) != 0'];
	player addAction["<t color='#00ff00'>"+STR_FAST_ROPE+"</t>", zlt_fnc_fastrope, [], 15, false, false, '','not zlt_mutexAction and count ((vehicle player) getvariable ["zlt_ropes", []]) != 0 and player != driver vehicle player'];
}];

Enjoy.

  • Like 1

Share this post


Link to post
Share on other sites

First, the script is great! Are there any other rope types that are not so pole like that I can switch it out land_rope_f with? It would be nice to see a more flexible rope. Not really finding anything.

 

Thanks!

dubl

Share this post


Link to post
Share on other sites

I have tweaked the script for MP to prevent cargo/passengers from deploying/cutting the ropes ...

If someone wants the tweak, let me know.

I would like to see the tweak!

 

dubl

Share this post


Link to post
Share on other sites

Zealot

 

I have a problem in multiplayer when running your script. I get a error where one of two players will teleport back into the chopper.

 

For example, 3 players are in a ghosthawk, one flying and two in the passenger seats. Passenger 1 deploys the ropes and successfully fastropes. Passenger 2 however will attempt to fastrope onto the already deployed ropes and will (from the perspective of the player on the ground) successfully fastrope. Passenger 2 will then teleport back into the chopper, back into the passenger seat.

 

I would greatly appreciate any help you could give me.

Share this post


Link to post
Share on other sites

Does anyone have an edited version of this script that includes all of the choppers from the most popular mods and also the BIS DLC? I see some stuff has been posted here piece-meal. Just curious if anyone had an all inclusive version of this.

Share this post


Link to post
Share on other sites

Disclaimer: I never used the script in this thread. However, I kind of rewrote the whole thing to include a queue system, and made the AI group members follow the human group leader once he ropes down. Example

 

I tried to add a feature to be able to FT full AI group from AI chopper, but there's some kind of deep link between the units, because even if the chopper is not in the same group, it will still land as soon as the first guy is moved outside the chopper.

 

Due to lack of time, I haven't had time to finish this. That basically means going through all the rope attachment points for all helos and adding door names. Adding custom chopper is rather simple. If the model is based on BIS, just add the name to the correct array. If it's a custom one, make a new line and tweak the attachment points.

 

If someone wants to, please, feel free to use it anyway you like.

/*
	SHK_Fastrope by Shuko (LDD Kyllikki)
	Version 1.0

	Inspired by v1g Fast Rope by [STELS]Zealot (modified by TheRick for Altis Life)
*/


#define MAX_ALTITUDE_ROPES_AVAIL 70
#define MIN_ALTITUDE_ROPES_AVAIL 5
#define MAX_SPEED_ROPES_AVAIL 50

#define STR_TOSS_ROPES "Toss Ropes"
#define STR_FAST_ROPE "Fast Rope"
#define STR_CUT_ROPES "Cut Ropes"

#define STR_JOIN_QUEUE_HINT "You're in the fast-rope queue."

// [["TypeName1","TypeName2"],["Door_L","Door_R"],[[ropeAttachPosition1],[ropeAttachPosition2]]]
SHK_Fastrope_Helis = [
	[["B_Heli_Light_01_F"],[],[[1.1,0.5,-0.5],[-1.1,0.5,-0.5]]],
	[["B_Heli_Transport_01_F","B_Heli_Transport_01_camo_F","RHS_UH60M","RHS_UH60M_d","CAF_CH146_F_D","CAF_CH146_SF","ST1_UH_80_MED_FG"],["door_L","door_R"],[[-1.11,2.5,0],[1.11,2.5,0]]],
	[["B_Heli_Transport_03_F","B_Heli_Transport_03_unarmed_F","CFB_Helo_Chinook"],["Door_rear_source"],[[-1.35,-4.6,-0.5],[1.24,-4.6,-0.5]]], //Side doors: "Door_L_source","Door_R_source"
	[["O_Heli_Transport_04_covered_F"],["Door_4_source","Door_5_source"],[[1.3,1.3,-0.1],[-1.5,1.3,-0.1]]],
	[["O_Heli_Attack_02_F","O_Heli_Attack_02_black_F"],[],[[1.3,1.3,0],[-1.3,1.3,0]]],
	[["O_Heli_Light_02_unarmed_F","O_Heli_Light_02_F"],[],[[1.35,1.35,0],[-1.45,1.35,0]]],
	[["I_Heli_light_03_unarmed_F","CFB_Helo_Griffon_Unarmed"],[],[[0.7,2.5,0],[-0.9,2.5,0]]],
	[["I_Heli_Transport_02_F"],["Door_Back_L","Door_Back_R"],[[0,-5,0]]]
];

// Check if the player is allowed to drop the ropes
SHK_Fastrope_fnc_canCreate = {
	private ["_heli","_alt","_flag"];
	_heli = objectParent player;
	_alt = (getPosATL (_heli) select 2);
	_flag = (_alt < MAX_ALTITUDE_ROPES_AVAIL) && (_alt > MIN_ALTITUDE_ROPES_AVAIL) && ((abs (speed _heli)) < MAX_SPEED_ROPES_AVAIL) && (count (_heli getVariable ["SHK_Fastrope_Ropes",[]]) == 0) && (_heli getCargoIndex player >= 0);
	_flag
};

SHK_Fastrope_fnc_createRopes = {
	params ["_heli","_ropesPos","_ropesObj","_rope"];
	
	_heli = objectParent player;
	
	_ropesPos = _heli getVariable ["SHK_Fastrope_Ropes",[]];
	
	// Ropes already exist
	if (count _ropesPos > 0) exitWith {};
	
	{
		if (typeOf _heli in (_x select 0)) exitWith {
			// Open doors
			{
				_heli animateDoor [_x,1];
			} forEach (_x select 1);
			
			// Rope attach positions
			_ropesPos = (_x select 2);
		};
	} forEach SHK_Fastrope_Helis;

	// Create ropes
	_ropesObj = [];
	{
		_rope = ropeCreate [_heli, _x, (getPosATL player select 2) + 3];
		_ropesObj pushBack _rope;
	} forEach _ropesPos;
	
	_heli setVariable ["SHK_Fastrope_Ropes", _ropesObj, true];
	_heli setVariable ["SHK_Fastrope_Queue", [], true];
	
	// Destroy ropes if chopper moves too fast
	_heli spawn {
		params ["_heli","_ropes"];
		waitUntil {_ropes = (_heli getVariable ["SHK_Fastrope_Ropes",[]]); abs (speed _heli) > MAX_SPEED_ROPES_AVAIL || (count _ropes == 0)};
		call SHK_Fastrope_fnc_cutRopes;
	};
};

SHK_Fastrope_fnc_cutRopes = {
	params ["_heli","_ropes"];
	
	_heli = objectParent _heli;
	
	_ropes = _heli getVariable ["SHK_Fastrope_Ropes",[]];
	{
		ropeCut [_x,0];
	} forEach _ropes;
	
	_heli setVariable ["SHK_Fastrope_Ropes", [], true];
	_heli setVariable ["SHK_Fastrope_Queue", [], true];
	
	// Close doors
	{
		if (typeOf _heli in (_x select 0)) exitWith {
			{
				_heli animateDoor [_x,0];
			} forEach (_x select 1);
		};
	} forEach SHK_Fastrope_Helis;	
};

SHK_Fastrope_fnc_fastRope = {
	params ["_unit","_rope"];
	
	[_unit,_rope] spawn { // Wait for the unit to be move out of the chopper.
		params ["_unit","_rope","_ropePos","_heli"];
		_heli = objectParent _unit;
		
		waitUntil {isNull objectParent _unit};
		if (local _unit) then {
			_unit leaveVehicle _heli;
			_unit allowDamage false;
			_ropePos = (ropeEndPosition _rope) select 0;
			_unit setPosATL [(_ropePos select 0),(_ropePos select 1),(_ropePos select 2)-0.5];
			_unit switchMove "LadderRifleStatic";
			_unit setDir ([_heli,_unit] call BIS_fnc_dirTo);
			//_unit setDir (_unit getDir _heli); // Arma 3 version 1.55+
			_unit spawn  {
				params ["_unit"];
				while {alive _unit && (((getPos _unit) select 2) > 1.5)} do {
					_unit setVelocity [0,0,-8];
				};
				_unit setVelocity [0,0,0];
				_unit playMove "LadderRifleDownOff";
				_unit allowDamage true;
			};
		};
	};
	
    moveOut _unit;
	
    sleep 1.3;
};

SHK_Fastrope_fnc_processQueue = {
	params ["_heli","_queue","_ropes","_count","_rope",["_i",0]];
	
	_heli = objectParent player;
	_queue = _heli getVariable ["SHK_Fastrope_Queue",[]];
	_ropes = _heli getVariable ["SHK_Fastrope_Ropes",[]];
	_count = count _ropes;

	waitUntil {_queue find player == 0};
	hintSilent "";
	
	{
		// Player or an AI in player's group
		if (_x == player || (group _x == group player && !isPlayer _x)) then {
			_queue = _queue - [_x];
			if (_count > 0) then {
				if (_count == 2) then {
					_rope = _ropes select _i;
					if (_i == 0) then {	_i = 1 } else { _i = 0 };
				} else {
					_rope = _ropes select 0;
				};
				[_x,_rope] call SHK_Fastrope_fnc_fastRope;
			};
		};
	} forEach _queue;
	
	_heli setVariable ["SHK_Fastrope_Queue", _queue, true];
};

SHK_Fastrope_fnc_queueUp = {
	params ["_heli","_queue"];
	
	_heli = objectParent player;
	_queue = _heli getVariable ["SHK_Fastrope_Queue",[]];
	
	_queue pushBack player;
	hintSilent STR_JOIN_QUEUE_HINT;
	
	// If the player is a group leader, queue up his subordinate AIs
	if (player == leader group player) then {
		{
			if (!isPlayer _x && vehicle _x == vehicle player) then {
				_queue pushBack _x;
			};
		} forEach (units group player);
	};
	
	_heli setVariable ["SHK_Fastrope_Queue", _queue, true];
	
	_heli spawn SHK_Fastrope_fnc_processQueue;
};

player addAction["<t color='#ffff00'>"+STR_TOSS_ROPES+"</t>", SHK_Fastrope_fnc_createRopes, [], -1, false, false, '','call SHK_Fastrope_fnc_canCreate'];
player addAction["<t color='#ff0000'>"+STR_CUT_ROPES+"</t>", SHK_Fastrope_fnc_cutRopes, [], -1, false, false, '','count (objectParent player getVariable ["SHK_Fastrope_Ropes",[]]) > 0'];
player addAction["<t color='#00ff00'>"+STR_FAST_ROPE+"</t>", SHK_Fastrope_fnc_queueUp, [], 15, false, false, '','!(player in (objectParent player getVariable ["SHK_Fastrope_Queue",[]])) && (count (objectParent player getVariable ["SHK_Fastrope_Ropes",[]]) > 0) && ((getPosATL (objectParent player) select 2) < MAX_ALTITUDE_ROPES_AVAIL)'];
  • Like 1

Share this post


Link to post
Share on other sites

as a total noob how would i add this, can anyone give me an idiots step by step guide please?? thanks

Share this post


Link to post
Share on other sites

I'm not sure if it was already updated where one would get teleported back to the chopper after fast roping and the new looking ropes but, everything worked great. The only thing that I see that's different/missing is that the chopper used to cut ropes automatically when it would fly away. This comes in handy when you use AI pilots. Is there a way to get that back in there or how do I achieve this?

 

Also in the past I posted the following:

How can I make the AI toss the rope when I get to my destination? Is there a command or action I can script?

This is a piece of our LZ/Insertion script. is there something like

uh80_alpha action ['autoHover', uh80_alpha];



Example:

 uh80_alpha land "GET OUT";
uh80_alpha action ['autoHover', uh80_alpha];
uh80_alpha animateDoor ["door_L",1];
uh80_alpha animateDoor ["door_R",1];
sleep 20;
uh80_alpha action ['Toss Rope', uh80_alpha]; // <<< Is something like this possible?
[["AirborneCommand",["Airborne Command", "Alpha - Greenlight - Good To Go"]], "BIS_fnc_showNotification", true, false] spawn BIS_fnc_MP; sleep 1;
};

 

 

EDIT/UPDATE: I figured out how to toss rope

uh80_alpha land "GET OUT";
uh80_alpha action ['autoHover', uh80_alpha];

sleep 35;

uh80_alpha animateDoor ["door_L",1];
uh80_alpha animateDoor ["door_R",1];

sleep 3;

call SHK_Fastrope_fnc_createRopes;

[["AirborneCommand",["Airborne Command", "Alpha - Greenlight - Good To Go"]], "BIS_fnc_showNotification", true, false] spawn BIS_fnc_MP; sleep 1;

Now I cant figure out how to cut the rope:

	uh80_alpha move (getMarkerPos "alphapad");
	[["AirborneCommand",["Airborne Command", "UH80 Alpha returning to base"]], "BIS_fnc_showNotification", true, false] spawn BIS_fnc_MP; sleep 1;
	uh80_alpha animateDoor ["door_L",0]; uh80_alpha animateDoor ["door_R",0];
	//call SHK_Fastrope_fnc_cutRopes;	
	uh80_alpha flyInHeight 100;
	uh80_alpha setBehaviour "CARELESS";
	uh80_alpha setSpeedMode "NORMAL";

RPT:

20:07:46 Error in expression <trope_Queue", [], true];


{
if (typeOf _heli in (_x select 0)) exitWith {
{
_he>
20:07:46   Error position: <_heli in (_x select 0)) exitWith {
{
_he>
20:07:46   Error Undefined variable in expression: _heli
  • Like 1

Share this post


Link to post
Share on other sites

as a total noob how would i add this, can anyone give me an idiots step by step guide please?? thanks

Honestly, it's really simple. Just add the text from this downloads' init.sqf to your mission's init.sqf and place the helicopter fast rope folder into your mission folder. That's it.

The other file that comes with this is called "mission.sqm" but you don't necessarily need this. It's just a sample mission.

The problem I have is that the download includes very few choppers. Not even all the BIS choppers so I had to make some edits to my mission (I'm not confident enough to edit the actual file).

Share this post


Link to post
Share on other sites

 

Disclaimer: I never used the script in this thread. However, I kind of rewrote the whole thing to include a queue system, and made the AI group members follow the human group leader once he ropes down. Example

 

I tried to add a feature to be able to FT full AI group from AI chopper, but there's some kind of deep link between the units, because even if the chopper is not in the same group, it will still land as soon as the first guy is moved outside the chopper.

 

Due to lack of time, I haven't had time to finish this. That basically means going through all the rope attachment points for all helos and adding door names. Adding custom chopper is rather simple. If the model is based on BIS, just add the name to the correct array. If it's a custom one, make a new line and tweak the attachment points.

 

If someone wants to, please, feel free to use it anyway you like.

 

 

This seems to work really well, will you release this separately? The AI cutting ropes after a certain speed would be cool if you can figure out how. 

Share this post


Link to post
Share on other sites

This seems to work really well, will you release this separately? The AI cutting ropes after a certain speed would be cool if you can figure out how.

Are you having any issues with this script? I'll have to see if perhaps it's just map related but last night on CLAfghan, I made about a half dozen attempts and the AI would never follow me out.

I could see their helicopter icons disappearing for my AI teammates (meaning I think they initiated the jump), but they'd immediately get teleported back into the chopper.

Perhaps CLAfghan is the issue? I know helicopters don't work well in general on that map.

Share this post


Link to post
Share on other sites

Well, I did say it's an unfinished and untested.

And yet it still works really well for me, so thank you. Any hope of finishing it? At the moment, all that seems to be missing is the AI pilot cutting the ropes after reaching a certain speed. 

 

@heroesandvillainsOS no, no issues for me at all. Haven't tested Clafghan but SP / MP / Dedi seem fine on Altis, Lingor and a few others. 

  • Like 1

Share this post


Link to post
Share on other sites

I have two issues, first the cut ropes action does not show,

It does show i just  Use   player addaction ["cut",SHK_Fastrope_fnc_cutRopes]; but it's there constantly and does nothing except call the cut ropes function but that does nothing, the ropes remain.

 

I noticed that if I replace  these lines 

 

_heli = objectParent _heli;
_ropes = _heli getVariable ["SHK_Fastrope_Ropes",[]];

 

with these lines and giving it the name of the chopper it works, I can cut ropes and they will auto cut

 

_heli = objectParent  myhelo;

_ropes = myhelo getVariable ["SHK_Fastrope_Ropes",[]];

Share this post


Link to post
Share on other sites

And yet it still works really well for me, so thank you. Any hope of finishing it? At the moment, all that seems to be missing is the AI pilot cutting the ropes after reaching a certain speed. 

 

@heroesandvillainsOS no, no issues for me at all. Haven't tested Clafghan but SP / MP / Dedi seem fine on Altis, Lingor and a few others. 

 

 

I have two issues, first the cut ropes action does not show,

It does show i just  Use   player addaction ["cut",SHK_Fastrope_fnc_cutRopes]; but it's there constantly and does nothing except call the cut ropes function but that does nothing, the ropes remain.

 

 

Both of these are (should be) fixed in the current version. I haven't had a chance to test it out with multiple players, just a quick solo test on dedi. I also added RHS choppers. I changed the class name handling so that it supports base classes as well. That way you don't need to list huge number of different variants.

 

I guess I could release it when I get home. At least that way finding out bugs would be faster. ;)

  • Like 1

Share this post


Link to post
Share on other sites

Calling out for brave testers. :P

/*
	SHK_Fastrope by Shuko (LDD Kyllikki)
	Version 1.0

	Inspired by v1g Fast Rope by [STELS]Zealot (modified by TheRick for Altis Life)
*/


#define MAX_ALTITUDE_ROPES_AVAIL 70
#define MIN_ALTITUDE_ROPES_AVAIL 5
#define MAX_SPEED_ROPES_AVAIL 50

#define STR_TOSS_ROPES "Toss Ropes"
#define STR_FAST_ROPE "Fast Rope"
#define STR_CUT_ROPES "Cut Ropes"

#define STR_JOIN_QUEUE_HINT "You're in the fast-rope queue."

// ["ClassName",["Door_L","Door_R"],[[ropeAttachPosition1],[ropeAttachPosition2]]]
// Search for the chopper type is done from top to bottom. You can use vehicle base classes,
// but specific vehicles should be at the top because first match is used (which could be base class and not the subclass).
SHK_Fastrope_Helis = [
    // RHS: Armed Forces of Russian Federation
	["RHS_Mi8_base",[],[[0,-3,0]]],
	["RHS_Mi24_base",[],[[1.6,3.3,0],[-0.4,3.3,0]]],
	["RHS_Ka60_grey",[],[[1.4,1.35,0],[-1.4,1.35,0]]],

    //RHS: United States Armed Forces
	["RHS_CH_47F_base",[],[[0,-0.4,0]]],
	["RHS_UH60_base",[],[[1.44,1.93,-0.49]]],
	["RHS_UH1_base",[],[[0.95,3,-0.9],[-0.95,3,-0.9]]],
    
    // Arma 3
	["Heli_Light_01_unarmed_base_F",[],[[1.1,0.5,-0.5],[-1.1,0.5,-0.5]]], //Hummingbird
	["Heli_Transport_01_base_F",["door_L","door_R"],[[-1.01,2.5,0.25],[1.13,2.5,0.25]]], //Ghost Hawk
	["Heli_Transport_03_base_F",["Door_rear_source"],[[-1.35,-4.6,-0.5],[1.24,-4.6,-0.5]]], //Huron  Side doors: "Door_L_source","Door_R_source"
	["I_Heli_Transport_02_F",["CargoRamp_Open"],[[0,-5,0]]], //Mohawk
	["Heli_light_03_base_F",[],[[0.95,3,-0.9],[-0.95,3,-0.9]]], //Hellcat
	["Heli_Attack_02_base_F",["door_L","door_R"],[[1.3,1.3,-0.6],[-1.3,1.3,-0.6]]], //Kajman
	["Heli_Light_02_base_F",[],[[1.35,1.35,0],[-1.45,1.35,0]]], //Orca
	["O_Heli_Transport_04_covered_F",["Door_4_source","Door_5_source"],[[1.3,1.3,-0.1],[-1.5,1.3,-0.1]]], //Taru covered
	["O_Heli_Transport_04_bench_F",["Door_4_source","Door_5_source"],[[1.3,0.15,-0.1],[-1.5,0.15,-0.1]]] //Taru bench underneath

    
];

// Check if the player is allowed to drop the ropes
SHK_Fastrope_fnc_canCreate = {
	private ["_heli","_alt","_flag"];
	_heli = objectParent player;
	_alt = (getPosATL (_heli) select 2);
	_flag = (_alt < MAX_ALTITUDE_ROPES_AVAIL) && (_alt > MIN_ALTITUDE_ROPES_AVAIL) && ((abs (speed _heli)) < MAX_SPEED_ROPES_AVAIL) && (count (_heli getVariable ["SHK_Fastrope_Ropes",[]]) == 0) && (_heli getCargoIndex player >= 0);
	_flag
};

SHK_Fastrope_fnc_createRopes = {
	params ["_heli","_ropesPos","_ropesObj","_rope"];
	
	_heli = objectParent player;
	_ropesPos = _heli getVariable ["SHK_Fastrope_Ropes",[]];
	
	// Ropes already exist
	if (count _ropesPos > 0) exitWith {};
	
	{
        if (_heli isKindOf (_x select 0)) exitWith {
			// Open doors
			{
				_heli animateDoor [_x,1];
			} forEach (_x select 1);
			
			// Rope attach positions
			_ropesPos = (_x select 2);
		};
	} forEach SHK_Fastrope_Helis;

	// Create ropes
	_ropesObj = [];
	{
		_rope = ropeCreate [_heli, _x, (getPosATL player select 2) + 3];
		_ropesObj pushBack _rope;
	} forEach _ropesPos;
	
	_heli setVariable ["SHK_Fastrope_Ropes", _ropesObj, true];
	_heli setVariable ["SHK_Fastrope_Queue", [], true];
	
	// Destroy ropes if chopper moves too fast
	_heli spawn {
		params ["_heli","_ropes"];
		waitUntil {_ropes = (_heli getVariable ["SHK_Fastrope_Ropes",[]]); abs (speed _heli) > MAX_SPEED_ROPES_AVAIL || (count _ropes == 0)};
		
		// Ropes already removed by call from addAction
		if (count _ropes > 0) then {
			_heli call SHK_Fastrope_fnc_cutRopes;
		};
	};
};

SHK_Fastrope_fnc_cutRopes = {
	private ["_heli","_ropes"];

	_heli = _this;
    
	// Function is called from addAction without helicopter parameter, use the chopper player is in.
	if (_this isEqualType []) then {
		_heli = objectParent player;
	};
	
	_ropes = _heli getVariable ["SHK_Fastrope_Ropes",[]];
	{
		ropeCut [_x,0];
	} forEach _ropes;
	
	_heli setVariable ["SHK_Fastrope_Ropes", [], true];
	_heli setVariable ["SHK_Fastrope_Queue", [], true];
	
	// Close doors
	{
		if (_heli isKindOf (_x select 0)) exitWith {
			{
				_heli animateDoor [_x,0];
			} forEach (_x select 1);
		};
	} forEach SHK_Fastrope_Helis;	
};

SHK_Fastrope_fnc_fastRope = {
	params ["_unit","_rope"];
	
	[_unit,_rope] spawn { // Wait for the unit to be move out of the chopper.
		params ["_unit","_rope","_ropePos","_heli"];
		_heli = objectParent _unit;
		
		waitUntil {isNull objectParent _unit};
		if (local _unit) then {
			_unit allowDamage false;
			_unit leaveVehicle _heli;
			_ropePos = (ropeEndPosition _rope) select 0;
			_unit setPosATL [(_ropePos select 0),(_ropePos select 1),(_ropePos select 2)-2];
			_unit switchMove "LadderRifleStatic";
			_unit setDir ([_heli,_unit] call BIS_fnc_dirTo);
			//_unit setDir (_unit getDir _heli); // Arma 3 version 1.55+
			_unit spawn  {
				params ["_unit"];
				while {alive _unit && (((getPos _unit) select 2) > 1.5)} do {
					_unit setVelocity [0,0,-8];
				};
				_unit setVelocity [0,0,0];
				_unit playMove "LadderRifleDownOff";
				_unit allowDamage true;
			};
		};
	};
	
    moveOut _unit;
	
	sleep 1.3;
};

SHK_Fastrope_fnc_processQueue = {
	params ["_heli","_queue","_ropes","_count","_rope",["_i",0]];
	
	_heli = objectParent player;
	_queue = _heli getVariable ["SHK_Fastrope_Queue",[]];
	_ropes = _heli getVariable ["SHK_Fastrope_Ropes",[]];
	_count = count _ropes;

	waitUntil {_queue find player == 0};
	hintSilent "";
	
	{
		// Player or an AI in player's group
		if (_x == player || (group _x == group player && !isPlayer _x)) then {
			_queue = _queue - [_x];
			if (_count > 0) then {
				if (_count == 2) then {
					_rope = _ropes select _i;
					if (_i == 0) then {	_i = 1 } else { _i = 0 };
				} else {
					_rope = _ropes select 0;
				};
				[_x,_rope] call SHK_Fastrope_fnc_fastRope;
			};
		};
	} forEach _queue;
	
	_heli setVariable ["SHK_Fastrope_Queue", _queue, true];
};

SHK_Fastrope_fnc_queueUp = {
	params ["_heli","_queue"];
	
	_heli = objectParent player;
	_queue = _heli getVariable ["SHK_Fastrope_Queue",[]];
	
	_queue pushBack player;
	hintSilent STR_JOIN_QUEUE_HINT;
	
	// If the player is a group leader, queue up his subordinate AIs
	if (player == leader group player) then {
		{
			if (!isPlayer _x && vehicle _x == vehicle player) then {
				_queue pushBack _x;
			};
		} forEach (units group player);
	};
	
	_heli setVariable ["SHK_Fastrope_Queue", _queue, true];
	
	_heli spawn SHK_Fastrope_fnc_processQueue;
};

player addAction["<t color='#ffff00'>"+STR_TOSS_ROPES+"</t>", SHK_Fastrope_fnc_createRopes, [], -1, false, false, '','call SHK_Fastrope_fnc_canCreate'];
player addAction["<t color='#ff0000'>"+STR_CUT_ROPES+"</t>", SHK_Fastrope_fnc_cutRopes, [], -1, false, false, '','count (objectParent player getVariable ["SHK_Fastrope_Ropes",[]]) > 0'];
player addAction["<t color='#00ff00'>"+STR_FAST_ROPE+"</t>", SHK_Fastrope_fnc_queueUp, [], 15, false, false, '','!(player in (objectParent player getVariable ["SHK_Fastrope_Queue",[]])) && (count (objectParent player getVariable ["SHK_Fastrope_Ropes",[]]) > 0) && ((getPosATL (objectParent player) select 2) < MAX_ALTITUDE_ROPES_AVAIL)'];
  • Like 1

Share this post


Link to post
Share on other sites

Seems to be working correctly for me in single player, no idea about MP thanks.

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

×