State overlay system: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(add implementation)
(→‎Implementation: Add infos for state files)
Line 17: Line 17:


== Implementation ==
== Implementation ==
=== overlay file ===
To add state overlays to your aircraft, create a folder called <code>states</code>. In there you can put your <code>$state-overlay.xml</code>. In the beginning your overlay.xml should look like this:
<pre>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<PropertyList>
  <name type="string" n="1">parking</name>
  <overlay>


To add state overlays to your aircraft, create a folder called <code>states</code>. In there you can put your <code>$state-overlay.xml</code>.
  </overlay>
Now you need to include these in your <code>$Aircraft-set.xml</code> file like this:
</PropertyList>
</pre>
Now you can put your items, which need to be set between the overlay tags. Rule of thumb is that you use the hierarchy of the property-tree's root. It speeded up my research by quite a bit, when I found out, it's possible to dump the PropertyTree with a nasal command. Open up the Nasal-console from the developer-menu and put in the following: <code>io.write_properties( path: "/home/myName/.fgfs/Export/PropTree.xml", prop: "/" );</code>
 
Beware! This outputs the '''entire''' PropertyTree! This is several thousand lines long. You might want to dump only single folders of the PropertyTree by changing the <code>"/"</code> to sth like <code>"/controls"</code> or whatever folder you want to dump. Now you can simply delete everything from that file, that you don't need and copy&paste it into your overlay.xml.
 
=== include ===
Now you need to include your overlay.xml in your <code>$Aircraft-set.xml</code> file like this:
<pre>
<pre>
<PropertyList>
<PropertyList>

Revision as of 17:51, 14 March 2017

This article is a stub. You can help the wiki by expanding it.

Objective

Status

To start FlightGear with an existing overlay add --state=statename to you command line.

For now there is no definitive list of possible states. These are my first suggestions:

  • parking (meaning cold and dark)
  • taxi (all systems running and ready to taxi)
  • take-off (standing on the runway with take-off configuration)
  • cruise (cruise configuration)
  • approach (approach configuration)

Implementation

overlay file

To add state overlays to your aircraft, create a folder called states. In there you can put your $state-overlay.xml. In the beginning your overlay.xml should look like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<PropertyList>
  <name type="string" n="1">parking</name>
  <overlay>

  </overlay>
</PropertyList>

Now you can put your items, which need to be set between the overlay tags. Rule of thumb is that you use the hierarchy of the property-tree's root. It speeded up my research by quite a bit, when I found out, it's possible to dump the PropertyTree with a nasal command. Open up the Nasal-console from the developer-menu and put in the following: io.write_properties( path: "/home/myName/.fgfs/Export/PropTree.xml", prop: "/" );

Beware! This outputs the entire PropertyTree! This is several thousand lines long. You might want to dump only single folders of the PropertyTree by changing the "/" to sth like "/controls" or whatever folder you want to dump. Now you can simply delete everything from that file, that you don't need and copy&paste it into your overlay.xml.

include

Now you need to include your overlay.xml in your $Aircraft-set.xml file like this:

<PropertyList>
  <sim>
    ...
    <state include="states/parking-overlay.xml" n="0" />
    <state include="states/taxi-overlay.xml" n="1" />
    ...
  </sim>
</PropertyList>

Background

Wayne Bragg has been working a bit with James on the state overly system.[1]

Motivation

Related

References

References