FlightGear configuration via XML
|This article is a stub. You can help the wiki by|
You can set up a FlightGear configuration via XML by creating a XML file that loads on to of FlightGear's other settings.
preferences.xml and autosave.xml
FlightGear installs with a configuration already set up in a XML file,
preferences.xml. Some of these settings are preserved between FlightGear sessions in another file,
autosave.xml. All settings contained in these two files get parsed by FlightGear while it starts up.
Some of the properties in
preferences.xml have an XML attribute,
userarchive, that automatically add any changes of those properties to
preferences.xml is FlightGear's main configuration file and is located within $FG_ROOT. Using the property-list format it sets up a large number of properties and their values that determines various settings of FlightGear. It more or less contain all settings that can be set. All settings contained within this file get parsed by FlightGear while it starts up.
autosave.xml is a child of
preferences.xml in user space that contains the properties with an
userarchive="y" attribute. Location depends on the operating system used:
If not present, it is generated upon launching FGFS with the options set in its parent file Preferences.xml.
Any changes you do within FlightGear's user interface are saved into
autosave.xml, so a manual edit is, in most cases, not necessary. The next time you launch FGFS, the settings stored in
autosave.xml will be used.
Adding your own settings
Rather than modifying
autosave.xml you should create your own configuration file using the same format and load it using the
--config command-line parameter. You are not limited only to use properties from those files, but can use any properties from the property tree. You can also add entirely new properties if that is needed.
When you use the
--config option to load your own configuration, it will be loaded into FlightGear just as
autosave.xml, but your configuration will be used instead. To use your own configuration add this command-line parameter either in
.fgfsrc or when you start FlightGear:
The reason to why you should not modify
autosave.xml is that the modifications can cause problems with your FlightGear installation and, unless you manually make a copy of them, they will be lost when you upgrade or uninstall FlightGear. In addition, using a configuration file from one version of FlightGear with another version may not work too well either.