• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Lvars and MultiPlayer ....

rcbarend

Resource contributor
Messages
435
Country
netherlands
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:
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 &gt;
      if{ l20 (&gt;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 &amp; 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
 
Back
Top