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

FSXA XML Knob problem

Messages
218
Country
greece
This knob is supposed to initialise the INS longitude of the A/C. It is supposed to decrease with LClick/Wheel and increase with RClick/Wheel.
The degrees are going from -180 to +180, and MOA from 0-60 for positive degrees, -60 to 0 for negatives.

The problem I'm having is in the RightSingle operation (first section):
When the input is 179deg 59MOA and I increase, it goes to 180o 0'. But after that, it doesn't switch to -180o 0'. Instead it increases to 180o 1'. Also, the animated drums don't animate, although the L:vars produce a result in the 2D debugging gauge I have. Any ideas?

Code:
<PartInfo>
 <Name>ASN-39_long_knob</Name>
    <AnimLength>360</AnimLength>
      <Animation>
        <Parameter>
          <Code>
            (L:ASN-39_Long_knob, number)
          </Code>
        </Parameter>
    </Animation>
	<MouseRect> 
		<Cursor>Hand</Cursor> 
		<MouseFlags>LeftSingle+RightSingle+Wheel+DownRepeat</MouseFlags> 
		<CallbackCode>
				(M:Event) 'LeftSingle' scmp 0 == 
				(M:Event) 'WheelDown' scmp 0 == or if{ 
					(L:ASN-39_Long_knob, number) -- 0 max (&gt;L:ASN-39_Long_knob, number) 
					(L:ASN-39_Long_knob, number) 0 == if{ 360 (&gt;L:ASN-39_Long_knob, number) } 
					(L:F4_Long_deg, number) 0 &gt; if{
						(L:F4_Long_moa, number) -- 0 max (&gt;L:F4_Long_moa, number) 
						(L:F4_Long_moa, number) 1 &lt; if{ 
							(L:F4_Long_deg, number) -- 0 max (&gt;L:F4_Long_deg, number) 
							59 (&gt;L:F4_Long_moa, number) 
						}
					} 
					(L:F4_Long_deg, number) 0 == if{
						(L:F4_Long_moa, number) -- -60 max (&gt;L:F4_Long_moa, number) 
						(L:F4_Long_moa, number) -59 &lt; if{ 
							(L:F4_Long_deg, number) 1 - (&gt;L:F4_Long_deg, number)
							0 (&gt;L:F4_Long_moa, number) 
						}
					} 
					(L:F4_Long_deg, number) 0 &lt; if{
						(L:F4_Long_moa, number) -- -60 max (&gt;L:F4_Long_moa, number) 
						(L:F4_Long_moa, number) -59 &lt; if{ 
							(L:F4_Long_deg, number) -- -180 max (&gt;L:F4_Long_deg, number) 
							0 (&gt;L:F4_Long_moa, number) 
							(L:F4_Long_deg, number) -180 == (L:F4_Long_moa, number) 0 == and if{ 180 (&gt;L:F4_Long_deg, number) } 
						}
					} 
				}
				(M:Event) 'RightSingle' scmp 0 == 
				(M:Event) 'WheelUp' scmp 0 == or if{ 
					(L:ASN-39_Long_knob, number) ++ 360 min (&gt;L:ASN-39_Long_knob, number) 
					(L:ASN-39_Long_knob, number) 360 == if{ 0 (&gt;L:ASN-39_Long_knob, number) } 
					(L:F4_Long_deg, number) 0 &gt; if{
						(L:F4_Long_moa, number) ++ 60 min (&gt;L:F4_Long_moa, number) 
						(L:F4_Long_moa, number) 59 &gt; if{ 
							(L:F4_Long_deg, number) ++ 180 min (&gt;L:F4_Long_deg, number) 
							0 (&gt;L:F4_Long_moa, number) 
							(L:F4_Long_deg, number) 179 &gt;= (L:F4_Long_moa, number) 59 &gt; and if{ -180 (&gt;L:F4_Long_deg, number) 0 (&gt;L:F4_Long_moa, number) } 
						}
					} 
					(L:F4_Long_deg, number) 0 == if{
						(L:F4_Long_moa, number) ++ 60 min (&gt;L:F4_Long_moa, number) 
						(L:F4_Long_moa, number) 59 &gt; if{ 
							(L:F4_Long_deg, number) 1 + (&gt;L:F4_Long_deg, number)
							0 (&gt;L:F4_Long_moa, number) 
						}
					} 
					(L:F4_Long_deg, number) 0 &lt; if{
						(L:F4_Long_moa, number) ++ 0 min (&gt;L:F4_Long_moa, number) 
						(L:F4_Long_moa, number) -1 &gt; if{ 
							(L:F4_Long_deg, number) ++ 0 max (&gt;L:F4_Long_deg, number) 
							-59 (&gt;L:F4_Long_moa, number) 
						}
					} 
				}
		</CallbackCode>
    </MouseRect> 
</PartInfo>
 
Last edited:
The drums should have more than two keyframes assigned to their rotation, e.g. one at 0° rotation and one at 90°, 180°,270° and 360° each.
 
The drums should have more than two keyframes assigned to their rotation, e.g. one at 0° rotation and one at 90°, 180°,270° and 360° each.

They are animated with 10kf for every 3,6deg of rotation and they don't budge, unlike the rest of them.

What worries me most though is in the knob above, I cannot get it to switch to negatives when it reaches +180. It does switch OK when the result for L:F4_Long_deg is -180.

Edit: Animation problem solved. I forgot to rename it in the declarations. Now the negation problem remains.
 
Last edited:
Hi,

I do not know if you still need this help, but you should not be using the word "or" in XML. You should be using "||". The same goes for "and", instead you should use "&amp;&amp;".
 
Last edited:
Back
Top