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

Adding switch click sounds to switches

Messages
10
Country
us-california
I have been looking through various posts and threads trying to figure out exactly how to add switch click sounds to switches for any aircraft. I've seen in some aircrafts that there is 1 switch click sound that is used for multiple switches and I've seen it where different click sounds are used for different sized switches. I'd be happy to have just 1 sound for all the switches. I have a basic idea of how the dsd_fsx_xml_sound3.dll works (what files are needed and where to place them) I'm just unclear about how to create the .xml and I'm a little confused as to how to set up the config file. I don't know if there is a way to add the click sounds to all switches in general, or if they all have to be separate.

Thank you

Dan
 
Hey Dan,

If you are doing a freeware project, its easily done with FSUIPC. Just read through its SDK on how it works.

If you are doing a payware project, you will need one of the guys like Bill Leaming to create one for you in C++. There is alot to making the master control gauge that enacts the sounds.

I have one that I got though Bill L, its brilliant. Love it. I would buy several for different planes if he had the time to make these.


Bill
 
Why not use the same one? Oh, now I remember...

...it's because you've practically filled all 200 slots already!

I need to make some time to work on this again to expand the capacity at the very least! Of course there will be NO CHARGE for the upgrade!
 
Bill,

I would be honored to pay for them. Time is money and this is a very cool package. You should put a price tag on these, mechanize a way of mass producing them, and get about 12 packets made and offer them for sale, each one with say 20 or 50 sound slots. I'll bet you would sell out in 2 days.

Perhaps even have 3 models of versions;
* Basic; 20 sounds
* Medium; 50 sounds
* Mega pack; 100 or 200 sounds


Bill O.
 
Thanks for the replies guys. I would be more than happy to pay as well even though I'm not entirely sure as to what the "slots" are and exactly what it is you are all talking about, lol. It does sound like it would be very helpful. Could someone be so kind as to describe what exactly it is I and others would be paying for?

Oh...and since I would like to see if I can get this figured out on my own as well, could someone break this down for me:

gauge00=switchsound!switchsound, 1,1,1,1
gauge01=dsd_xml_sound3!dsd_xml_sound3, 1,1,1,1, ./Gauges/switchsound.ini

I'd like to know what each element of this represents. What is the switchsound!switchsound, is one the .dll and the other the .xml?

and for dsd_xml_sound, are they both .dll's.

What are the numbers for and what do they represent? These are a couple of the things I'm confused about.

The above is just an example, not anything that I have actually put together.
Thanks again

Dan
 
...
Oh...and since I would like to see if I can get this figured out on my own as well, could someone break this down for me:
gauge00=switchsound!switchsound, 1,1,1,1
gauge01=dsd_xml_sound3!dsd_xml_sound3, 1,1,1,1, ./Gauges/switchsound.ini
I'd like to know what each element of this represents. What is the switchsound!switchsound, is one the .dll and the other the .xml?
and for dsd_xml_sound, are they both .dll's.
What are the numbers for and what do they represent? These are a couple of the things I'm confused about.
The above is just an example, not anything that I have actually put together.
Thanks again
Dan

The four numbers at the end of the entries are PositionX, PositionY, SizeX, SizeY. They determine where, and how big, the gauge will appear on the panel.
The names to the left of the ! character are the name of the gauge file (.cab, .gau, .dll)
The name to the right of the ! character is the name of the individual gauge within the file.
In the case of the sound gauge, I used the last parameter to pass in the name of the configuration file the gauge is using. This option is only available for .gau and .dll gauges.
If you're going to work with this stuff, I strongly recommend that you download and read the SDK.

There is no way to universally add a click sound to existing gauges. Each gauge has to be programmed individually. You will not be able to modify existing .gau or .dll gauges to play sounds.

Doug
 
Thanks for all this info guys. I finally got my av master switch to click when I toggle it on. Now I have just a couple other things to sort out. It keeps repeating although I thought I had the .xml file set up correctly to tell it to only play once. I also need it to play the sound when the switch is toggled off, which it's not doing.

Here's the avmastersound.xml file:

<Gauge Name="avmastersound" Version="1.0">
<Element>
<Select>
<Value>
(A:AVIONICS MASTER SWITCH,bool) 0 &gt;
if{ 1 (>L:avmastersound, number) }
els{ 0 (>L:avmastersound, number) }
</Value>
</Select>
</Element>
</Gauge>

Please bare with me since I have not a lick of xml experience prior to this so I'm just learning as I go along here.
 
You should NOT put sound stuff in an <Element> section at all.

Think about the logic:
Code:
(A:AVIONICS MASTER SWITCH,bool) 0 &gt;
if{ 1 (>L:avmastersound, number) }
You've told the sim to play the sound repeatedly as long as the avionics master switch is on! Everything in an <Element> section is evaluated rougly 18 times per second...

There is a way to place it in an <Element> section, but that's just more work for yourself!

Put it in your <Click> section so it will only play when the mouse is used...
 
Last edited:
For me, with the gauge system (GAU) that Bill L made, I can enter in a SND string into a click zone on a gauge, for instance, and that is all that needs to be done. The GAU sound system handles it, and in FS, the sound goes off when I click on that button.

My sounds are named something like SND120.wav and are read to work just like any other command. Its just that you need the GAU or DLL gauge that works a sound system to handle that.

Here is a snip from one I am doing;


<!-- TOP CENTER -->
<Area Left="676" Top="7" Right="707" Bottom="35">
<Visible>(L:List_CascadeB,enum) 3 ==</Visible>
<Tooltip>Select BRG to HDG</Tooltip>
<Cursor Type="Hand"/>
<Click Kind="LeftSingle">
(>K:HEADING_BUG_SET)
1 (&gt;L:XMLSND67,enum) <--- this is the sound string
</Click>
</Area>


That is a mouse click zone in a 2D gauge.
 
As to clarify things, is it possible for someone to post the .xml code that I would need in this particular situation. I'm still having trouble getting the code correct? I'm still browsing through the sdk's but since I'm a visual learner, it's much easier for me to understand this once I see the correct code, and it would probably be easier for anyone else that views this thread.

@lionheart: Instead of adding switch sounds to each individual switch itself, you just add the sounds to the click area of the switch? You said that works on the 2d panel, does it work on the VC as well?
 
Last edited:
Just put this in a <Click> section for the switch!

3d switch in modeldef.xml:
Code:
      <CallbackCode>
        (>K:TOGGLE_AVIONICS_MASTER)
        1 (>L:avmastersound, number)
      </CallbackCode>

2d switch in your XML gauge:

Code:
     <Area Left="424" Top="32" Width="31" Height="36">
       <Cursor Type="Hand"/>
       <Click Kind="LeftSingle">
           (>K:TOGGLE_AVIONICS_MASTER)
           1 (>L:avmastersound, number)
       </Click>
     </Area>
 
Where do I find the modeldef.xml file? The only reference I see to that file anywhere, is in the ModelingSDK bin folder, except I don't have a bin folder in the ModelingSDK folder.

Still do not have sound. I placed the code you gave me n4gix, but I'm sure I'm missing something. Here's what I have in all my files thus far.

Panel.cfg:

gauge16=avmastersound!avmastersound, 1,1,1,1
gauge17=dsd_xml_sound3!dsd_xml_sound3, 1,1,1,1, ./Gauges/avmastersound.ini

avmastersound.ini:

[Config]
MaxSounds=5

[LVars]
Lvar00=avmastersound

[Sounds]
Sound00=./Sound/avmastersound.wav

avmastersound.xml:

<Gauge Name="avmastersound" Version="1.0">
<Element>
<Select>
<Value>
</Value>
</Select>
</Element>
<Mouse>
<Click>
<Area Left="424" Top="32" Width="31" Height="36">
<Cursor Type="Hand"/>
<Click Kind="LeftSingle">
(>K:TOGGLE_AVIONICS_MASTER)
1 (>L:avmastersound, number)
</Click>
</Area>
</Click>
</Mouse>
</Gauge>

and here's the code from the switch_avionics_master section of the modeldef.xml file that I placed in my bin folder that I created in the ModelingSDK directory:

<MouseRect>
<Cursor>Hand</Cursor>
<HelpID>HELPID_GAUGE_AVIONICS_SWITCH</HelpID>
<TooltipID>TOOLTIPTEXT_AVIONICS_SWITCH</TooltipID>
<EventID>TOGGLE_WHAT_MASTER</EventID>
<Click>
<Callback_Code>
(>K:TOGGLE_AVIONICS_MASTER)
1 (>L:avmastersound, number)
</Callback_Code>
</Click>
</MouseRect>

Any help as to what is wrong would be great, thank you.
 
Last edited:
Here is the way mine is set up; hopefully you can see how it works by that:

main panel.cfg gauge entry in a VCockpit section:

gauge32=dsd_xml_sound2!dsd_xml_sound2, 2,2,5,5,.\Gauges\dc6b_sound.ini


I use an earlier version than you, but it works the same way.

dc6b_sound.ini:

[Config]
MaxSounds=100
Lvar=km_xml_sound_id
LvarStop=km_stop_sounds

[Sounds]
Sound00=./Sound/km/km_xml_00.wav
Sound01=./Sound/km/km_xml_01.wav
Sound02=./Sound/km/km_xml_02.wav
Sound03=./Sound/km/km_xml_03.wav
Sound04=./Sound/km/km_xml_04.wav
Sound05=./Sound/km/km_xml_05.wav
Sound06=./Sound/km/km_xml_06.wav
Sound07=./Sound/km/km_xml_07.wav
Sound08=./Sound/km/km_xml_08.wav
Sound09=./Sound/km/km_xml_09.wav
Sound10=./Sound/km/km_xml_10.wav
Sound11=./Sound/xeng_damageus.wav
Sound12=./Gauges/p51_DC6/prop12.wav
Sound13=./Gauges/p51_DC6/prop34.wav


The Mouse section of a typical gauge:

<Mouse>
<Area Left="0" Right="60">
<Tooltip>BATTERY/GROUND POWER ON/OFF %((A:ELECTRICAL MAIN BUS VOLTAGE,volts))%!2.1f! volts</Tooltip>

<Cursor Type="Hand"/>
<Click>02 (&gt;L:km_xml_sound_id, number) (&gt;K:TOGGLE_MASTER_BATTERY)</Click>
</Area>
</Mouse>

This plays the km_xml_02.wav file, found inside the KM folder, which is located inside the main FS9 SOUND folder.

Hope this helps,
 
PS. If you only have a Sound00 entry in your cfg file, I think you should be loading 0 (not 1) into your L: variable.

Hope this helps,
 
Thanks for that info tgibson. Ok, so I was able to get the click sounds to work perfectly in a 2d panel, but for some reason I still can't get the sounds to play in the VC. I added the code into the modeldef.xml file that n4gix gave me but I couldn't seem to get it to work. I have seen a lot of aircraft that have click sounds in the VC, but they do not come with a modeldef.xml file, so is there a way to add the sound to the VC without it?
 
You can NOT alter the VC of a compiled model, no matter how much you wish you could.

So, unless you are making your very own model, the modeldef.xml script isn't going to help you at all.
 
Often the gauges in the VC are actually 2D gauges displayed on the VC panel polygons. These can have clicks like any other 2D gauges. They will be listed in the panel.cfg file in the VCockpit section(s).

If they are truly 3D gauges with no 2D component, then there is nothing you can do, AFAIK.

Hope this helps,
 
Oh ok, makes sense. Yeah, the main post of this tread was to find out how to add the click sounds to the actual VC switches. Unfortunately it doesn't seem to be possible to do that.
 
Back
Top