• 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.

FSX How locking or unlocking a tailwheel, moving the joystick?

Messages
230
Country
ecuador
Hi evryone,

I try to make a tail wheel, based on the TAG c_wheel, changing the file modeldef.xml ... I am a real beginner in this field! I tried the following code that, of course, does not work ...:
Code:
<PartInfo>
        <Name>Morane_c_wheel</Name>
        <AnimLength>200</AnimLength>
        <Animation>
            <Parameter>
          <Code>
            (A:YOKE Y POSITION) -8192 &lt; if
            {0(&gt;K:TOGGLE_TAILWHEEL_LOCK)
            (A:GEAR CENTER STEER ANGLE, grads) 0 &gt; if{ (A:GEAR CENTER STEER ANGLE, grads) 0.5 * } els{ (A:GEAR CENTER STEER ANGLE, grads) 0.5 * 200 + }
            1(&gt;K:TOGGLE_TAILWHEEL_LOCK)}
            els{1(&gt;K:TOGGLE_TAILWHEEL_LOCK)}
          </Code>
            </Parameter>
        </Animation>
        <MouseRect>
            <TooltipID>TOOLTIPTEXT_STEER_ANGLE</TooltipID>
        </MouseRect>
    </PartInfo>

My tail wheel works well, but is always unlocked. My goal is that it is locked with joystick back and unlocked with the joystick pushed forward. Any idea how to make this tail wheel ...?

Thank you for your help...
 
Code:
  <Code>
  (A:YOKE Y POSITION, position) 163.83 * -8192 &lt;
  if{ (A:TAILWHEEL LOCK ON, bool)
       if{  0 (&gt;K:TOGGLE_TAILWHEEL_LOCK) }
       (A:GEAR CENTER STEER ANGLE, grads) 0 &gt;
       if{ (A:GEAR CENTER STEER ANGLE, grads) 0.5 * }
       els{ (A:GEAR CENTER STEER ANGLE, grads) 0.5 * 200 + } }
   els{ (A:TAILWHEEL LOCK ON, bool)
           if{  0 (&gt;K:TOGGLE_TAILWHEEL_LOCK) } }
  </Code>
 
As above: blank spaces are critical. It's a shame really because blank spaces are "invisible" so don't really work well as integral parts of "script code"...

For example, an opening 'if' statement requires a blank space: "if{ " and the closing requires a blank space " }"
 
Also, the original code was missing a closing curly bracket. That's also important when writing "if"s and "els"s.
 
A big thank you Bill and Heretic! I begin to understand a little better the syntax of XML ...!

But for what multiplication by 163 .83 of the value of "YOKE Y POSITION"?

I tried the code given by Heretic, it does not work: the plane turns but with the tail wheel which remains fixed ...! And influence of the stick is non-existent ...

I will explain my problem differently: here is the code representing a gauge that works to perfection:


Code:
<Gauge Name="Glock">
  <Comment>
  </Comment>
  <Update Frequency="6"/>
  <Element>
    <Select>
         <Value>
               (A:YOKE Y POSITION,percent) - 10 &lt; (A:TAILWHEEL LOCK ON,bool) 0 == &amp;&amp;
               if{ 1 (&gt;K:TOGGLE_TAILWHEEL_LOCK)  }
               (A:YOKE Y POSITION,percent) - 10 &gt; (A:TAILWHEEL LOCK ON,bool) &amp;&amp;
               if{ 1 (&gt;K:TOGGLE_TAILWHEEL_LOCK)  }
         </Value>
    </Select>
  </Element>
</Gauge>

With this installed gauge (and with animation TAG "c_wheel"), my tail wheel only works when the joystick is pushed forward. In neutral or pulled back position, the plane hardly turns and the tail wheel is fixed, locked to center position.

My question is: can we, instead of a gauge, insert or transform this code into modeldef.xml for my animation work? Remember that I'm a beginner!

Thank you for all your help ...
 
Last edited:
But for what multiplication by 163 .83 of the value of "YOKE Y POSITION"?

Hm, in retrospect, the conversion wasn't necessary.


Your working code example a bit shortened ("&amp;&amp;" = "&&" = "and"; you can simply say "!" = "NOT" instead of "0 ==") and put into Modeldef formatting:

Code:
<PartInfo>
  <Name>Morane_c_wheel</Name>
  <AnimLength>200</AnimLength>
  <Animation>
  <Parameter>
  <Code>
  (A:YOKE Y POSITION,percent) - 10 &lt; (A:TAILWHEEL LOCK ON,bool) ! and
  if{ (&gt;K:TOGGLE_TAILWHEEL_LOCK)  }
  (A:YOKE Y POSITION,percent) - 10 &gt; (A:TAILWHEEL LOCK ON,bool) and
  if{ (&gt;K:TOGGLE_TAILWHEEL_LOCK)  }
  </Code>
  </Parameter>
  </Animation>
  <MouseRect>
  <TooltipID>TOOLTIPTEXT_STEER_ANGLE</TooltipID>
  </MouseRect>
  </PartInfo>

Easy, huh?
 
...
Easy, huh?

Not really! Because, of course, if I just copy your code in my modeldef.xml, it does not work! But it always learn a little more of the xml syntax ... :D

Why xml is different between modeldef.xml and gauge ... ???

With what I understood, I modify your code like this:

Code:
 <PartInfo>
        <Name>Morane_c_wheel</Name>
        <AnimLength>200</AnimLength>
        <Animation>
            <Parameter>
          <Code>
            (A:YOKE Y POSITION,percent) - 10 &lt; (A:TAILWHEEL LOCK ON,bool) ! and
            if{ 1 (&gt;K:TOGGLE_TAILWHEEL_LOCK)  }
         
            (A:YOKE Y POSITION,percent) - 10 &gt; (A:TAILWHEEL LOCK ON,bool) and
            if{ 1 (&gt;K:TOGGLE_TAILWHEEL_LOCK)  }
         
            (A:TAILWHEEL LOCK ON, bool) !
            if { (A:GEAR CENTER STEER ANGLE, grads) 0 &gt;
                if{ (A:GEAR CENTER STEER ANGLE, grads) 0.5 * }
                els{ (A:GEAR CENTER STEER ANGLE, grads) 0.5 * 200 + } }
           </Code>
            </Parameter>
        </Animation>
        <MouseRect>
            <TooltipID>TOOLTIPTEXT_STEER_ANGLE</TooltipID>
        </MouseRect>
    </PartInfo>

But it still does not work! It seems that the TAILWHEEL LOCK ON variable is always true ...

From what I understood by reading the documents of the SDK, K : variables, as TOGGLE_TAILWHEEL_LOCK, are used for XML gauges or from SimConnect (Event IDs). Is it really possible to change its value in the modeldef.xml?
 
Last edited:
Do you have a header with a GUID for the entry?

Like this (might need a new GUID):
Code:
<Animation name="Morane_c_wheel" guid="67906B98-AFFF-4a39-A184-C49497D915FF" length="200" type="Sim" typeParam2="Morane_c_wheel" typeParam="AutoPlay" />
 
Yes...! My header :
Code:
 <Animation name="Morane_c_wheel" guid="e6c89eb3-f9e5-49f1-fd5e-df42628ec6f4" length="200" type="Sim" typeparam2="Morane_c_wheel" typeparam="AutoPlay" />
 
But it still does not work! It seems that the TAILWHEEL LOCK ON variable is always true ...
This:
Code:
1 (&gt;K:TOGGLE_TAILWHEEL_LOCK)
You keep sending "1" to the command, where "1" = TRUE

It is not necessary or desirable to input any value to "toggle" type commands.
 
Do you have "tailwheel_lock = 1" in the aircraft.cfg ([contact_points] section)?
 
Yes...! But my question is :

From what I understood by reading the documents of the SDK, K : variables, as TOGGLE_TAILWHEEL_LOCK, are used for XML gauges or from SimConnect (Event IDs). Is it really possible to change its value in the modeldef.xml?
 
First, K: are commands, not variables. That is an important distinction. Secondly, yes we can send K: commands from modeldef.xml scripts. That is the purpose of the embedded XML script in a model, to allow for mouse control of switches, levers, knobs, and other doo-dads... ;)
 
Hi Bill,

Forgive me vocabulary errors of apprendice...;)

I'm confused! The code for this gauge works perfectly: joystick forward, the tail wheel is unlock, joystick back, the tail wheel is lock:

Code:
<Gauge Name="Glock">
  <Comment>
  </Comment>
  <Update Frequency="6"/>
  <Element>
    <Select>
         <Value>
               (A:YOKE Y POSITION,percent) - 10 &lt; (A:TAILWHEEL LOCK ON,bool) 0 == &amp;&amp;
               if{ 1 (&gt;K:TOGGLE_TAILWHEEL_LOCK)  }
               (A:YOKE Y POSITION,percent) - 10 &gt; (A:TAILWHEEL LOCK ON,bool) &amp;&amp;
               if{ 1 (&gt;K:TOGGLE_TAILWHEEL_LOCK)  }
         </Value>
    </Select>
  </Element>
</Gauge>

How to reproduce this code in my modeldef.xml "Morane_c_wheel"? Or do I need another way ...?
 
Last edited:
The way I posted it in reply #6 is how you do it. The only difference between 2D gauge code and 3D animation code is the tags. What's inside the <Code> or <Value> tags is and can be 100% identical!

Are your plane's contact points correctly set up as a tail dragger?

If nothing else works, keep the working 2D gauge and just add it as an invisible gauge to the [VCockpit] section of the panel.cfg.
 
...
If nothing else works, keep the working 2D gauge and just add it as an invisible gauge to the [VCockpit] section of the panel.cfg.

To say that this code worked, I use this gauge 2D for a long time ...! I just wanted this to work without gauge 2D ... And yes, my contacts points are positioned correctly.

I will try, when I have a little more time, to make this code in my modeldef.xml ...

Thank you for your support ...
 
Heretic your code in post 6 wont work as it has a keyframe component in it, as there is no keyframes applied (an assumption)to the hidden polly it wont be processed at compile time
try this no header with a GUID needed
Code:
<PartInfo>
       <Name>Morane_c_wheel</Name>
        <Visibility>
               <Parameter>
              <Code>(A:YOKE Y POSITION,percent) - 10 &lt; (A:TAILWHEEL LOCK ON,bool) ! and
                if{ (&gt;K:TOGGLE_TAILWHEEL_LOCK)  }
                (A:YOKE Y POSITION,percent) - 10 &gt; (A:TAILWHEEL LOCK ON,bool) and
                if{ (&gt;K:TOGGLE_TAILWHEEL_LOCK)  }</Code>
               </Parameter>
        </Visibility>
   </PartInfo>
the 2d code works but it shouldnt ;) was done many moons ago when I was a rank noooob at xml :)
 
Ok Au-MaV! Thank you for your answer!

But keyframe should well be somewhere ...! Because it is an animation inspired by "c_wheel" basic from the modeldef.xml original... So where and how to place the keyframe with the code of c_wheel? Inside the same <PartInfo>?

...
the 2d code works but it shouldnt ;) was done many moons ago when I was a rank noooob at xml :)

But then, how to operate this tailwheel as I explained?

Thank you for your great help ...
 
Hi mate
All the 2d code (glock) does is toggle the tail wheel lock on and off when the joystick is pushed forward
The tail wheel animation is separate (c_wheel tag) this is animated and applied to the tail wheel as per the sdk, the animation(c_wheel) is also controlled by the contact points params so these will need to be right...So when the tail wheel lock is on the tail wheel will stay centered,when tail wheel lock is off the tail wheel will castor.How much it castors is defined in the contact points section...

The 3d code posted is if you want to hide the code in the 3d model rather than use a 2d gauge..A small polly hidden inside the model somewhere tagged with the part name used in the 3d code...
Edit
Just read your OP again and see your trying to combine the code into the default c_wheel...this just complicates things and makes it harder to debug.Keeping the default animation for c_whee and add the lock as a hidden polly or gauge. divide and concur rather than chase your tail.....wheel :)
 
Last edited:
...
The 3d code posted is if you want to hide the code in the 3d model rather than use a 2d gauge..A small polly hidden inside the model somewhere tagged with the part name used in the 3d code...
Edit
Just read your OP again and see your trying to combine the code into the default c_wheel...this just complicates things and makes it harder to debug.Keeping the default animation for c_whee and add the lock as a hidden polly or gauge. divide and concur rather than chase your tail.....wheel :)

Hi friend,

This is exactly the explanation I was expecting! Now I can say that I understand, and I will try to practice ...

I will then inform you about my success .... or not! :D

A huge thank you for your answer!
 
Back
Top