Addon
An addon is a third-party pack for FlightGear containing enhancements.
Installing an addon
Download and copy the add-on to a directory on your computer.
In the launcher, select the Add-ons page from the icon bar on the left, then find the "Add-on Module folders" section and click the Add (+) button. Select the folder where you put the add-on. Make sure the selected folder path ends with the add-on name (such as "Logbook").
Alternatively, use the command line switch --addon=/path/to/some/addon if you are not using the launcher.
Some add-ons (like Aerotow Everywhere) may require additional actions. Please also read the description of the specific add-on.
List of Addons
You can find the official repository at flightgear/fgaddon/trunk/Addons
- Add-ons Menu Aggregator - this add-on aggregates the menus of all other add-ons into one menu item.
- Aerotow Everywhere Add-on - AI towing aircraft for gliders at every airport.[1]
- AnotherGUI - An add-on that adds a new GUI style.
- ATC Chatter (ported by Torsten).
- AutoEarthView - an addon for spaceflight that automatically starts/stops Earthview based on the altitude
- Blacklist add-on - Automatically ignore pilots with certain callsigns or multiplayer models.
- Bombable - military add-on.
- Cargo Towing Addon [2] - Allow any helicopter to tow, move and place various types of models.
- FaceTrackNoIR (ported by HHS)[3] - An addon to interface this head tracker with FlightGear
- Fencemaker (Eases creating Fence-like scenery objects. Originally by VaLeo, converted to an addon by sfr) - (download)[4]
- FGCamera - (manual) - Wiki Page
- FGPlot
- Flight Planner - a flexible tool for manual flight planning and airport briefing.
- Ground Services (ported by ThomasS)[5]
- Hax!: landing evaluation and aircraft development tools, TerraSync toggler.
- Headtracker addon Helps integrate FaceTrackNoIR and opentrack with FlightGear.
- HighAirTrader An in-sim mini game in which you transport goods to different airports.
- Hoppie ACARS client - connect to Hoppie's ACARS, used on VATSIM and other networks.
- HUD Heli - additional Heli HUD's (manual) - encapsulation of HeliHUD package as an addon.
- Illuminator - configure lights attached to 3D models (e.g. taxi light, landing light or a light attached to a scenery model like a light pole) at runtime.
- KML Exporter (Google Earth) - (manual)
- Landing Rate addon [1]
- LinuxTrack Head Tracker integration - (manual)
- LittleNavMap integration - (manual)
- Logbook Add-on - logs all your flights to local file with flight analysis.[6]
- Log time-stamper add-on - Will print simulated UTC time, real local time, and/or real UTC time time-stamps at configurable intervals to the console and log.
- Mickey - Tiny HUD for mouse flying in FlightGear. Visual feedback for mouse flying, to make up for mouse's lack of self-centering.
- Mission Generator Addon [7] - Generate various random missions - Search & Rescue, Life Flight, Aerial Intrusion, Wildfire.
- MPChatImprovments Multi-key commands for Multiplayer, new features for chat,...
- Nasal Namespace Browser - heir to Nasal Browser
- noGroundDamage - Addon to temporarily disable damage after landing and for ground operations for the c172/c182
- Oscilloscope addon - Allows displaying a property of Nasal function over time
- PAR instrument - Precision Approach Radar and Ground Controlled Approach
- Rain Vector Editor - Utility to allow dynamic editing of the rain vector for the rain effect on glass.
- Ramp Marshall [8] - Ramp Marshalling for FlightGear Airports.
- RCView - Radio Control View[9]
- Red Griffin ATC - Speaking Air Traffic Controller[10]
- SimBrief import - Import flightplans, weights, fuel, and winds alof, from SimBrief.
- Spoken ATC (ported by Torsten)[11]
- Spoken GCA - An offline ground controlled approach (GCA) addon
- VFRFlight integration - (manual)
- VFR Flying Helper - (manual)
- Which Runway Add-on - dynamically determines and displays the optimal runway for take-off and landing based on current wind and airport preferences, while calculating headwind, crosswind, and tailwind components for each runway.[12]
- Wildfire [13] - Wildfire simulation.
- YASim Development Tools (by jsb)
Experimental Addons
Addons which are in the development stage/unfinished but can be used as a quick view of addon functionality
- FlightGear Missions addon - Add-on for missions/adventures code
- Model Cockpit View (abandoned)[14]
Creating an addon
There is a very simple Skeleton addon available in FGAddon to be used as a template.[15] See flightgear/fgaddon/trunk/Addons/Skeleton.
A leading slash (/) in this section indicates the base directory of the directory structure of the addon.
Minimum configuration
An addon may be installed in a directory anywhere on your hard disk and need at least two files:
/addon-config.xml- A standard PropertyList XML file to be used to populate or modify the property tree. (Same as to be used in--config=foo.xml)/addon-main.nas- The Nasal hook for the logic. This file needs a function calledmain()which will be called from the global addon initializer (addons.nas)
Additional common files
/addon-metadata.xml- A PropertyList XML file with metadata about the addon it./addon-menubar-items.xml- A PropertyList XML file describing menus to be added to the FlightGear menu bar./gui/dialogs/<my-foobar-dialog>.xml- PropertyList XML files to create custom dialogs.
Good to know
The new addon mechanism lets you add a addon-config.xml to override the settings in defaults.xml and other files.
That will allow an addon to:
- override key bindings (as in the spoken ATC addon),
- add or override autopilots and property rules,
- introduce XML state machines.
Unless your really want to add/change/remove those at runtime, this should cater for most use cases.[16]
Sound Support
Sound support is available using fgcommand's.
See also Howto:Play sound using Nasal script.
Addon initialization
On initialization fgfs takes care of:
- Through
options.cxx:[15]- Creating a property under
/addons/addon[n]/path=/path/to/some/addon - Loading
/path/to/some/addon/addon-config.xmlinto the property tree (same as--config=/path/to/some/addon/addon-config.xml) - Adding
/path/to/some/addonto the list of allowed directories (same as--fg-aircraft=/path/to/some/addon)
- Creating a property under
- Through
addons.nas:- Loading
/foo/bar/baz/addon-main.nasinto namespace__addon[ADDON_ID]__ - Calling
main(addonGhost)from/foo/bar/baz/addon-main.nas.
- Loading
Aircraft specific config (addon-hints)
Some addons need per-aircraft configuration. While addons should strive to be self-contained (ie. the addon should contain means to detect different aircraft and apply config from whithin the addon) there is also the possibility for the addon to read so called "addon-hints".
For this, a special property tree exists: /sim/addon-hints/<addon>/...
The tree is expected to be populated from the aircraft.xml file. The addon can then read the properties from a common place regardless of loaded aircraft.
<sim>
<addon-hints>
<my-addon>
...
</my-addon>
</addon-hints>
</sim>
APIs
C++ API
There is a C++ API on FlightGear's side that handle some on the add-on related tasks manly through the AddonManager(), Addon() and AddonVersion() classes.
Nasal API
The Nasal add-on API lives in the 'addons' namespace and can for example do queries to AddonManager() and read data from addons.Addon objects. It can for example compare add-on versions if there is dependencies.
See: [GitLab]/flightgear/fgdata/next/Nasal/addons.nas
References
References
|
Related content
Wiki articles
- Modules.nas
- FlightGear configuration via XML
- FlightGear configuration via XML#preferences.xml
- Nasal
- Property tree
- Properties persistent between sessions
- PropertyList XML File
Forum topics
Readme files
- $FG_ROOT/Docs/README.add-ons - An introduction to add-ons
- $FG_ROOT/Docs/README.gui - Details on how to add menus and custom dialogs.
Source code
FGAddon
- flightgear/fgaddon/trunk/Addons/Skeleton - Skeleton addon to be used as a template.
