Howto:Transmit properties over MP

From FlightGear wiki
Revision as of 19:23, 31 August 2010 by Gijs (talk | contribs) (Feel free to extend.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This article is a stub. You can help the wiki by expanding it.

Certain properties (eg. rudder deflection, flaps setting and gear position) are transmitted by default over the multiplayer network. However there are still lots of (mostly aircraft specific) properties that are not. Due to this limitation, certain animations (eg. opening of a door or landing lights) won't be visible for a pilot's virtual-colleagues.

This wiki article will teach you how to transmit properties over a network.

-set.xml

<multiplay>
 <generic>
  <int n="0" alias="/controls/lighting/landing-light-l"/>
  <int n="1" alias="/controls/lighting/landing-light-r"/>
  <float n="0" alias="/controls/flight/flaps"/>
  <string n="0" alias="/sim/multiplay/callsign"/>
 </generic>
</multiplay>

There are three types of properties that could be used:

  • float: decimal numbers (0.12, 5.01 ...).
  • int(eger): natural numbers (... -1, 0, 1, 2 ...)
  • string: alphanumeric values (PH-TST, EH01 ...).

Note: true and false are synonyms from 1 and 0, so in those cases (boolean properties) an integer should be used. Also note that each type is seperately numbered; you can have an int n="0" besided a float n="0".

The value behind alias= is the (local) path to the property that has to be transmitted.