Jump to content

Recommended Posts

Posted

Inspired by a recent "tactical low-level flight" racing "mini-game", I wish to know how to obtain continuously the AGL information for any aircraft flying. I guess the process of stop getting the information recording is not that hard.

 

Thanks in advanced.

I Fly, Therefore I Am.

One cannot go around not saying "Thank you" every time these days, can't you?

YouTube: https://www.youtube.com/channel/UCc9BDi-STaqgWsjNiHbW0fA

Posted

It is pretty simple, you need to get the position of the unit, then the height ground level is at that position, and then subtract the difference. If you have the F-14 the "time trial" missions use it to log AGL stats of your aircraft. 

if Unit.getByName('whatever') then
    local pos = Unit.getByName('whatever'):getPoint()
    local agl = pos.y - land.getHeight({x = pos.x, y = pos.z}) 
    -- do whatver you want with agl value
end
  • Thanks 2

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...