• 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 v4 P2 Audio Advisory Gauge Help

Messages
1,068
Country
us-northcarolina
I thought that I wrote this xml code properly but only the button and Tooltip work. There is no audio from the wav file. I have it in the dsd folder in SOUND in P3D V4.5 and the complete gauge is in the GAUGE folder. Here is the code:
XML:
<Gauge Name="P2Toggle" Version="1.0">
  <Element>
    <Select>
      <Value>(L:P2Toggle,bool)</Value>
         <Case Value="0"><Image Name="P2OFF.bmp" Luminous="Yes" ImageSizes="27,27"/></Case>
         <Case Value="1"><Image Name="P2ON.bmp" Luminous="Yes" ImageSizes="27,27"/></Case>
    </Select>
  </Element>

  <Mouse>
      <Cursor Type="Hand"/>
      <Tooltip>%((L:P2Toggle,bool) 1 ==)%{if}P2 (ON)%{end}%((L:P2Toggle,bool) 0 ==)%{if}P2 (OFF)%{end}</Tooltip>
      <Click>(L:P2Toggle, bool) ! (>L:P2Toggle, bool)</Click>
           </Mouse>


  <Element>
    <Select>
      <Value>
        (L:P2Toggle,bool) 1 ==
        (L:dsd_fsx_sound_id_09,number) 0 ==
        and
        if{
          2 (>L:dsd_fsx_sound_id_09,number)

          1 (>K:P2Toggle)
                    }

        (L:P2Toggle,bool) 0 ==
        (L:dsd_fsx_sound_id_09,number) 0 !=
        and
        if{
          0 (>L:dsd_fsx_sound_id_09,number)

          (>K:P2OFF)
          0 (>K:P2Toggle)
          }
      </Value>
    </Select>
  </Element>

</Gauge>

I am also attaching the complete gauge folder so that it can be tested to see where I am making a mistake.
 

Attachments

I'm not familiar with MSFS2024 but I do know that if an audio panel is not declared in the aircraft.cfg file in P3D, one of two things will happen;

- the audio file will not play
- the audio file plays but will not stop playing.
 
OK, I will check out the aircraft cfg file and see what audio files are in it and add it and see what happens. Thank you for the suggestion. I added itk to the [audio] in the aircraft.cfg but that did not make any difference even with the change from EduHir implemented.
 
Last edited:
XML:
  <Element>
    <Select>
      <Value>
        (L:P2Toggle,bool) 1 ==
        (L:dsd_fsx_sound_id_09,number) 0 ==
        and
        if{
          2 (>L:dsd_fsx_sound_id_09,number)
           }

        (L:P2Toggle,bool) 0 ==
        (L:dsd_fsx_sound_id_09,number) 0 !=
        and
        if{
          0 (>L:dsd_fsx_sound_id_09,number)
          }
      </Value>
    </Select>
  </Element>

This code should work.
NOT tested.



Did you connected "L:dsd_fsx_sound_id_09,number" to your soundfile in the dsd_fsx_xml_sound.ini file??

XML:
gauge03=.gauges\dsd_p3d_xml_sound_x64!Sound, 0, 0, 1, 1,    .\Sound\dsd\dsd_fsx_xml_sound.ini

This is from the other sound gauge.
 
OK, I thought I did everything but it still does not play the wav file. Here is the code from my Sound\dsd......
Code:
[Config]
MaxSounds=320 //10
GlobalCommands=DSDGlobals
VolumeVarIn=dsd_xml_sound_volume_in
PanVarIn=dsd_xml_sound_pan_in
VolumeVarOut=dsd_xml_sound_volume_out
PanVarOut=dsd_xml_sound_pan_out
LoopOut=dsd_xml_sound_loop_out
VolumePlayed=dsd_volume_played
PanPlayed=dsd_pan_played
LoopPlayed=dsd_loop_played

[Sounds]
Sound00=\PanelSounds\dsd_xml_00.wav, -1500
Sound01=.\Sound\dsd\dsd_xml_01.wav, -2000
Sound02=Sound\dsd\dsd_xml_02.wav
Sound03=.\Sound\dsd\dsd_xml_03.wav
Sound04=.\Sound\dsd\dsd_xml_04.wav
Sound05=CSIDL_COMMON_APPDATA\dsd\dsd_xml_05.wav
Sound06=CSIDL_COMMON_APPDATA\dsd\dsd_xml_06.wav
Sound07=.\Sound\dsd\dsd_xml_07.wav
Sound08=.\Sound\dsd\dsd_xml_08.wav
Sound09=.\Sound\dsd\dsd_xml_09.wav
Sound10=.\Sound\SimObjects\Airplanes\JF_Curtiss_C46_Mod\panel\sound\dsd_xml_10.wav,  0 
Sound100=.\Sound\dsd\dsd_xml_100.wav
Sound999=.\Sound\dsd\dsd_xml_999.wav

[LVars]
Lvar00=dsd_fsx_sound_id_00
Lvar01=dsd_fsx_sound_id_01
Lvar02=dsd_fsx_sound_id_02
Lvar03=dsd_fsx_sound_id_03
Lvar04=dsd_fsx_sound_id_04
Lvar05=dsd_fsx_sound_id_05
Lvar06=dsd_fsx_sound_id_06
Lvar07=dsd_fsx_sound_id_07
Lvar08=dsd_fsx_sound_id_08
Lvar09=dsd_fsx_sound_id_09
Lvar10=dsd_fsx_sound_id_10
LVar100=dsd_fsx_sound_id_100
LVar999=dsd_fsx_sound_id_999

[Volume_Variables]
Lvar00=Some_Volume_Control_LVAR
LVar01=MyVolumeVariable
Lvar02=Some_Other_Volume_Control_LVAR


[Pan_Variables]
Lvar01=One_Pan_Variable
Lvar03=Another_Pan_Variable

[Frequency_Variables]
Lvar00=First_Frq_Var
Lvar01=Second_Frq_Var

I don't understand what this means: Did you connected "L:dsd_fsx_sound_id_09,number" to your soundfile in the dsd_fsx_xml_sound.ini file?? All the code for the dsd_fsx_xml_sound.ini is above. I appreciate your patience with me. sound 10 is what you helped me with the last time I was stuck trying to make the "putt-putt" which works great. P3D VF4.5 when I open up the Spartan looked for dsd_xml_sound.ini and didn't find it so it substuted the "default". I copied/pasted dsd_fsx_xml_sound.ini and renamed it and it got rid of the error but I have all three of them in gauges and Sound. Will that confuse the sim? I still don't get any sound from the AAS when I open it, just lit up.
 
Last edited:
In your code, you cannot define a custom K: variable. You may use only the ones that are defined in FS. You should replace those with the L: variable if you really want that to change at that point (I assume you don’t).

If instead you are trying to use that variable to have the sound play only once, create another variable (L:P2Toggle2, bool, for example) and use that instead. You can stuff values into it using the usual > symbol.

But I think your code will not work even then, because you test for the toggle to be equal to 1, and then in that code you set it to 1. That will do nothing. Same for 0. So if you replace the K: variables, it still won’t work.

Before we get into all that, I’m wondering why you don’t put the sound statement into the Click section, the usual place for the sound to play each time you click the gauge?
 
This is your variblename "dsd_fsx_sound_id_09"
This is your wavefile "dsd_xml_09.wav"

Both connect through "Lvar09"
That's what i mean!
You did it.


Could you name me the xml - variables you use?

you use already

dsd_fsx_sound_id_10
dsd_fsx_sound_id_9

are there others?

btw i did something wrong
XML:
<Element>
    <Select>
      <Value>
        (L:P2Toggle,bool) 1 ==
        (L:dsd_fsx_sound_id_09,number) 0 ==
        and
        if{
          1 (>L:dsd_fsx_sound_id_09,number)
           }

        (L:P2Toggle,bool) 0 ==
        (L:dsd_fsx_sound_id_09,number) 0 !=
        and
        if{
          0 (>L:dsd_fsx_sound_id_09,number)
          }
      </Value>
    </Select>
  </Element>

1 (>L:dsd_fsx_sound_id_09,number) has to be 1, because the sound should be played only once.

2 (>L:dsd_fsx_sound_id_09,number) would mean, that the sound will be in a loop.
 
those are the only two variables I am using and NOW with all the messing around the Putt Putt wav is not sounding either. I am going to quit for today; try and get the putt putt to work again like you helped me with and start again fresh tomorrow morning (for me) afternoon for you. Thank you for staying up late and trying to help today. Have a good night.

Richard
 
In your code, you cannot define a custom K: variable. You may use only the ones that are defined in FS. You should replace those with the L: variable if you really want that to change at that point (I assume you don’t).

If instead you are trying to use that variable to have the sound play only once, create another variable (L:P2Toggle2, bool, for example) and use that instead. You can stuff values into it using the usual > symbol.

But I think your code will not work even then, because you test for the toggle to be equal to 1, and then in that code you set it to 1. That will do nothing. Same for 0. So if you replace the K: variables, it still won’t work.

Before we get into all that, I’m wondering why you don’t put the sound statement into the Click section, the usual place for the sound to play each time you click the gauge?
Since EduHir sent me corrected code with L variables there no more K variables being used. Even with that though, I am not getting any sounds to work at all. I am quitting today as i said below and starting fresh tomorrow.
 
To EduHir, thank you for your help and when I added your new code to the gauge, I went back and looked again at Doug Dawson's README. I didn't have the right path in the panel folder which I copied wrong. IT WORKS! When all else fails I am still and listen for some "Divine Help" which ALWAYS works. I am going to go and enjoy flying the Spartan for a while. Again thank you for taking the time to help again. Now, I am going to check out where I messed up the C46 Putt Putt with all these machinations, LOL!
 
oh boy!
i had some sleepness nights again😎
you should start writing more sound gauges😜

i'm glad you got it working👏👍
 
Back
Top