Howto:Transmit properties over MP: Difference between revisions

Jump to navigation Jump to search
Syntaxhighlight and indentation
(+ Related content)
(Syntaxhighlight and indentation)
Line 10: Line 10:


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


There are three types of properties that could be used:
There are three types of properties that could be used:
Line 31: Line 32:


If the MP enabled properties are to be used in animations it is preferable to create aliases for them on the remote systems so that the animations can be written using the logical properties rather than the "sim/multiplay/generic/..." ones. The example below creates the "fdm/jsbsim/propulsion/engine[x]/pitch-angle-rad" properties in the AI/MP aircraft property subtree as aliases for the MP properties. In that way the relevant animations can use the more meaningful property name "fdm/jsbsim/propulsion/engine[x]/pitch-angle-rad" instead of "sim/multiplay/generic/float[x]".
If the MP enabled properties are to be used in animations it is preferable to create aliases for them on the remote systems so that the animations can be written using the logical properties rather than the "sim/multiplay/generic/..." ones. The example below creates the "fdm/jsbsim/propulsion/engine[x]/pitch-angle-rad" properties in the AI/MP aircraft property subtree as aliases for the MP properties. In that way the relevant animations can use the more meaningful property name "fdm/jsbsim/propulsion/engine[x]/pitch-angle-rad" instead of "sim/multiplay/generic/float[x]".
 
<syntaxhighlight lang="xml">
<nasal>
<nasal>
   <load>
   <load>
   ##############################################################################
   ##############################################################################
Line 48: Line 49:
   ##############################################################################
   ##############################################################################
   </load>
   </load>
</nasal>
</nasal>
</syntaxhighlight>


Alternatively this can be done without using nasal.  Again in the model xml file:
Alternatively this can be done without using nasal.  Again in the model xml file:
 
<syntaxhighlight lang="xml">
    <params>
<params>
      <lighting>
  <lighting>
        <landing-light-l>
    <landing-light-l>
          <property>sim/multiplay/generic/float[0]</property>
      <property>sim/multiplay/generic/float[0]</property>
        </landing-light-l>
    </landing-light-l>
      </lighting>
  </lighting>
    </params>
</params>
</syntaxhighlight>


Then in the animation use:
Then in the animation use:

Navigation menu