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

P3D v2 Com Knobs and drums... WTH!

Messages
95
Country
ireland
Hey all,

I have an old style com radio in my plane with knobs and drums etc... Can't for the life of me figure why the com1 knobs (Mhz and KHz) won't rotate the com1 drums... instead, they rotate the com1 standby drums... Here's the code for the MHz knob and the second and third MHz drums... (the first drum is always a '1' so never mind that one). If somebody could look it over for an error I'd really appreciate it...

Thanks.

Skip.

Code:
<PartInfo>
    <Name>LJ35_COM1_knob_MHz</Name>
    <AnimLength>180</AnimLength>
    <Animation>
      <Parameter>
        <Code>(L:LJ35_COM1MHzKnob, number)</Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <TooltipText>COM1 MHz Knob</TooltipText>
      <MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle'  scmp 0 == if{ (L:LJ35_COM1MHzKnob, number) 0 &gt; if{ (L:LJ35_COM1MHzKnob, number) 1 - (&gt;L:LJ35_COM1MHzKnob, number) } els{ 99 (&gt;L:LJ35_COM1MHzKnob, number) }
      (L:LJ35_COM1MHzKnob, number) 10 - (&gt;L:LJ35_COM1MHzKnob, number)
      (L:LJ35_COM1MHzKnob, number) 180 &gt; if{ 0 (&gt;L:LJ35_COM1MHzKnob, number) }
      (L:LJ35_COM1MHzKnob, number) 0 &lt; if{ 180 (&gt;L:LJ35_COM1MHzKnob, number) }
      1 (&gt;K:COM_RADIO_WHOLE_DEC)
      }
        (M:Event) 'RightSingle'  scmp 0 == if{  (L:LJ35_COM1MHzKnob, number) 99 &lt; if{ (L:LJ35_COM1MHzKnob, number) 1 + (&gt;L:LJ35_COM1MHzKnob, number) } els{ 0 (&gt;L:LJ35_COM1MHzKnob, number) }
      (L:LJ35_COM1MHzKnob, number) 10 + (&gt;L:LJ35_COM1MHzKnob, number)
      (L:LJ35_COM1MHzKnob, number) 180 &gt; if{ 0 (&gt;L:LJ35_COM1MHzKnob, number) }
      (L:LJ35_COM1MHzKnob, number) 0 &lt; if{ 180 (&gt;L:LJ35_COM1MHzKnob, number) }
      1 (&gt;K:COM_RADIO_WHOLE_INC)
      }
        (M:Event) 'WheelDown'  scmp 0 == if{  (L:LJ35_COM1MHzKnob, number) 0 &gt; if{ (L:LJ35_COM1MHzKnob, number) 1 - (&gt;L:LJ35_COM1MHzKnob, number) } els{ 99 (&gt;L:LJ35_COM1MHzKnob, number) }
      (L:LJ35_COM1MHzKnob, number) 10 - (&gt;L:LJ35_COM1MHzKnob, number)
      (L:LJ35_COM1MHzKnob, number) 180 &gt; if{ 0 (&gt;L:LJ35_COM1MHzKnob, number) }
      (L:LJ35_COM1MHzKnob, number) 0 &lt; if{ 180 (&gt;L:LJ35_COM1MHzKnob, number) }
      1 (&gt;K:COM_RADIO_WHOLE_DEC)
      }
        (M:Event) 'WheelUp'  scmp 0 == if{  (L:LJ35_COM1MHzKnob, number) 99 &lt; if{ (L:LJ35_COM1MHzKnob, number) 1 + (&gt;L:LJ35_COM1MHzKnob, number) } els{ 0 (&gt;L:LJ35_COM1MHzKnob, number) }
      (L:LJ35_COM1MHzKnob, number) 10 + (&gt;L:LJ35_COM1MHzKnob, number)
      (L:LJ35_COM1MHzKnob, number) 180 &gt; if{ 0 (&gt;L:LJ35_COM1MHzKnob, number) }
      (L:LJ35_COM1MHzKnob, number) 0 &lt; if{ 180 (&gt;L:LJ35_COM1MHzKnob, number) }
      1 (&gt;K:COM_RADIO_WHOLE_INC)
      }
      </CallbackCode>
    </MouseRect>
</PartInfo>

And the drums....

Code:
<PartInfo>
    <Name>cylinder_com1_dig2</Name>
    <AnimLength>90</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:COM ACTIVE FREQUENCY:1, MHz) 10 / 10 % int 10 *</Code>
      </Parameter>
    </Animation>
</PartInfo>
 
<PartInfo>
    <Name>cylinder_com1_dig3</Name>
    <AnimLength>90</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:COM ACTIVE FREQUENCY:1, MHz) 10 % int 10 *</Code>
      </Parameter>
    </Animation>
</PartInfo>

Here's two com1 standby drums that rotate instead.....

Code:
<PartInfo>
    <Name>cylinder_com1B_dig2</Name>
    <AnimLength>90</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:COM STANDBY FREQUENCY:1, MHz) 10 / 10 % int 10 *</Code>
      </Parameter>
    </Animation>
</PartInfo>
 
<PartInfo>
    <Name>cylinder_com1B_dig3</Name>
    <AnimLength>90</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:COM STANDBY FREQUENCY:1, MHz) 10 % int 10 *</Code>
      </Parameter>
    </Animation>
</PartInfo>
 
Because your aircraft has a standby frequency. The key event you're using manipulates the standby frequency if the aircraft has one, otherwise it manipulates the active frequency.
 
Hi WarpD,

Thanks for your input. My plane has a standby com 1, (no com2 standby), which is detailed in the cfg file thus....

[Radios]
Audio.1 = 1
Audio.2 = 1
Com.1 = 1, 1
Com.2 = 1, 0
......

So what Key event should I be using if not K:COM_RADIO_WHOLE....... ??

Skip
 
Simply edit the entry to remove the standby flag. This will correct your problem:
[Radios]
Audio.1 = 1
Audio.2 = 1
Com.1 = 1, 0
Com.2 = 1, 0

You will still be able to tune your com1 standby radio using the K:events for them.
 
Many thanks indeed Fr. Bill,

If I might ask... what key event and variable should I use for the knobs and drums on a com 1 standby unit ? This frequency is dialed in with it's own knobs and drums.
I tried several from the sdk but none seemed to work.

Skip
 
There is only one event_id for COM1 standby radio tuning:
Code:
nnn (>K:COM_STBY_RADIO_SET)
where nnn is the frequency you wish to set. You will need to create custom (L:var,unit) for the knobs though.

For the drums, you will need to use this variable: (A:COM STANDBY FREQUENCY:1,Mhz)

Here is an example of mouse callback scripts for the "whole" and "decimal" knobs:
Code:
  <CallbackCode>
        (M:Event) 'LeftSingle'  scmi 0 ==
        (M:Event) 'WheelDown'  scmi 0 == or
           if{ (L:B737_Com1Stby_WHOLE_TUNE,enum) -- -1 max (>L:B737_Com1Stby_WHOLE_TUNE,enum) }

        (M:Event) 'RightSingle' scmi 0 ==
        (M:Event) 'WheelUp'    scmi 0 == or
            if{ (L:B737_Com1Stby_WHOLE_TUNE,enum) ++ 19 min (>L:B737_Com1Stby_WHOLE_TUNE,enum) }

        (L:B737_Com1Stby_WHOLE_TUNE,enum) 19 == if{ 0 (>L:B737_Com1Stby_WHOLE_TUNE,enum) }
        (L:B737_Com1Stby_WHOLE_TUNE,enum) -1 == if{ 18 (>L:B737_Com1Stby_WHOLE_TUNE,enum) }
        118 (L:B737_Com1Stby_WHOLE_TUNE,enum) + (L:Com1StbyDecimal,enum) +
        100.001 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (>K:COM_STBY_RADIO_SET)
        }
  </CallbackCode>

  <CallbackCode>
       (M:Event) 'LeftSingle'  scmi 0 ==
       (M:Event) 'WheelDown'  scmi 0 == or
           if{ (L:B737_Com1Stby_FRAC_TUNE,enum) -- -1 max (>L:B737_Com1Stby_FRAC_TUNE,enum) }
       (M:Event) 'RightSingle' scmi 0 ==
       (M:Event) 'WheelUp'  scmi 0 == or
           if{ (L:B737_Com1Stby_FRAC_TUNE,enum) ++ 40 min (>L:B737_Com1Stby_FRAC_TUNE,enum) }

       (L:B737_Com1Stby_FRAC_TUNE,enum) 40 == if{ 0 (>L:B737_Com1Stby_FRAC_TUNE,enum) }
       (L:B737_Com1Stby_FRAC_TUNE,enum) -1 == if{ 39 (>L:B737_Com1Stby_FRAC_TUNE,enum) }
       (L:B737_Com1Stby_FRAC_TUNE,enum) 0.025 * (>L:Com1StbyDecimal,enum)
       118 (L:B737_Com1Stby_WHOLE_TUNE,enum) + (L:Com1StbyDecimal,enum) + 100.001 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (>K:COM_STBY_RADIO_SET)
       }
  </CallbackCode>
 
Fr. Bill, Great stuff, many thanks indeed.

My cylinder code had the correct code, t'was your code above that fixed it all up.
May the Lord keep you in his hand but never close his fist too tight ;)

Cheers.

Skip
 
Back
Top