by AndersG » Sun Jul 04, 2010 3:19 pm
ot-666 wrote:Currently I try to make the vmx22 downwash effect working over MP. Getting the door movements visible over mp works nice by reading the property tree for the door and writing it to “sim/multiplay/generic/float[x]” in the update loop for the use over mp.
my problem:
The downwash effects use the “position/gear-agl-m”, but if I try to get this value from the property tree with
- Code: Select all
var gear_magl = props.globals.getNode("position/gear-agl-m", 1);
I get no value. Accessing this value in the v22.xml works. Why do get no value if I try to access this property with nasal?
Where do I find a list of the properties that are supported by the mp-protocol? I had a look in the mp documentation, but I could not find anything.
The full list of MP enabled properties are in
multiplaymgr.cxx.
IMO a good way to map local properties to generic MP properties is to use aliases, e.g. from ZLT-NT-set.xml:
- Code: Select all
Aircraft/ZLT-NT/ZLT-NT-set.xml:
<sim>
...
<multiplay>
<generic>
<float n="0" alias="/fdm/jsbsim/propulsion/engine[0]/pitch-angle-rad"/>
<float n="1" alias="/fdm/jsbsim/propulsion/engine[1]/pitch-angle-rad"/>
<float n="2" alias="/fdm/jsbsim/propulsion/engine[2]/pitch-angle-rad"/>
<float n="3"
alias="/instrumentation/heading-indicator/indicated-heading-deg"/>
<float n="4"
alias="/instrumentation/attitude-indicator/indicated-pitch-deg"/>
<float n="5"
alias="/instrumentation/attitude-indicator/indicated-roll-deg"/>
...
</generic>
</multiplay>
...
</sim>
To further the readability of the animations one could also set up the corresponding aliases on the remote side so that the animations can use the logical property (here fdm/jsbsim/propulsion/engine[0]/pitch-angle-rad etc..):
- Code: Select all
Aircraft/ZLT-NT/Models/ZLT-NT.xml:
<nasal>
<load>
var rplayer = cmdarg();
print("LOAD ZLT-NT", rplayer.getPath());
# Set up property aliases for animations.
rplayer.getNode("fdm/jsbsim/propulsion/engine[0]/pitch-angle-rad", 1).
alias(rplayer.getNode("sim/multiplay/generic/float[0]"));
rplayer.getNode("fdm/jsbsim/propulsion/engine[1]/pitch-angle-rad", 1).
alias(rplayer.getNode("sim/multiplay/generic/float[1]"));
rplayer.getNode("fdm/jsbsim/propulsion/engine[2]/pitch-angle-rad", 1).
alias(rplayer.getNode("sim/multiplay/generic/float[2]"));
...
</load>
...
</nasal>
Note that the aliases are set up inside the subtree of property tree that belongs to this MP entry.
I don't know why your property misbehaves when read from Nasal - if you can see the value in the property browser, Nasal should see it too. Have you double checked the property name and path?
Cheers,
Anders
Callsign: SE-AG
Aircraft (uhm...)
: Submarine Scout, Zeppelin NT, ZF Navy free balloon,
Nordstern,
Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S.
Monitor, MFI-9B, Type UB I submarine,
Gokstad ship, Renault FT.