Forum Jump :

Author Message


Posts: 151
Rank:


Level: Member

Country: us
Location: Pennsylvania
Occupation:
Age:
In-game name: Xian

 
#1 Posted at 2015-12-06 10:52        
     
So I've decided to try and get fast rope system that works for our group. Zealot111's is apparently the staple right now and for good reasons. I however was never a fan of the "pole-like" structure but he worked with what he had and did a damn good job.

I also came across another person's attempt that wasn't working and have kind of mashed the two together almost. Unfortunately I can't seem to find the person's post in my history to give them credit. That being said, here is my rendition of the fast rope:

if (isdedicated) exitwith {};
waituntil {player == player};
x_fastrope_fnc = {
	private ["_heli","_startend","_start","_obj","_caller","_rope"];
	_heli = vehicle player;
	if (_heli isKindof "Air") exitwith 
		{
			_heli addaction ["Fast Rope", {
			_startend = 10; 
			_start = 4;
			_obj = _this select 0; 
			_caller = _this select 1; 
			_caller setPos (_obj modelToWorld [2,0,-1.5]);
			_rope = ropeCreate [_obj,[0,0,0], _caller,[0,0,0.95],5,_start,false];
			while {!(isTouchingGround _caller)} do 
			{
				ropeUnwind [_rope,5,_start+1,true];
				_start = _start + 1;
				_startend = _startend + 1
			};
			_caller ropeDetach _rope;
			ropeCut [_rope, 0]
			}];
		}
};	

Now, my issue is that this works fantastic in the editor (without the isDedicated part I believe) but when we get into a vanilla MP game, the fast roping will start and then place the player right back into the chopper. I have tried unassignVehicle, I've tried ejecting, I'm not sure what else I can try and am looking for any assistance. Thanks for your time!


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 22
In-game name: Wak

 
#2 Posted at 2015-12-06 13:24        
     
I used moveOut to get the player out of the helicopter, and did some other small changes.

Here is the final script (just the core of it):
params ["_heli", "_unit"];
moveOut _unit;
_unit setPos (_heli modelToWorld [1.5, 2, -1.5]);
_rope = ropeCreate [_heli, [1.5, 2, -1.5], _unit, [0, 0, 0.95], 4];
_height = getPosATL _heli select 2;
ropeUnwind [_rope, 5, _height, true];
waitUntil {isTouchingGround _unit};
_unit ropeDetach _rope;
ropeCut [_rope, 0];
sleep 0.2;
ropeDestroy _rope;

This post was edited by 654wak654 (2015-12-06 14:50, ago)

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Advertisement


Author Message


Posts: 151
Rank:


Level: Member

Country: us
Location: Pennsylvania
Occupation:
Age:
In-game name: Xian

 
#3 Posted at 2015-12-07 10:14        
     
Thanks again for the help, you definitely set me in the right direction. I took some of your suggestions and tweaked it a bit. I'm now getting a new error - again only on our dedicated box, works great in the editor - where the rope is cutting before we're on the ground. I'm not sure what to make of it and I've tried everything, even removing the cut and detach commands completely, still not helping. Here's the new coding:

if (isdedicated) exitwith {};
waituntil {player == player};
x_fastrope_fnc = 
	{
	params ["_xheli"];
	_xheli = vehicle player;
	if (_xheli isKindof "Air") exitwith 
		{
			_xheli addaction ["Fast Rope", 
			{
				params ["_heli", "_unit","_height","_rope","_length"];
				_heli = _this select 0;
				_unit = _this select 1;
				_height = getPosATL _heli select 2;
				moveOut _unit;
				_unit setPos (_heli modelToWorld [1.5, 2, -1.5]);
				_rope = ropeCreate [_heli, [1.5, 2, -1.5], _unit, [0, 0, 0.95], 3];
				while {!(isTouchingGround _unit)} do
					{
						ropeUnwind [_rope,5,_height,true];
					};
				_heli ropeDetach _rope;
				ropeCut [_rope, 0];
				sleep 0.5;
				ropeDestroy _rope;
			}];
		};
	};


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 22
In-game name: Wak

 
#4 Posted at 2015-12-07 12:03        
     
You shouldn't have to use the while loop, just try waitUntil. Also I think you've mistaken the params command with private, that might be creating a problem.

Since you wanted those other variables to be private, I used the new syntax of the private command to make them so.
params ["_heli", "_unit"];
private _height = getPosATL _heli select 2;
moveOut _unit;
_unit setPos (_heli modelToWorld [1.5, 2, -1.5]);
private _rope = ropeCreate [_heli, [1.5, 2, -1.5], _unit, [0, 0, 0.95], 3];
ropeUnwind [_rope, 5, _height + 3];
waitUntil {isTouchingGround _unit};
_heli ropeDetach _rope;
ropeCut [_rope, 0];
sleep 0.5;
ropeDestroy _rope;

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 151
Rank:


Level: Member

Country: us
Location: Pennsylvania
Occupation:
Age:
In-game name: Xian

 
#5 Posted at 2015-12-07 18:16        
     
I did try the waitUntil command when you suggested it earlier but my issue is that when I use it (very possible I'm missing something else, still a novice at this stuff IMO) the player just hangs from the rope under the chopper. The rope never extends down. Using the while/do command, it does extend, just not to the ground lol.

Yeah - just tested. Works great in the editor. But soon as I put it on our server, it hangs us under and doesn't move.

This post was edited by XianGrim (2015-12-07 18:23, ago)


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 22
In-game name: Wak

 
#6 Posted at 2015-12-07 18:36        
     
I dumped isTouchingGround to manually check for player's height, give it a try. Apparently ropeCut does ropeDetach, so removed that too.

params ["_heli", "_unit"];
moveOut _unit;
_unit setPos (_heli modelToWorld [1.5, 2, -1.5]);
private _rope = ropeCreate [_heli, [1.5, 2, -1.5], _unit, [0, 0, 0.95], 3];
ropeUnwind [_rope, 5, (getPos _heli select 2) + 3];
waitUntil {(getPos _unit select 2) < 3};
ropeCut [_rope, 0];
sleep 0.5;
ropeDestroy _rope;

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 151
Rank:


Level: Member

Country: us
Location: Pennsylvania
Occupation:
Age:
In-game name: Xian

 
#7 Posted at 2015-12-07 18:49        
     
Same results bud. Its weird lol Editor is 100% awesome. Box is not working. Do you think its something to do with how its being called on the server? I noticed that in the editor, my fnc is automatically started and the action on the helicopter is there as soon as I get in. On our server however, I had to add a little script that forces it to call the fnc.


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 22
In-game name: Wak

 
#8 Posted at 2015-12-07 23:35        
     
It might be some locality issue with the way you're adding the action. Can you just try to run the small script in an sqf file? You can get in a helo and execute it locally like this:
[vehicle player, player] execVM "fastrope.sqf";

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage





Tags: Fast Roping