Howto:Make an aircraft: Difference between revisions

Jump to navigation Jump to search
m (move *-set.xml descriptions to dedicated file Aircraft-set.xml)
Line 65: Line 65:


The most important file describing the aircraft's dependencies is the [[Aircraft-set.xml]] file.
The most important file describing the aircraft's dependencies is the [[Aircraft-set.xml]] file.
=== Engines/ directory ===
Only required for JSBSim aircraft. In this directory the engine and thruster/propeller files are stored.
=== Models/ directory ===
This directory contains all model related files; such as textures, models and animation files (.xml). In the -set.xml file we've set the path to one .xml file. That file should link (indirect) to each other model file (including a possible 3D cockpit) needed for the plane. The whole plane could be modeled into one file, but most developers prefer to split things up. A cockpit for example can be built up by several files, each existing of just one [[Creating instruments for FG|instrument]] or panel. This way it is easy to (re)move certain parts of the aircraft. You set up your model file like this:
<pre>
<PropertyList>
<path>Aircraft.ac</path>
<model>
  <name>Cockpit</name>
  <path>Aircraft/.../Models/cockpit.xml</path>
  <offsets>
  <x-m> -5.25</x-m>
  <y-m>  0.00</y-m>
  <z-m>  1.30</z-m>
  </offsets>
</model>
<animation>
  <type>rotate</type>
  <object-name>AileronLeft</object-name>
  <property>/controls/flight/aileron</property>
  <factor>-65</factor>
  <center>
  <x-m> 2.09</x-m>
  <y-m>-5.50</y-m>
  <z-m>-1.50</z-m>
  </center>
  <axis>
  <x>1</x>
  <y>0</y>
  <z>0</z>
  </axis>
</animation>
</PropertyList>
</pre>
The cockpit.xml file can contain a similair structure, with all the instruments as seperate models. The amount of models is not limited, nor is the amount of animations.
A detailed article about animating and models can be found in [[Howto: 3D Aircraft Models]].
A common subdirectory is the <tt>Liveries/</tt> one, which holds the livery files. See [[Livery over MP]] for more information about that subject.
=== Nasal/ directory ===
All [[Nasal]] code specific to the aircraft is placed in this directory, with the exception of some system or instrument specific Nasal. If a certain Nasal script is usefull for all aircraft (eg. weather or [[Howto: Multiplayer|multiplayer]] related) it can be placed in the <tt>[[$FG ROOT]]/Nasal</tt> directory. Nasal scripts that are useable on multiple aircraft (eg. [[Howto: Air-Air Refueling|air-air refueling]]) can be found in the <tt>[[$FG ROOT]]/Aircraft/Generic</tt> directory.
=== Sounds/ directory ===
What is an airliner without the sound of its mighty engines, or a glider without the sound of wind blowing around your face? Sounds are quite important to increase the feeling that you are actually into the simulation. In this directory all sound files that are specific for the aircarft are stored. Sounds that can be used on multiple aircraft (eg. the click of a switch or thunder) are available in the <tt>[[$FG ROOT]]/Sounds</tt> directory.
=== Tutorials/ directory ===
A helpfull feature in learning how to start the engines of a plane, flying a basic leg etc. is FlightGears tutorial system. It allows you to create a step by step tutorial that guides the user through a certain procedure. It can even indicate what switches should be pressed!
More about the tutorial system can be found at [[Tutorials]].
== Comments in XML files ==
We can place extra information in XML files, that will be ignored by FlightGear. Such as descriptions and explanations of certain XML markups, changelogs etc.
These will be mainly useful to other developers working with your XML code, for example when updating/maintaining your files, or when borrowing XML code from your work.
<pre> <!-- Last update: 09-10-2007 --></pre>
Beware that certain characters are not allowed within an XML file, even within comments, and will always cause problems.  This include the characters:
  -- < &


== Related content ==
== Related content ==

Navigation menu