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

ADF animation

Messages
51
Country
canada
I'm trying to create an ADF tuner with knobs and dials representing units, tenths, hundreds and thousands.
I've used the same animation for the knobs and dials at 360 keyframes and a mousrect which seems to be ok. I'll post an example below (for the 100 units).
Where I'm struggling is with the <code> section of the animation.
The knobs and dials do turn on mouse clicks and wheel operation, but they're all over the map as far as reading the ADF setting.
Can anyone please explain the sequence after the (A:ADF ACTIVE FREQUENCY:1,KHz), eg what do the following mean in the code : "1000 / 10 % 36 * dnor" and why cant I get this to work !!!
Any help greatly appreciated.
Gary

<Animation name="knob_adf1_100" guid="2f86ea62-bfff-4d7f-a6c0-09e441e3ab7d" length="360" type="Sim" typeParam2="knob_adf1_100" typeParam="AutoPlay" />

<PartInfo>
<Name>knob_adf1_100</Name>
<AnimLength>360</AnimLength>
<Animation>
<Parameter>
<Code>(A:ADF ACTIVE FREQUENCY:1,KHz) 1000 / 10 % 36 * dnor</Code>
</Parameter>
</Animation>
</PartInfo>

<PartInfo>
<Name>mrec_knob_adf1_100</Name>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipID>TOOLTIPTEXT_ADF1_FREQ</TooltipID>
<MouseFlags>WheelDown+WheelUp+LeftDrag+LeftSingle</MouseFlags>
<CallbackJumpDragging>
<XMovement>
<Delta>10</Delta>
<EventIdInc>ADF_100_DEC</EventIdInc>
<EventIdDec>ADF_100_INC</EventIdDec>
</XMovement>
</CallbackJumpDragging>
</MouseRect>
</PartInfo>
 
1000 / is divide the frequency by 1000
10 % is 10 modulo, which is the remainder of the number obtained above divided by 10 (56 modulo 10 is 6)
36* multiplies the result by 36.
Dnor takes any number larger than 360 and subtracts 360 from that.

So since frequencies run between 100 and 1700:

1700 / 1000 =1.7
10 modulo = 1.7
1.7 * 36 =61.2

So that’s the largest key frame you can get.

But many people ignore the top band and limit it to 999. In that case the largest key frame would be 36.

100 / 1000 =0.1
10 modulo = 0.1
0.1 * 36 =3.6

So that’s the smallest key frame.

What you want is a number that goes between 0 and 360, so you have a full rotation. Or between 36 and 360, allowing for frequency numbers between 0 and 100 for appearance sake.

With the 36 * in there, that means a number between 0 and 10. That’s why they used modulo 10, which gives you that result.

But I don’t think that the 1000/ is going to give you what you want? If you limit it to 999, then 100 / would give a maximum key frame of 360, as desired.

That said, my understanding of this kind of stuff is limited and I could be all wrong?

Hope this helps,
 
Back
Top