Jump to content
zealot111

Helicopter fastrope script

Recommended Posts

maybe you can add an option like .... if pilot is player then only pilot have the toss and cut else group leader can toss/cut ropes ???

thanks :)

Edited by dragonsyr

Share this post


Link to post
Share on other sites
Guest

Thanks for informing us about the updated release, I think I overlooked it myself :cool:

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites
same here.....is it possible the toss and cut ropes only for pilot , and the fastrope only for cargo players?

Very good work with this script ! thanks a lot.

+1 for you : pilot + copilt can't fast rope would be more realistic :) . And IRL gunners are in cargo so , if only pilots can't have the menu it will be more realistic.

Share this post


Link to post
Share on other sites
I would like to see this mod not allow much speed at all. No one is fast ropeing in past a few km without significant injury.

:thumb:

you can set the speed limit replacing this in the script

#define MAX_SPEED_WHILE_FASTROPING 1
i think.... Edited by dragonsyr

Share this post


Link to post
Share on other sites

hey, man

i really like your script, i only changed a little part, the animation.

i used the Gunner animation for Static guns, it is "gunner_standup01", and even though it does not fit perfectly, i think it looks okayish enough in motion. i also change the roping speed and sped up the loop a bit.

i made a quick video of the changes

http://www.youtube.com/watch?v=ygGhEqqM2WM&feature=youtu.be

thanks for the script, my skills are not good enough to pull somthing like this on my own :)

also, for us scripting noobs, could you release a commented version so we can learn what you did?

looking at commented code helps learning a lot :)

MfG TheSystem

Edited by TheSystem

Share this post


Link to post
Share on other sites

Yeah the script is great, my regiment tested it pretty thoroughly tonight with about 10 people and it worked fine. The only problem we encountered was the first "toss" of the ropes caused the pilot to die or the chopper to be pulled in an odd direction and disable multiple areas of the chopper (Main rotor and such).

I was also trying to mess with the cut rope function to have the doors close after the ropes are cut (with a short wait time in between the two), and this is the first script that I have tried to mess with ever, and I am quite unsure what exactly I am doing but think the way I did it should work, but I will post it below and if you could help or add a open/close door feature to the script in a future update that would be amazing, some of our military vets requested that feature and I am just not good enough in the scripting world to do that for them.

Any help is greatly appreciated!

zlt_fnc_cutropes = {
_veh = _this;
_ropes = (_veh getvariable ["zlt_ropes", []]);
{deletevehicle _x} foreach _ropes;
_veh setvariable ["zlt_ropes", [], true];
sleep random 0.3;
if ( count (_heli getvariable ["zlt_ropes",[]]) != 1 or zlt_mutexAction ) exitwith { zlt_mutexAction = true; };
_heli animateDoor ['door_R', 0];
_heli animateDoor ['door_L', 0];
};

Share this post


Link to post
Share on other sites

Edit: forget what i said, i am tired and all, i think i just misread the code or messed up elsewhere

edit 2: i just used your code but removed the if (bla) exitwith {}; and it worked.

Edited by TheSystem

Share this post


Link to post
Share on other sites
edit 2: i just used your code but removed the if (bla) exitwith {}; and it worked.

I tried this and it didn't work...

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

Share this post


Link to post
Share on other sites

strange, it worked for me.

but the main problem here is locality in multiplayer. who owns the chopper, and who is triggering the cutting. perhaps the new bis_fnc_mp can help here, but i couldn't really tell.

Share this post


Link to post
Share on other sites
What is the issue in multiplayer?

Here is a section of a report from our trials:

Its when the main pilot uses the function " deploy ropes " it will cause the issues. The resolve is simple you need a 2 man crew to use this script safely i.e second person assigned or given task to deploy ropes then the other people safely can fast rope down.

The pilot has no issue with using 2nd part of script " cut ropes " if needed but the script will also by default remove any ropes if chopper motion is gained over the speed of 5 mph

Only side effects from this script I see left now is that the pilot can also fast rope down if the the ropes are deployed if it is accidentally selected in the list and any given time if people are fast roping down mid way the ropes can be cut manually or by any extra movement / momentum.

Share this post


Link to post
Share on other sites
hey, man

i really like your script, i only changed a little part, the animation.

i used the Gunner animation for Static guns, it is "gunner_standup01", and even though it does not fit perfectly, i think it looks okayish enough in motion. i also change the roping speed and sped up the loop a bit.

i made a quick video of the changes

http://www.youtube.com/watch?v=ygGhEqqM2WM&feature=youtu.be

thanks for the script, my skills are not good enough to pull somthing like this on my own :)

also, for us scripting noobs, could you release a commented version so we can learn what you did?

looking at commented code helps learning a lot :)

MfG TheSystem

Thanks for the suggested animation, I just updated the script with it :) Regarding loop time - I beleive it is not a good thing because each time you attachto unit to the position your game client spams all other clients playing the same mission with this information and it may cause desynchronization. (at least as I understand the game engine working logic)

To learn Arma coding you should code much because to write scripts is much simpler than to read others' scripts :) So I dont want to make commented version of the script (and it will take a lot of time which I could to spend making another good scripts). This script is short and self explaining from my point of view. Anyway, if you have questions regarding script - you are always welcome to ask.

---------- Post added at 21:56 ---------- Previous post was at 21:54 ----------

Any help is greatly appreciated!

Could you check latest version of the script (29/12/2013) ? Now script must close the doors of helicopter after ropes are cut.

---------- Post added at 22:15 ---------- Previous post was at 21:56 ----------

Here is a section of a report from our trials:

Its when the main pilot uses the function " deploy ropes " it will cause the issues. The resolve is simple you need a 2 man crew to use this script safely i.e second person assigned or given task to deploy ropes then the other people safely can fast rope down.

The pilot has no issue with using 2nd part of script " cut ropes " if needed but the script will also by default remove any ropes if chopper motion is gained over the speed of 5 mph

Only side effects from this script I see left now is that the pilot can also fast rope down if the the ropes are deployed if it is accidentally selected in the list and any given time if people are fast roping down mid way the ropes can be cut manually or by any extra movement / momentum.

I tried to reproduce the bug with helicopter damaging after tossing ropes but with no luck. Could you please retest the latest version of the script (from 29/12/2013) and check this situation? Please note which kind of helicopters are susceptible to this bug?

Share this post


Link to post
Share on other sites

thank you for your answer :)

we had the same problem with the exploding chopper, it happened in multiplayer when the player with a weaker rig tossed the ropes, i think it is because you create them too close to the chopper and the can_collide doesn't tell the ropes not to collide with anything fast enough.

i changed it by simply creating them at [0,0,0] so they would be created elsewhere and then attached. this doesn't really delay the ropecreation but avoided the heilcopters to blow up.

Edited by TheSystem

Share this post


Link to post
Share on other sites

Yeah man works great looks amazing! Doors are closing and so far anyone can drop the ropes without causing the chopper to crash/blow up.

Edited by JShock

Share this post


Link to post
Share on other sites
thank you for your answer :)

we had the same problem with the exploding chopper, it happened in multiplayer when the player with a weaker rig tossed the ropes, i think it is because you create them too close to the chopper and the can_collide doesn't tell the ropes not to collide with anything fast enough.

i changed it by simply creating them at [0,0,0] so they would be created elsewhere and then attached. this doesn't really delay the ropecreation but avoided the heilcopters to blow up.

Thanks for your answer. I have already fixed this the same way :) in the latest version of the script. So it seems that it should work correct now.

Edited by zealot111

Share this post


Link to post
Share on other sites
Guest

Thanks for informing us about the new release :cool:

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites
Your testmission doesnt work for me.. :/

Could you describe what problems you had encountered with test mission?

Share this post


Link to post
Share on other sites

I was wonderign if this works with helicopters from custom packs? I changed the name in the script for the helicopters I want to use but it doesn't seems to be working

Share this post


Link to post
Share on other sites
I was wonderign if this works with helicopters from custom packs? I changed the name in the script for the helicopters I want to use but it doesn't seems to be working

To add your favorite helicopter from addon you should modify 2 global variables:

zlt_rope_helis - which defines classes of helicopters which is allowed to use fastrope

and zlt_rope_helidata - which defines mount points fro ropes on helicopter model;

for example, if you want to add support for CH_147F from Canadian Army addon you should change the script:

add "CH_147F" to zlt_rope_helis variable and

add

	[
	["CH_147F"],
	[-0.1,0.3,-27.7],
	[]
]

to zlt_rope_helidata

Example:

// 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 = ["O_Heli_Light_02_unarmed_F","O_Heli_Light_02_F","B_Heli_Transport_01_F","B_Heli_Transport_01_camo_F","O_Heli_Attack_02_F","O_Heli_Attack_02_black_F","I_Heli_Transport_02_F","B_Heli_Light_01_F","CH_147F"];
zlt_rope_helidata = 
[
[
	["O_Heli_Light_02_unarmed_F", "O_Heli_Light_02_F"],
	[1.35,1.35,-24.95],
	[-1.45,1.35,-24.95]
],
[
	["B_Heli_Transport_01_F", "B_Heli_Transport_01_camo_F"],
	[-1.11,2.5,-24.7],
	[1.11,2.5,-24.7]
],
[
	["O_Heli_Attack_02_F", "O_Heli_Attack_02_black_F"],
	[1.3,1.3,-25],
	[-1.3,1.3,-25]
],
[
	["I_Heli_Transport_02_F"],
	[0,-5,-26],
	[]
],	
[
	["B_Heli_Light_01_F"],
	[0.6,0.5,-25.9],
	[-0.8,0.5,-25.9]
],
[
	["CH_147F"],
	[-0.1,0.3,-27.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;
_unit action ["eject", _heli];
_unit switchmove "gunner_standup01";

_unit setpos [(getpos _heli select 0), (getpos _heli select 1), 0 max ((getpos _heli 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'];
}];

Share this post


Link to post
Share on other sites
What do the numbers under the class name represent?

Its coordinates of the ropes in the model space of helicopter

Share this post


Link to post
Share on other sites

Anyone know of the coordinates to fastrope off the back end of the Chinook?

Share this post


Link to post
Share on other sites

Hoping someone can get these working with this script too! :)

http://forums.bistudio.com/showthread.php?173822-ArmA-2-US-Helicopters-Import-to-A3

And zealot, I took a look at how your script works but I am no scripter... I LOVE the way that if I am commanding some AI in my group that they will "follow" me down the ropes when I fast rope out of a chopper! I've been trying for some time now to get the same behavior with any of the numerous HALO scripts out there too and hoped I might identify the method which you used to make this happen so maybe I can get them to jump with a parachute the same way (when I do). If you have time would mind pointing out the relevant bits that makes this happen in your script?

Thanks in advance!

Edited by Oktyabr

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

×