Jump to content
Sign in to follow this  
celery

HardLanding script

Recommended Posts

This is a script that lets you do some very rough landings without wrecking your helicopter in the process. It doesn't make them 100% safe however, as you will get damage if you drop from the sky tail first or insist throttling down all the way to the ground.

The best landing technique is to drop down horizontally leveled as fast as you want (keep airspeed below 80 km/h) and making sure that the front comes before the tail. When you are about to touch ground, stop throttling down. If you've done it correctly and the script is working, your helicopter has landed safely without a scratch.

Here's the code, hardlanding.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;HardLanding script by Celery

;Makes hard landings possible without damaging the helicopter

;

;Works by slowing descent velocity prior to touchdown

;You may still get damage if you land tail first or

;keep throttling down just before touching the ground

CLY_HardLandingScript=true

#start

~1

?vehicle player iskindof "Helicopter":goto "heli"

goto "start"

#heli

_chopper=vehicle player

_hurtdescent=-4.5

_maxdescent=-12

_maxspeed=80

#loop

~0.05

?player!=driver _chopper or !alive player:goto "start"

?(speed _chopper<_maxspeed) and ((getpos _chopper select 2)<2) and ((velocity _chopper select 2)<_hurtdescent) and ((velocity _chopper select 2)>_maxdescent):goto "hardlanding"

goto "loop"

#hardlanding

?player!=driver _chopper or !alive player:goto "start"

_descent=(velocity _chopper select 2)

_alt=(getpos _chopper select 2)

?_alt>0.01 and _alt<0.8 and _descent<_hurtdescent and _descent>_maxdescent:goto "slow"

?_alt>2 or _descent<_maxdescent or player!=driver _chopper or !alive player:goto "loop"

~0.01

goto "hardlanding"

#slow

_chopper setvelocity [(velocity _chopper select 0),(velocity _chopper select 1),_hurtdescent+2]

~0.5

goto "loop"

Download the test mission

Place the folder in your my documents\other profiles\username\missions folder and try it out in the editor.

Go ahead and try it! An SQF conversion would be very helpful. If we have any luck, Q/kju will make an addon version of this after that.  smile_o.gif

Share this post


Link to post
Share on other sites

lol i can land like that with about 2% dammage at 120 without the script. wink_o.gif but i guess there is those who arnt that good. But will test the script anyways tounge2.gif

Share this post


Link to post
Share on other sites

SQFied version could look like this:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;HardLanding script by Celery

;Makes hard landings possible without damaging the helicopter

;

;Works by slowing descent velocity prior to touchdown

;You may still get damage if you land tail first or

;keep throttling down just before touching the ground

CLY_HardLandingScript=true

while(true)

{

sleep(1);

if(vehicle player iskindof "Helicopter")then

{

_chopper=vehicle player;

_hurtdescent=-4.5;

_maxdescent=-12;

_maxspeed=80;

while(driver _chopper == player && alive player)

{

sleep(0.05);

if((speed _chopper<_maxspeed) && ((getpos _chopper select 2)<2) && ((velocity _chopper select 2)<_hurtdescent) && ((velocity _chopper select 2)>_maxdescent))then

{

while(driver _chopper == player && alive player)

{

scopeName "hardLanding";

_descent=(velocity _chopper select 2);

_alt=(getpos _chopper select 2);

if(_alt>0.01 && _alt<0.8 && _descent<_hurtdescent && _descent>_maxdescent)then

{

_chopper setvelocity [(velocity _chopper select 0),(velocity _chopper select 1),_hurtdescent+2];

sleep(0.5);

breakOut "hardLanding";

};

if(_alt>2 || _descent<_maxdescent)then{breakOut "hardLanding"};

sleep(0.01);

};

};

};

};

};

I did not test it though. confused_o.gif

Share this post


Link to post
Share on other sites
lol i can land like that with about 2% dammage at 120 without the script. wink_o.gif but i guess there is those who arnt that good. But will test the script anyways  tounge2.gif

It's not about how üb3r1337 someone is, this script battles the ridiculously small vertical speed at which a helicopter breaks down in a landing, a little less than 5 km/h.

SQFied version could look like this:

I get some errors from that one.

Share this post


Link to post
Share on other sites

Nice script Celery! Feared it might make choppers too tough but it's about right now. How it should be.

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">CLY_HardLandingScript=true;

while{true}do

{

sleep(1);

if(vehicle player iskindof "Helicopter")then

{

_chopper=vehicle player;

_hurtdescent=-4.5;

_maxdescent=-12;

_maxspeed=80;

while{driver _chopper == player && alive player}do

{

sleep(0.05);

if((speed _chopper<_maxspeed) && ((getpos _chopper select 2)<2) && ((velocity _chopper select 2)<_hurtdescent) && ((velocity _chopper select 2)>_maxdescent))then

{

while{driver _chopper == player && alive player}do

{

scopeName "hardLanding";

_descent=(velocity _chopper select 2);

_alt=(getpos _chopper select 2);

if(_alt>0.01 && _alt<0.8 && _descent<_hurtdescent && _descent>_maxdescent)then

{

_chopper setvelocity [(velocity _chopper select 0),(velocity _chopper select 1),_hurtdescent+2];

sleep(0.5);

breakOut "hardLanding";

};

if(_alt>2 || _descent<_maxdescent)then{breakOut "hardLanding"};

sleep(0.01);

};

};

};

};

};

This one is tested. Quite some time ago that I wrote scripts. Was more used to Java what explains all the errors in the first version. tounge2.gif

Share this post


Link to post
Share on other sites
lol i can land like that with about 2% dammage at 120 without the script. wink_o.gif but i guess there is those who arnt that good. But will test the script anyways  tounge2.gif

It's not about how üb3r1337 someone is, this script battles the ridiculously small vertical speed at which a helicopter breaks down in a landing, a little less than 5 km/h.

SQFied version could look like this:

I get some errors from that one.

Yeah i relised what you meant when i tested it tounge2.gif

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  

×