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

FS2004 Gauges to trigger playing sounds

Messages
98
Looks like the COM frequency setting knobs are linked to COM_RADIO Key Events assuming it's the only way to add sound to the rotating knobs. Adding it together with A:COM ACTIVE FREQUENCY, MHz works only with the battery ON. So using Key Events is the only possible option?
 

tgibson

Resource contributor
Messages
10,232
Country
us-california
Here is the code for a COM radio that works for me:

XML:
    <!-- ************************* COMM 1 ***************************** -->
    <!-- COMM 1 Coarse Freq Adj -->
<Area Left="36" Top="198" Width="24" Height="112">
        <Help ID="HELPID_RADIO_COM1"/>
        <Tooltip ID="TOOLTIPTEXT_COMM1_FREQ"/>
        <Cursor Type="DownArrow"/>
        <Click Event="COM_RADIO_WHOLE_DEC" Repeat="Yes"/>
    </Area>
    <Area Left="115" Top="198" Width="24" Height="112">
        <Help ID="HELPID_RADIO_COM1"/>
        <Tooltip ID="TOOLTIPTEXT_COMM1_FREQ"/>
        <Cursor Type="UpArrow"/>
        <Click Event="COM_RADIO_WHOLE_INC" Repeat="Yes"/>
    </Area>
   
    <!-- COMM 1 Fine Freq Adj -->
    <Area Left="60" Top="215" Width="54" Height="40">
      <Area Right="28">
        <Help ID="HELPID_RADIO_COM1"/>
        <Tooltip ID="TOOLTIPTEXT_COMM1_FREQ"/>
        <Cursor Type="DownArrow"/>
        <Click Event="COM_RADIO_FRACT_DEC" Repeat="Yes"/>
      </Area>
      <Area Left="27">
        <Help ID="HELPID_RADIO_COM1"/>
        <Tooltip ID="TOOLTIPTEXT_COMM1_FREQ"/>
        <Cursor Type="UpArrow"/>
        <Click Event="COM_RADIO_FRACT_INC" Repeat="Yes"/>
      </Area>
    </Area>
 

tgibson

Resource contributor
Messages
10,232
Country
us-california
To add sound you would change the Click Event lines to something like:

<Click Repeat="Yes">02 (&gt;L:km_xml_sound_id, number) (&gt;K:COM_RADIO_FRACT_DEC) </Click>

Change the first part of the line to whatever triggers your sound each time the knob is clicked.
 

tgibson

Resource contributor
Messages
10,232
Country
us-california
You should be able to do the same thing in the VC, AFAIK. Here is FS9 code for a 3D AP turn knob with clicks. Left click turns one way, right click turns the other.

XML:
<part>
    <name>ap_turn_knob</name>
    <animation>
        <parameter>
       <Code>50 (L:Bank Knob, number) 1.6 * + </Code>
        </parameter>
    </animation>
<MouseRect>
       <Cursor>Hand</Cursor>
       <Tooltip_Text>Left Click: LEFT Right Click: RIGHT %((L:Bank Knob, number) 3 / )%!d!</Tooltip_Text>
        <mouse_flags>LeftSingle+RightSingle</mouse_flags>
        <Callback_Code>
            (M:Event) 'LeftSingle' scmp 0 ==
            if{ (L:Bank Knob, number) 3 - (&gt;L:Bank Knob, number) 02 (&gt;L:km_xml_sound_id, number) }
            (M:Event) 'RightSingle' scmp 0 ==
            if{ (L:Bank Knob, number) 3 + (&gt;L:Bank Knob, number) 02 (&gt;L:km_xml_sound_id, number) }
          </Callback_Code>
    </MouseRect>
</part>
 
Messages
98
Need to add sound in VC to VOR / ADF needle select switches of a dual RMI. Are there any A: type variables used for the switches?

The 2D gauge I have uses Gvars. When I add sound to the 2D Gvars it works in VC also but I'd like to know if any AVar could be used instead like I did previously for a transponder. The 2D part with sound:

XML:
            <Click>(G:Var1,bool) ++ (>G:Var1,bool) 1 (>L:sound,number) (G:Var1,bool) 4 == if{ 0 (>G:Var1,bool) }</Click>
         </Area>
      <Area Left="161" Top="178" Width="45" Height="45">
         <Help ID="VOR Select"/>
            <Cursor Type="Hand"/>
            <Click>(G:Var2,bool) ++ (>G:Var2,bool) 1 (>L:sound,number) (G:Var2,bool) 4 == if{ 0 (>G:Var2,bool) }</Click>
 

tgibson

Resource contributor
Messages
10,232
Country
us-california
I don't think there are any A: variables for that. The default DC-3 uses an L: variable to throw the select switches, for example (L:RMI 1 Select, enum). Then that value determines whether the Radio Compass needles respond to ADF or NAV:

XML:
         <Value>
            (L:RMI 1 Select, enum)
            0 ==
            if{
              (A:ADF Radial:1,radians)
              pi 2 / -
              }
            els{ (A:NAV1 Radial,radians)
              (L:RMI Card Bearing, degrees) dgrd
              -
              pi 2 / +
              }
         </Value>

Hope this helps,
 
Top