• 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 ADF Digits

Messages
189
Country
hungary
Hello

I'm working on the XML code for a Bendix KR85 ADF receiver. The knob for tuning the 100's and 1's is simple, but I need the 3rd knob which tune the 10kHz interval. My question is how can I "pick-out" the 3rd digit to control the animation from this variable : (A:ADF ACTIVE FREQUENCY:1, KHz) ?
The digits goes from 0 to 9, and the value is 0-90kHz, so it could be a 180frame animation.

Is there somedy who understand what I need? :D
 
I've tried this :

Code:
((A:ADF1 ACTIVE FREQUENCY,khz) 100 % 10 / flr 10 * )

Knob animated for 100 frames, which equal to one rotation. I can tune the ADF 10's with this code, but there is a "gap" : at 50th frame, the knob stops to rotate, and when the digit reach '0' again, the knob jumps from 50th frame to 0.
What's tje problem?
 
Hi,
it looks as though your math is ok.
For a 360 degree animation i found that i needed a few intermediate keyframes.
In your case, if you haven't tried already, you could try to animate with keyframes every 25 keyframes, or maybe every 10 keyframes since that is the output of the expression you have.

That might be the cause.

grt
Willem.
 
Last edited:
Yes, the knob is animated to one revolution, 360degrees, 100frames, with "ticks" at 0-25-50-75-100 frames.
 
In that case i would create an L:var of your expression and check with the Blackbox gauge just what the output of the expression really is.

Maybe the culprit is in there after all.

grt
Willem.
 
I wrote a custom knob that turns continuous. You say you knob repeats at 50. So just animate 0-50.
Or try out my custom code. The animation runs off itself and only uses event id's to match the game.

Code:
  <PartInfo>
    <Name>ADF_B</Name>
    <AnimLength>20</AnimLength>
    <Animation>
      <Parameter>
          <Code>(L:TenthADF, enum)</Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
    <TooltipText>ADF 10</TooltipText>
      <MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown+DownRepeat</MouseFlags>
      <CallbackCode>
      (M:Event) 'LeftSingle' scmp 0 ==
      if{ (L:TenthADF, enum) -- 0 max (>L:TenthADF, enum) (>K:ADF_10_DEC) 1 (&gt;L:XMLSND14,enum) }
      (L:TenthADF, enum) 20 == if{ 0 (>L:TenthADF, enum) }

      (M:Event) 'RightSingle' scmp 0 ==
      if{ (L:TenthADF, enum) ++  20 min (>L:TenthADF, enum) (>K:ADF_10_INC) 1 (&gt;L:XMLSND14,enum) }
      (L:TenthADF, enum) 0 == if{ 20 (>L:TenthADF, enum) }

      (M:Event) 'WheelDown' scmp 0 ==
      if{ (L:TenthADF, enum) -- 0 max (>L:TenthADF, enum) (>K:ADF_10_DEC) 1 (&gt;L:XMLSND14,enum) }
      (L:TenthADF, enum) 20 == if{ 0 (>L:TenthADF, enum) }

      (M:Event) 'WheelUp' scmp 0 ==
      if{ (L:TenthADF, enum) ++  20 min (>L:TenthADF, enum) (>K:ADF_10_INC) 1 (&gt;L:XMLSND14,enum) }
      (L:TenthADF, enum) 0 == if{ 20 (>L:TenthADF, enum) }
      </CallbackCode>
    </MouseRect>
  </PartInfo>
 
Last edited:
I put a simple plane to "display" my math with BlackBox, it shows correct values. I mean these values fit for the anim length. For the 1's and 100's knob I use a similar math, and both works fine.

1's, 100 frames

Code:
(A:ADF ACTIVE FREQUENCY:1, KHz) 10 % 10 *

100's, 160 frames

Code:
(A:ADF ACTIVE FREQUENCY:1, KHz) 100 / flr 10 * 10 -
 
Well, my logic was wrong... The knob tuning from 0 to 90kHz, and it doesn't fit to 100-frame animation. So I modified the anim to 180 frames and applied the code below, and it works ;)

Code:
(A:ADF ACTIVE FREQUENCY:1, KHz) 100 % 10 / flr 20 *
 
Well, my logic was wrong... The knob tuning from 0 to 90kHz, and it doesn't fit to 100-frame animation. So I modified the anim to 180 frames and applied the code below, and it works ;)

Damn... if you put it that way it seems "logic" :D
Still, to me it does not explain why it would work up to 50 frames and after that not anymore. :confused:

Glad you got it working, though!

grt
Willem.
 
Back
Top