Howto:Transmit properties over MP: Difference between revisions

Jump to navigation Jump to search
no edit summary
m (+cat: Property Tree)
No edit summary
Line 24: Line 24:
* '''int(eger):''' natural numbers (... -1, 0, 1, 2 ...)
* '''int(eger):''' natural numbers (... -1, 0, 1, 2 ...)
* '''string:''' alphanumeric values (PH-TST, EH01 ...).
* '''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".
'''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 separately numbered; you can have an int n="0" beside a float n="0".


The value behind alias= is the (local) path to the property that has to be transmitted. Make sure that the local property has the same type as the generic MP enabled one (note that bools are automatically converted to integers so you can map an MP enabled int to a local bool). It is important to remember to not explicitly define the property type in an alias property.
(FIXME) The value behind alias= is the (local) path to the property that has to be transmitted. Make sure that the local property has the same type as the generic MP enabled one (note that bools are automatically converted to integers so you can map an MP enabled int to a local bool). It is important to remember to not explicitly define the property type in an alias property.
 
The alias stuff apparently does not work.  This would appear to be a bug.  The consensus on the forum is that you have to use the sim/multiplay/generic/int[0] in your animations and then somewhere (in JSBSim as the output of a function for example) set sim/multiplay/generic/int[0] to the correct value for "/controls/lighting/landing-light-l". 


== In the 3d model XML file ==
== In the 3d model XML file ==
Line 49: Line 51:
   </load>
   </load>
  </nasal>
  </nasal>
Alternatively this can be done without using nasal.  Again in the model xml file:
    <params>
      <lighting>
        <landing-light-l>
          <property>sim/multiplay/generic/float[0]</property>
        </landing-light-l>
      </lighting>
    </params>
Then in the animation use:
<property alias="../../params/lighting/landing-light-l/property"/>


[[Category:Aircraft enhancement]]
[[Category:Aircraft enhancement]]
167

edits

Navigation menu