Board index FlightGear Development Nasal

Getting the altitude of a specific airport

Nasal is the scripting language of FlightGear.

Getting the altitude of a specific airport

Postby legoboyvdlp » Thu Jun 01, 2017 3:30 pm

Hey there,
I was just wondering: is there a way to get the specific altitude of an airport?

I have a property called "/FMGC/internal/dep-arpt". I want to use the value of that to search for the altitude of the airport associated for it.

That is, if the value of /FMGC/internal/dep-arpt is "EGAA", is there any way to automatically get the value "269"?

Many thanks,
Jonathan
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Getting the altitude of a specific airport

Postby PINTO » Thu Jun 01, 2017 4:23 pm

Code: Select all
var airport_elevation = airportinfo(getprop("/FMGC/internal/dep-arpt")).elevation; # returns elevation in meters


Check http://wiki.flightgear.org/Nasal_librar ... info.28.29 for specifics.
Actively developing the MiG-21bis (github repo) (forum thread) (dev discord) (fg wiki)

http://opredflag.com is an active flightgear dogfighting community (using a system that isn’t bombable)
User avatar
PINTO
 
Posts: 966
Joined: Wed Oct 21, 2015 7:28 pm
Callsign: pinto
Version: stable
OS: Win10

Re: Getting the altitude of a specific airport

Postby legoboyvdlp » Thu Jun 01, 2017 4:59 pm

Thanks, pinto ;)
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Getting the altitude of a specific airport

Postby PINTO » Thu Jun 01, 2017 5:19 pm

No problemo. :)
Actively developing the MiG-21bis (github repo) (forum thread) (dev discord) (fg wiki)

http://opredflag.com is an active flightgear dogfighting community (using a system that isn’t bombable)
User avatar
PINTO
 
Posts: 966
Joined: Wed Oct 21, 2015 7:28 pm
Callsign: pinto
Version: stable
OS: Win10


Return to Nasal

Who is online

Users browsing this forum: No registered users and 3 guests