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 2: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: 5411
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Getting the altitude of a specific airport

Postby PINTO » Thu Jun 01, 2017 3: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 (link to repo) (link to thread)

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

Re: Getting the altitude of a specific airport

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

Thanks, pinto ;)
User avatar
legoboyvdlp
 
Posts: 5411
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Getting the altitude of a specific airport

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

No problemo. :)
Actively developing the MiG-21bis (link to repo) (link to thread)

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


Return to Nasal

Who is online

Users browsing this forum: No registered users and 2 guests