Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
CMajor28

Avoid Chopper Crash

Recommended Posts

I have this chopper on a mission flying overwatch and it seams to crash between 30 seconds and 5 minutes of starting the mission. How do I make it not crash?

Share this post


Link to post
Share on other sites

Hi CMajor28,

I made a script for my mission (in my sig') to prevent heli AI crash,

the script help the heli AI to fly more safely over any high cliffs/mountains with flyinheight 60 (minimum recommended).

But the script is an sqs.

usage:

[HeliName,60,0.1] exec "flysafe.sqs";

_fu = _this select 0;
_fhd = _this select 1;
_fdy = _this select 2;

_fhtr = "Helihempty" createvehicle (position _fu);
_fus = getPos _fu select 2;
_dy = _fdy *0.5;

#flyck
? (1 < speed _fu) : _fus = speed _fu;
_fhz = getPos _fu select 2;
_fhu = getPosasl _fu select 2;
_fhtg = getPosasl _fhtr select 2;

? (_fhd > _fhz) : _fhs = _fhz +_fus; _fudz = -_fus *_fus; _fhdz = _fhd +((_fhd -_fhz) *2);
? (_fhd < _fhz) : _fhs = _fhd +_fus; _fudz = _fhz *0.1; _fhdz = (_fhz +(_fhd *0.05)) -((_fhz -_fhd) *0.1);
_dfu = getdir _fu;
_ftx = _fhs *sin(_dfu);
_fty = _fhs *cos(_dfu);

_fhtr setpos [(getPos _fu select 0) +_ftx, (getPos _fu select 1) +_fty];
if (_fhtg +(_fhd *0.5) > _fhu) then {_fu flyinheight ((_fhtg +(_fhd *0.5)) -_fhu) +(_fhd *1.2); _fu limitSpeed _fudz} else {_fu flyinheight _fhdz; if (_fhd *0.6 > _fhz) then {_fu limitSpeed _fudz} else {_fu limitSpeed _fus *(1 +((_fhu -_fhtg) *0.002))}};
~_dy
if (alive _fu) then {goto "flyck"};

deletevehicle _fhtr;
exit

Edited by Morieza

Share this post


Link to post
Share on other sites

If you really want to control how your helicopter flies to a t, than use this method:

Share this post


Link to post
Share on other sites

Okay thanks guys. I'll play around with this stuff.

Share this post


Link to post
Share on other sites

Okay I don't know why but the script makes it so much worse. The helicopter keeps trying to land and it crashes.

Share this post


Link to post
Share on other sites

@CMajor28: please try this, (if you still interest to use that script)

add this define part above "while {alive _fu} do {" line:

_fhs = _fhd + _fus;
_fudz = _fus;
_fhdz = _fus;

find this part in the script:

if (_fhd > _fhz) then {

change to:

if (_fhd > _fhz and "MOVE" == currentCommand _fu) then {

...please feel free to optimize, tweak or expand the script.

@Harzach: thanks for converting the script to sqf, it works.

Share this post


Link to post
Share on other sites

Okay thanks guys. I'll try this when I have a chance. And it was a seek and destroy waypoint.

EDIT: I keep trying this script and I can't get it to work. It doesn't help at all. It may have something to do with the seek and destroy waypoint.

Edited by CMajor28

Share this post


Link to post
Share on other sites
Sign in to follow this  

×