Jump to content
Sign in to follow this  
SIlenceFiction

Auto Parachute Script

Recommended Posts

Hello, I am looking for an auto parachute script, just like in King of The Hill.

What I want it to do is, even if the unit doesn't have a parachute, if the unit ejects from a heli, they will have a parachute AND their backpack. Or just like in King of The Hill when there is no parachute equipped but it opens automatically at a certain altitude.

Share this post


Link to post
Share on other sites
BUMPs

Don't Bump.. use a parachute

Here's a simple autoparachute script.

Stick this in your init.sqf

waituntil {!(IsNull (findDisplay 46))};  _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 57) 
then {
		if (!(isTouchingGround player) and (vehicle player == player))
			then {[] spawn {player switchCamera 'EXTERNAL';
				Player SwitchMove 'AswmPercMrunSnonWnonDf_AswmPercMstpSnonWnonDnon';
				addCamShake [4, 2, 20];sleep 0.7;
				playSound3D ['@SCS\Sound\Parachute.ogg', Player, false, GetPosASL Player,5, 1, 250];
				titleText ['', 'White IN', 0.6];
				addCamShake [2, 2, 10];
				chute = createVehicle ['Steerable_Parachute_F', position Player,[],0,'Fly'];
				chute setPos position player;player moveIndriver chute; chute allowDamage false;}; 
				};
	}"];

Basically what this does is for ANY player that is not touching the ground and THAT player is NOT in a vehicle, switch to the freefall animation. When the player presses the space bar, spawn a parachute, at the player, and move player into it. He keeps his backpack etc. When he lands parchute is replaced by the original backpack he jumped with. Simples..

*Credit for this stupidly brilliant and simple halodrop goes to ThunderBolt91 from ArmaHolic forums.

  • Haha 1

Share this post


Link to post
Share on other sites
Don't Bump.. use a parachute

Here's a simple autoparachute script.

Stick this in your init.sqf

waituntil {!(IsNull (findDisplay 46))};  _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 57) 
then {
		if (!(isTouchingGround player) and (vehicle player == player))
			then {[] spawn {player switchCamera 'EXTERNAL';
				Player SwitchMove 'AswmPercMrunSnonWnonDf_AswmPercMstpSnonWnonDnon';
				addCamShake [4, 2, 20];sleep 0.7;
				playSound3D ['@SCS\Sound\Parachute.ogg', Player, false, GetPosASL Player,5, 1, 250];
				titleText ['', 'White IN', 0.6];
				addCamShake [2, 2, 10];
				chute = createVehicle ['Steerable_Parachute_F', position Player,[],0,'Fly'];
				chute setPos position player;player moveIndriver chute; chute allowDamage false;}; 
				};
	}"];

Basically what this does is for ANY player that is not touching the ground and THAT player is NOT in a vehicle, switch to the freefall animation. When the player presses the space bar, spawn a parachute, at the player, and move player into it. He keeps his backpack etc. When he lands parchute is replaced by the original backpack he jumped with. Simples..

*Credit for this stupidly brilliant and simple halodrop goes to ThunderBolt91 from ArmaHolic forums.

Thanks, I'll be sure to test it and tell update if it meets my needs.

Share this post


Link to post
Share on other sites

from my rpt file....

Error in expression <if (_this select 1 == 57) then { >

21:20:32 Error position: <if (_this select 1 == 57) then { >

21:20:32 Error Type Script, expected Bool

Share this post


Link to post
Share on other sites

Tested and working.

Auto Parachute Script. Any player ejected from a plane/helo etc. (or indeed spawned in the air) will automatically be given a parachute @ 100m. Keeps backback and gear etc. No need to equip unit with a Parachute.

Put this in your init.sqf

//Auto ParaChute Proof of concept 							
//by Beerkan
//version Beta 0.82
[] spawn
{
  while {true} do
{private ['player','chute'];
	if ( (getPosATL player select 2 > 100) && (vehicle player IsEqualto player) && (alive player)) then
           {
           waitUntil {(position player select 2) <= 100};
           addCamShake [8, 2, 20];
           chute = createVehicle ['Steerable_Parachute_F', position Player, [], 0, 'FLY'];
           chute setPos position player;
           player moveIndriver chute;
           chute allowDamage false;
           };
       sleep 2;
   };
};

Edited by Beerkan
Oppsl forgot to take account of water.. Edited

Share this post


Link to post
Share on other sites
Tested and working.

Auto Parachute Script. Any player ejected from a plane/helo etc. (or indeed spawned in the air) will automatically be given a parachute @ 100m. Keeps backback and gear etc. No need to equip unit with a Parachute.

Put this in your init.sqf

//Auto ParaChute Proof of concept 							
//by Beerkan
//version Beta 0.82
[] spawn
{
  while {true} do
{private ['player','chute'];
	if ( (getPosATL player select 2 > 100) && (vehicle player IsEqualto player) && (alive player)) then
           {
           waitUntil {(position player select 2) <= 100};
           addCamShake [8, 2, 20];
           chute = createVehicle ['Steerable_Parachute_F', position Player, [], 0, 'FLY'];
           chute setPos position player;
           player moveIndriver chute;
           chute allowDamage false;
           };
       sleep 2;
   };
};

Error Generic error in expression

16:20:53 Error in expression < while {true} do {private ['player','chute']; if >

16:20:53 Error position: <private ['player','chute']; if >

16:20:53 Error Local variable in global space

16:20:53 Suspending not allowed in this context

16:20:53 Error in expression <wDamage false; }; sleep 2; }; >

16:20:53 Error position: <sleep 2;

Share this post


Link to post
Share on other sites

private ['player','chute'];

Not sure that is correct... Remove this line unless "_player" and "_chute" exists in script then it should be:

private ["_player", "_chute"];

I think, not 100% sure. :P

Dirty Haz

Share this post


Link to post
Share on other sites
private ['player','chute'];

Not sure that is correct... Remove this line unless "_player" and "_chute" exists in script then it should be:

private ["_player", "_chute"];

I think, not 100% sure. :P

Dirty Haz

THANKS Dirty Haz and Beerkan (original script)

I added an eject to action menu So now players can eject from heli pilot positions :cool:

[] spawn
{
  while {true} do
   {private ['_player','_chute'];
       if ( (getPosATL player select 2 > 100) && (vehicle player IsEqualto player) && (alive player)) then
           {
           waitUntil {(position player select 2) <= 100};
           addCamShake [8, 2, 20];
           chute = createVehicle ['Steerable_Parachute_F', position Player, [], 0, 'FLY'];
           chute setPos position player;
           player moveIndriver chute;
           chute allowDamage false;
           };
       sleep 2;
   };
};

Share this post


Link to post
Share on other sites

Morning! :)

private ['_player','_chute'];

You don't need this because "_player" and "_chute" does not exist in the script.

Dirty Haz

Edit:

Instead of making a new thread, I'll ask here. There is no "Eject" EH that I can see (Wiki) and "GetOut" does not work (I don't think) when you just "Eject" from a vehicle so, is there any other solution without making another action?

Dirty Haz

Edit 2:

Haz_Func_Eject.sqf :

Haz_Func_Eject = compile PreProcessFileLineNumbers "Functions\Haz_Func_Eject.sqf";

// Created by: Haz

private ["_Vehicle", "_Position", "_Unit", "_Chute"];

_Vehicle = [_this, 0, objNull] call BIS_fnc_param;
_Position = [_this, 1, objNull] call BIS_fnc_param;
_Unit = [_this, 2, objNull] call BIS_fnc_param;

if (getPos _Unit select 2 >= 75 && alive _Unit) then {
_Chute = createVehicle ["Steerable_Parachute_F", position _Unit, [], 0, "FLY"];
_Unit moveInDriver _Chute;
_Unit allowDamage false;
_Chute allowDamage false;
waitUntil {getPos _Unit select 2 <= 25};
_Unit allowDamage true;
waitUntil {getPos _Unit select 2 <= 2 || !alive _Unit};
deleteVehicle _Chute;
};

player addEventHandler ["GetOut", Haz_Func_Eject];

Am I doing something wrong or does "GetOut" not work count for ejecting?

Dirty Haz

Edited by Dirty Haz
Edit 2

Share this post


Link to post
Share on other sites

Any one got luck with cutting parachutes to prevent wind from dragging players?

Share this post


Link to post
Share on other sites
On 14/1/2019 at 5:30 AM, Div3y3z said:

Any one got luck with cutting parachutes to prevent wind from dragging players?

 

If i remember right there is already this for :

 

Share this post


Link to post
Share on other sites
On 14/01/2019 at 4:30 AM, Div3y3z said:

Any one got luck with cutting parachutes to prevent wind from dragging players?

if (vehicle player isKindOf 'Steerable_Parachute_F') then {private "_para" = vehicle player; moveOut player; deleteVehicle _para};

put it wherever you want the parachute to be removed (untested)

  • Like 1

Share this post


Link to post
Share on other sites
9 minutes ago, Mr H. said:

put it wherever you want the parachute to be removed

 

Nice Mr H. !  :f:

  • Like 1

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
Sign in to follow this  

×