Jump to content
Tajin

Precise chopper flyInHeight at low altitudes ?

Recommended Posts

It seems that flyInHeight values below ~10 just send the chopper in a low hover without allowing fine control.

Has anyone found a way around that?

 

 

I'm considering to run a setvelocity loop to enforce the altitude but I'd prefer to use a cleaner solution than that.

 

 

 

 

 

Background: I have a MH6 manned with Gendarmerie that I want to fly a search pattern at treetop level. The cops are sitting on the siderails with their guns/flashlights, looking for targets. I looks pretty nice at night but the effect is somewhat lost if they fly too high (or crash)

Share this post


Link to post
Share on other sites

I can't even get them to fly below 40m ATL most of the time, 30m ASL when above water...

The flyinheightASL command seems to be broken too, the chopper/plane still keeps following the terrain underneath, the command is supposed to be doing the opposite.

It takes a few tries applying the same command over and over until the chopper finally drops the altitude.

No idea what patch broke it, has been working fine back in the days.

I can clearly recall having AI choppers fly 2m above the water at full speed without any issues.

 

Non the less, have my function to force the choppers reflector light on, adds some flair and works flawless compared to while true do loops:

_veh = yourchopper;
_ID = format ["%1%2%3",time,random 10000,getposatl _veh];
[_ID, "onEachFrame", {
    params ["_veh","_ID"];
    if (alive _veh AND isEngineOn _veh) then {

    
            _veh setPilotLight true

        

    };
    if !(alive _veh) then {
        [_ID,"onEachFrame"] call BIS_fnc_removeStackedEventHandler;
    };

},[_veh,_ID]] call BIS_fnc_addStackedEventHandler;

Cheers

Share this post


Link to post
Share on other sites

Flying really low (roughly 2meters as you said) works fine... but thats about the only altitude they accept.

I'm looking for something closer to 5meters but they always either fly too low or way too high. ;)

 

From my experience its best to always use flyInHeight and flyInHeightASL in combination.

If you dont want them to follow terrain, set flyInHeight to 0 and only adjust flyInHeightASL.

 

 

ps.: I'm not using the spotlight of the chopper but the flashlighs attached to the weapons of the crew. :)

 

 

 

Anyway, I guess I'll have to do the setVelocity thing to keep the chopper at the altitude I want. :/

Share this post


Link to post
Share on other sites

Try setting flyInHeight with an infinite while loop, seemed to work for me when I last tried it.

[] spawn {
    while {true} do {
        heli flyInHeight 50;
    };
};
Yes, spawn / while true is "bad" but it works.

Share this post


Link to post
Share on other sites

Ok, I'll give that a try when I get home but somehow I doubt it will work.

 

It seems like they completely ignore any values below ~10 meters and just go into their default 2m-hovermode instead.

 

 

Well, If your idea doesn't work, I'm going to hit it with this:

_heli = _this select 0;
_alt = 8;
while (isEngineOn _heli) do {
	_h = (getPos _heli) select 2;
	_v = (velocity _heli) select 2;
	_adjust = (_alt-_h) / 5;
	_heli setVelocity ((velocity _heli) vectorAdd [0,0,_adjust]);
	sleep 0.5;
};

:icon_slap:

 

 

Lets see how that goes.

Share this post


Link to post
Share on other sites

Where exactly do I place this bit of code to keep light on?

 

Thanks

I can't even get them to fly below 40m ATL most of the time, 30m ASL when above water...

The flyinheightASL command seems to be broken too, the chopper/plane still keeps following the terrain underneath, the command is supposed to be doing the opposite.

It takes a few tries applying the same command over and over until the chopper finally drops the altitude.

No idea what patch broke it, has been working fine back in the days.

I can clearly recall having AI choppers fly 2m above the water at full speed without any issues.

 

Non the less, have my function to force the choppers reflector light on, adds some flair and works flawless compared to while true do loops:

_veh = yourchopper;
_ID = format ["%1%2%3",time,random 10000,getposatl _veh];
[_ID, "onEachFrame", {
    params ["_veh","_ID"];
    if (alive _veh AND isEngineOn _veh) then {

    
            _veh setPilotLight true

        

    };
    if !(alive _veh) then {
        [_ID,"onEachFrame"] call BIS_fnc_removeStackedEventHandler;
    };

},[_veh,_ID]] call BIS_fnc_addStackedEventHandler;

Cheers

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

×