395
edits
Philosopher (talk | contribs) m (Cleanup) |
Philosopher (talk | contribs) m (More cleanup) |
||
Line 31: | Line 31: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Property typing is optional, all properties are by default string/unspecified and are transparently converted by the property tree, but it never hurts, especially when including spaces around | Each node in a tree is specified using a single tag that can take attributes describing various things about it: | ||
<syntaxhighlight lang="xml"> | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<PropertyList> | |||
<welcome type="string">Welcome to FlightGear! This is a string as a property</welcome> | |||
</PropertyList> | |||
</syntaxhighlight> | |||
Property typing is optional, all properties are by default string/unspecified and are transparently converted by the property tree, but it never hurts, especially when including spaces around numbers: | |||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
Line 53: | Line 62: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
so that the three foo tags become foo[0], foo[1], foo[2] in the property tree | so that the three foo tags become foo[0], foo[1], foo[2] in the property tree, but you can also use explicit indexing by setting the '''n''' attribute of each tag: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
Line 67: | Line 73: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Though the above two examples are equivalent, we tend often to include "n" anyway, just to help people keep track of where they are. That's most important when there are a lot of subproperties, not in a simple list like the above. | |||
To make property settings persistent in between FlightGear sessions, use the userarchive attribute: | To make property settings persistent in between FlightGear sessions, use the userarchive attribute: | ||
Line 88: | Line 85: | ||
We can also create new | We can also create new PropertyList files by subtyping existing ones using the include attribute. For example, if someone made a DC-3 model for JSBSim, we could subclass from the YASim config file like this: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> |
edits