Jump to content

How to continuously get the AGL of any aircraft during mission run?


Recommended Posts

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.

VR Flight Guy in PJ Pants -- this is how I fly. We do not fly at treetop height, we fly between trees(TM)

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

My simple missions: https://forum.dcs.world/topic/284071-vr-flight-guy-in-pj-pants-simple-missions/

NSRI - National Strategy Research Institution, a fictional organisation based on wordplay of Strategic Naval Research Institution (SNRI), a fictional institution appears in Mobile Suit Gundam UC timeline.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

I don't have the "time trial" missions for F-14 but I shall give the code fragment a try.  Thank you.

 

BTW, where can I get the said mission file?

VR Flight Guy in PJ Pants -- this is how I fly. We do not fly at treetop height, we fly between trees(TM)

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

My simple missions: https://forum.dcs.world/topic/284071-vr-flight-guy-in-pj-pants-simple-missions/

NSRI - National Strategy Research Institution, a fictional organisation based on wordplay of Strategic Naval Research Institution (SNRI), a fictional institution appears in Mobile Suit Gundam UC timeline.

Link to comment
Share on other sites

HB F14A Rioni River Run Time Trial.miz

 

Its just in the F-14 missions folder.

  • Thanks 1

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

Link to comment
Share on other sites

  • Recently Browsing   0 members

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