Jump to content

lua script to get length of runway?


wolle

Recommended Posts

Is there a way, using lua code, to get the length of the runway(s) of a particular airbase?

 

In other words, can some one translate this pseudo-code into real code? Thanks!

 

airbase = Airbase.getByName("SomeAirfield")

length = airbase:getRunwayLength()

[sIGPIC][/sIGPIC]

 

Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro

Link to comment
Share on other sites

Is there a way, using lua code, to get the length of the runway(s) of a particular airbase?

Not really. You can use the getParking function to get the runway spawn points. The distance between these points is a good approximation (lower bound) of the runway length. The Moose ATIS class uses this, for example.

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

Thanks, that's a smart way of doing it. For now, however, what I'll prolly do is measure the runway length by hand in the ME, and collect them in a lua table. That obviously has the disadvantage that this table must be updated by hand when they make changes to the maps....

[sIGPIC][/sIGPIC]

 

Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro

Link to comment
Share on other sites

I'd check the airbase object description (or the database), perhaps the length of the runway(s) is listed there.

 

Like pmiceli said, if runway length is displayed in the F10 map, it means it's stored somewhere... just need to figure out where and whether it's accessible via scripting.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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