Jump to content
Sign in to follow this  
killerwhale

forceAltitude

Recommended Posts

Can bis introduce such command, i know you can setheight but the unit doesnt keep its altitude. This would be great for bombing runs.

Share this post


Link to post
Share on other sites

i know about this command but the unit will lose its altitude if it spots enemy or it wants to engage an enemy

Share this post


Link to post
Share on other sites

You can make a function that changes the unit's Z velocity if they are under or over the desired altitude.

Share this post


Link to post
Share on other sites

Here you go - just plop this in the aerial vehicle's init line.


_nul = [this] spawn {_veh = _this select 0; _alt = position _veh select 2; while{alive _veh} do {sleep 0.1; if(position _veh select 2 > _alt) then {_veh setVelocity [velocity _veh select 0, velocity _veh select 1, (velocity _veh select 2) -2];}; if(position _veh select 2 < _alt) then {_veh setVelocity [velocity _veh select 0, velocity _veh select 1, (velocity _veh select 2) + 2];}};};

It's very messy code, but it works :P

Share this post


Link to post
Share on other sites

aircraft setDamage 1; The poor man's aircraft forceAltitude 0;

:)

Share this post


Link to post
Share on other sites

Nice zooloo

Reduces the altitude grabs by AI, but doesn't stop an aircraft climbing.

(Tested on my C185)

Share this post


Link to post
Share on other sites
Gnat;2443155']Nice zooloo

Reduces the altitude grabs by AI' date=' but doesn't stop an aircraft climbing.

(Tested on my C185)[/quote']

Maybe change the Z velocity to be dynamic based on the difference between the desired altitude and the current altitude and have it set the Z velocity to that.

_nul = [this] spawn {_veh = _this select 0; _alt = position _veh select 2; while{alive _veh} do {sleep 0.1; _veh setVelocity [velocity _veh select 0, velocity _veh select 1, (velocity _veh select 2) + (_alt-(position _veh select 2))];};};

Share this post


Link to post
Share on other sites

but dont you think bohemia should introduce forceAltitude command just like forceSpeed command? this should make it easier

---------- Post added at 17:12 ---------- Previous post was at 17:11 ----------

or holdAltitude

Share this post


Link to post
Share on other sites
but dont you think bohemia should introduce forceAltitude command just like forceSpeed command? this should make it easier

---------- Post added at 17:12 ---------- Previous post was at 17:11 ----------

or holdAltitude

Wouldn't hurt :)

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  

×