Nasal scripting language: Difference between revisions

Jump to navigation Jump to search
m (→‎Signals: Listify)
Line 1,914: Line 1,914:


That is: a hash with elements lat/lon/elev/id/name/has_metar for the airport, and a hash with runways, each of which consists of lat/lon/length/width/heading/threshold[12]/stopway[12]. Only one side of each runway is listed -- the other can easily be deduced.
That is: a hash with elements lat/lon/elev/id/name/has_metar for the airport, and a hash with runways, each of which consists of lat/lon/length/width/heading/threshold[12]/stopway[12]. Only one side of each runway is listed -- the other can easily be deduced.
=== Positioned Object Queries ===
Several functions exist to query the navigation database of 'positioned' objects, i.e items with a defined location in the simulation world. (These objects all inherit from <tt>FGPositioned</tt> internally). The functions return either one, or a vector, of wrapped Nasal objects. These are efficient, but unlike a hash they cannot simply be <tt>debug.dump()</tt> to view all their members and methods.
When the query functions take a position, the default value is the current aircraft location. An alternative location can be supplied by passing two number (lat, lon), a Geo.Coord object, or any positioned object or waypoint retrieved from another query.
;findAirportsWithinRange
: Find all airports within a specified range (in NM) of the current position or explicit position
;findAirportsByICAO
;navinfo
;findNavaidsWithinRange
;findNavaidByFrequency
;findNavaidsByFrequency
=== <tt>flightplan</tt> ===
Function to retrieve the active flight-plan object, or load a flight plan from a file path.
Usage:
var fp = flightplan();
var fp = flightplan('/some/path/to/a/flightplan.xml');


==Built-in functions==
==Built-in functions==
580

edits

Navigation menu