Just thought to share this trick.
Maybe you are familiar with the problem that, in MultiPlayer sessions, the value of Lvars isn't transferred in the MP-protocol between the mdl code on user's flightsim PC's.
Example:
Suppose you have a custom animation in a model that you control from an XML gauge; like the visibility of a custom animation with a boolean Lvar.
What will happen in MultiPlayer:
- The animation for your own pilotted aircraft on your PC works fine.
- The animation for the other user's pilotted aircraft on their PC's works fine too.
BUT: the animation of how a remote user sets the Lvars on his PC doesn't show up visually on your PC.
Instead, the animation of the local and all remote aircraft on your PC shows up, based on how the animations for your aircraft are controlled on your PC.
Hope you understand what I mean.....
To avoid this problem, you can use the SpoilerHandle axis to transfer data between the local and remote aircraft models.
Because SpoilerHandle value IS transferred in the MP protocol.
What you could do then:
1. In the aircraft.cfg, enable the SpoilerHandle function by using:
spoiler_limit = 0.00000000001 // A very low value, so it won't affect flight behavior.
2. In a gauge that controls custom animation visibility, add:
3. In the modeldef.xml, use for Lvar2:
Now, the SpoilerHandle axis in FSX (and most probably P3Dv4) has a nice feature (or "bug" ...LoL).
Unlike other axis, you can command the SpoilerHandle axis with ANY 32-bit value; so not restricted to the usual range 0 - 16384.
And this value is properly reflected in (A:SPOILERS HANDLE POSITION,percent)
Meaning you have 32 individual bits available to tranfer information.
Of course this only works, if the Spoilers have no functional use in such a model.
Rob
Maybe you are familiar with the problem that, in MultiPlayer sessions, the value of Lvars isn't transferred in the MP-protocol between the mdl code on user's flightsim PC's.
Example:
Suppose you have a custom animation in a model that you control from an XML gauge; like the visibility of a custom animation with a boolean Lvar.
What will happen in MultiPlayer:
- The animation for your own pilotted aircraft on your PC works fine.
- The animation for the other user's pilotted aircraft on their PC's works fine too.
BUT: the animation of how a remote user sets the Lvars on his PC doesn't show up visually on your PC.
Instead, the animation of the local and all remote aircraft on your PC shows up, based on how the animations for your aircraft are controlled on your PC.
Hope you understand what I mean.....
To avoid this problem, you can use the SpoilerHandle axis to transfer data between the local and remote aircraft models.
Because SpoilerHandle value IS transferred in the MP protocol.
What you could do then:
1. In the aircraft.cfg, enable the SpoilerHandle function by using:
spoiler_limit = 0.00000000001 // A very low value, so it won't affect flight behavior.
2. In a gauge that controls custom animation visibility, add:
XML:
<Element>
<Select>
<Value>
(L:Var1,bool) 1 *
(L:Var2,bool) 2 * +
(L:Var3,bool) 4 * +
s20 (A:SPOILERS HANDLE POSITION,percent) 163.83 * near - abs 0.5 >
if{ l20 (>K:SPOILERS_SET) }
</Value>
</Select>
</Element>
3. In the modeldef.xml, use for Lvar2:
XML:
<PartInfo>
<Name>part attached to L:Var2</Name>
<Visibility>
<Parameter>
<Code>
(A:SPOILERS HANDLE POSITION,percent) 163.83 * near 2 & 2 ==
</Code>
</Parameter>
</Visibility>
</PartInfo>
Now, the SpoilerHandle axis in FSX (and most probably P3Dv4) has a nice feature (or "bug" ...LoL).
Unlike other axis, you can command the SpoilerHandle axis with ANY 32-bit value; so not restricted to the usual range 0 - 16384.
And this value is properly reflected in (A:SPOILERS HANDLE POSITION,percent)
Meaning you have 32 individual bits available to tranfer information.
Of course this only works, if the Spoilers have no functional use in such a model.
Rob
