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

Frequency changing with legacy key events doesn’t work in MSFS

Messages
3
Country
hungary
I wrote the following code in the model.xml for a knob to change the adf frequency:

<Animation name="li2adf1m" guid="1e165643-8f45-4212-76d7-ace13e4fb81c" type="Sim" typeParam="AutoPlay" typeParam2="li2adf1m" length="360"/>



<PartInfo>

<Name>li2adf1m</Name>

<Animation>

<Parameter>

<Code>

(L:adf1, number)

</Code>

<Lag>500</Lag>

</Parameter>

</Animation>

<MouseRect>

<Cursor>Hand</Cursor>

<MouseFlags>WheelUp+WheelDown+LeftSingle</MouseFlags>

<CallbackCode>

(M:Event) 'WheelUp' scmi 0 == if{ 1 (>K:ADF_10_INC) (L:adf1, number) 1 + 100 min (&gt;L:adf1, number) }

(M:Event) 'WheelDown' scmi 0 == if{ 1 (>K:ADF_10_DEC) (L:adf1, number) 1 - 0 max (&gt;L:adf1, number) }



</CallbackCode>

</MouseRect>

</PartInfo>

The knob turns but the frequency doesn’t change.

(The event is listed in MSFS SDK.)

Is there something I am doing wrong or do these codes just not work in MSFS?



thanks in advance!
 
Messages
3
Country
hungary
Ok I solved it turns out the problem was, i have had an standby adf, also i had to change the code a bit, here is the final version:

<PartInfo>
<Name>li2adf1m</Name>
<Animation>
<Parameter>
<Code>
(L:adf1, number)

</Code>
<Lag>500</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<MouseFlags>WheelUp+WheelDown+LeftSingle</MouseFlags>
<CallbackCode>
(M:Event) 'WheelUp' scmi 0 == if{ (A:ADF ACTIVE FREQUENCY:1, KHz) 100 - (>L:ADF_Freq, KHz) (L:ADF_Freq, Frequency ADF BCD32) (>K:ADF_COMPLETE_SET) (L:adf1, number) 1 + 100 min (&gt;L:adf1, number) }
(M:Event) 'WheelDown' scmi 0 == if{ (A:ADF ACTIVE FREQUENCY:1, KHz) 100 + (>L:ADF_Freq, KHz) (L:ADF_Freq, Frequency ADF BCD32) (>K:ADF_COMPLETE_SET) (L:adf1, number) 1 - 0 max (&gt;L:adf1, number) }

</CallbackCode>
</MouseRect>
</PartInfo>
 
Top