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

dsd_fsx_xml sound/bmp issues

Messages
278
Country
ca-britishcolumbia
Hi,
I was wondering if someone could help with this. I have Doug Dawsons latest dsd_fsx_xml_418. I finally have it creating sound in an anunnciator i rebuilt, but i either have sound and no bmp change or bmp and no sound. I would like to have the sound play once, as it plays continousesly right now, and the light come on. Any ideas or solutions would be greatly appreaciated.

Thank Greg

Here is the gauge file:

<Gauge Name="annunciator_Cargo_Ramp" Version="1.0">
<Size X="118" Y="59"/>
<Element>
<Select>
<Value>(A:Exit Open, position) 0.1 &gt; if{ 1 (&gt;L:dsd_fsx_sound_id_00,number) }</Value>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
</Failures>
<Case Value="0">
<Image Name="Cargo_Closed.bmp" UseTransparency="Yes"/>
</Case>
<Case Value="1">
<Image Name="Cargo_Open.bmp" Bright="Yes" UseTransparency="Yes"/>
</Case>
</Select>
</Element>
</Gauge>
 
I have made some changes. So this should play both.

<Gauge Name="annunciator_Cargo_Ramp" Version="1.0">
<Size X="118" Y="59"/>
<Element>
<Select>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
</Failures>

<Value>(A:Exit OPEN:1, Percent Over 100) if{ 1 (&gt;L:dsd_fsx_sound_id_00,number) }</Value>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
</Failures>
<Case Value="0">
<Image Name="Cargo_Closed.bmp" Bright="Yes" />
</Case>
<Case Value="1">
<Image Name="Cargo_Open.bmp" Bright="Yes" />
</Case>
</Select>
</Element>
</Gauge>

Or

<Gauge Name="annunciator_Cargo_Ramp" Version="1.0">
<Size X="118" Y="59"/>
<Element>
<Select>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
</Failures>

<Value>(A:CANOPY OPEN, Percent Over 100) if{ 1 (&gt;L:dsd_fsx_sound_id_00,number) }</Value>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
</Failures>
<Case Value="0">
<Image Name="Cargo_Closed.bmp" Bright="Yes" />
</Case>
<Case Value="1">
<Image Name="Cargo_Open.bmp" Bright="Yes" />
</Case>
</Select>
</Element>
</Gauge>



DG:rolleyes:
 
Last edited:
No Luck

Thanks for your time. Unfortuantly never worked, The annun wouldn't work at all. Unless I'm missing something, probably completely obvious. I seem to remember having this problem when I orginally started this annunciator and ended up with the Exit Open code to make it light up. I have two annunciaters, one for the cargo ramp and one for the side doors. Both ended up using the Exit Open code. Once again thanks for ur time, i'll keep playing with it. More than open to any other ideas u may have, new to this programming stuff.

Greg
 
"Percent Over 100" is not a valid entry for "units"...

Code:
(A:Exit OPEN:1,percent)

And for heaven's sake, use the # icon to wrap the script in the
Code:
 tags, not the [quote] tags!
 
Thanks Bill

Ok that half worked. I have the sound, but the light does not come on. I am new to all this, and although up for the challange find it frustrating. I need to learn a lot more before I will ever profiecient, but be patient I will get there.

Anyway, this is where i am at now, any suggestions, or errors?

<Gauge Name="annunciator_Cargo_Ramp" Version="1.0">
<Size X="118" Y="59"/>
<Element>
<Select>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
</Failures>
<Value>(A:Exit Open,percent) if{ 1
(&gt;L:dsd_fsx_sound_id_00,number) }</Value>
<Case Value="0">
<Image Name="Cargo_Closed.bmp"
UseTransparency="Yes"/>
</Case>
<Case Value="1">
<Image Name="Cargo_Open.bmp" Bright="Yes"
UseTransparency="Yes"/>
</Case>
</Select>
</Element>
</Gauge>

Please bear with me as really this is all new to me. Also how do i get the sound to play only once. Thanks again i appreacite this.

Greg
 
You need to separate the "sound control" from the <Value> condition. Since you need for it to evaluate to either 1 or 0 (TRUE or FALSE) so the correct bitmap will be displayed, you cannot evaluate for the "sound" in the same statement.

So, the "sound control" will have to be placed elsewhere. The simplest place is in an <Update> section, where anything there will be evaluated every gauge cycle.

To play a sound "only once" you need a "flag" to let the script know that the sound has been played. That's what the first few lines do.

You also need a way to "reset" the "flag" so that the next time the door is opened, the sound will play again! :D

By the way, notice how much easier it is to read the XML script when you wrap it in the
Code:
 tags?

Try this:

[CODE]
<Gauge Name="annunciator_Cargo_Ramp" Version="1.0">
  <Size X="118" Y="59"/>
  <Update Hidden="Yes">
    (A:Exit Open,percent) 0 &gt;
    (L:PlayOnce,bool) 0 == and
     if{ 
      1 (&gt;L:dsd_fsx_sound_id_00,number) 
      1 (&gt;L:PlayOnce,bool)
      }

    (A:Exit Open,percent) 0 ==
    (L:PlayOnce,bool) 1 == and
    if{ 0 (&gt;L:PlayOnce,bool) }
  </Update>
  <Element>
    <Select>
      <Failures>
        <SYSTEM_ELECTRICAL_PANELS Action="0"/>
      </Failures>
      <Value>
        (A:Exit Open,percent) 0 &gt; if{ 1 } els{ 0 }
      </Value>
      <Case Value="0">
        <Image Name="Cargo_Closed.bmp"
        UseTransparency="Yes"/>
      </Case>
      <Case Value="1">
        <Image Name="Cargo_Open.bmp" Bright="Yes"
        UseTransparency="Yes"/>
      </Case>
    </Select>
  </Element>
</Gauge>
 
Last edited:
Thank you so much

Thanks Bill, thats amazing, you are truly a xml god, or should be anyway. works perfectly, as i'm sure you knew that already. Once again thanks. I owe you. Got to get back to it and add the other annunciators.

Greg
 
I wonder why the sdk put percent over 100. i normally put just percent.
Sorry for the percent over 100 Swift39.

Anyways that was Swift39's first mistake.
Then i added failures.

I had no idea he wanted the sound to play once. I a use macro gauge for that. I added your code to my templates.
I need to practice writing these codes using updates......

Bill is a god when it comes to xml coding!

DG:eek:
 
AWWWWWW So Frustrating

No Problem delivery guy.

Ok i must admit I either suck at xml or im stupid. I added the same code to another annunciater (Exit 1). When i tested in fsx, both sounds when the guage activated played cont...

I renamed the sound file so each guage had a seperate file, but no avail. messed with coding a bit, either didn't work or played regardless or not at all. If I may ask what am I missing? i have about 10 annunciators that I would like to put sound to. Please Help lost in a sea of xml code.
 
No Problem delivery guy.
Ok i must admit I either suck at xml or im stupid. I added the same code to another annunciater (Exit 1). When i tested in fsx, both sounds when the guage activated played cont...

You can't re-use the L:PlayOnce variable. You would have to specify a separate variable for each gauge.

Doug
 
numbering variable?

Thanks Doug,

just a quick question can u number the variables

ie:

(L:PlayOnce1,bool) or (L:1PlayOnce,bool)

and is there a list of L variables i can get my hands on

thanks Greg
 
Thanks Doug,

just a quick question can u number the variables

ie:

(L:PlayOnce1,bool) or (L:1PlayOnce,bool)

and is there a list of L variables i can get my hands on

thanks Greg

Of course you can renumber them, that would make them "unique."

Since L:vars are by definition "self-made," no such list would ever be possible! :rotfl:

Make up some name that is both consistent and makes sense to you!
 
Thanks Everyone

Thanks for everything, still struggling a bit with some coding, but am making progress. Three working. The sound file is awesome, sound in the cockpit, wow. I cant thank you guys enough.

Greg
 
how do i have the guage reset itself

Sorry guys, I am struggling a bit to get the guages to reset themselves after activiation. Once the sound is played it is done and wont re-activate. Or maybe a mouse click reset idk at a lose any help appreacited

heres the code anything wrong:

<Gauge Name="SA_Fire_Light_Left" Version="1.0">
<Size X="118" Y="59"/>
<Update Hidden="Yes">(A:Eng1 on fire,bool) 0 &gt;
(L:PlayOnce4,bool) 0 == and
if{
1 (&gt;L:dsd_fsx_sound_id_04,number)
1 (&gt;L:PlayOnce4,bool)
}

(A:Eng1 on fire,bool) 0 ==
(L:PlayOnce4,bool) 1 == and
if{ 0 (&gt;L:PlayOnce4,bool) }
</Update>
<Element>
<Position X="0" Y="0"/>
<Select>
<Value>(A:Eng1 on fire, bool) &gt;1</Value>
<Case Value="0">
<Image Name="Fire_Warning_Off.bmp" ImageSizes="118,59"/>
</Case>
<Case Value="1">
<Image Name="Fire_Warning_On.bmp" ImageSizes="118,59"/>
</Case>
</Select>
</Element>
<Mouse>
<Tooltip>"Fire Warning"</Tooltip>
</Mouse>
</Gauge>
 
Final Result

I could never get the Fire Light to reactivate. But decided it wouldn't need to be. In in real life you would not relight the engine after a fire situation until it was serviced or replaced (reload Aircraft). So on that theory went with a Alarm and silence button.

Code:
<Gauge Name="SA_Fire_Light_Left" Version="1.0">
<Size X="118" Y="59"/>
<Element>
<Position X="0" Y="0"/>
<Select>
<Value>(A:Eng1 on fire, bool) &gt;1</Value>
<Case Value="0">
<Image Name="Fire_Warning_Off.bmp" ImageSizes="118,59"/>
</Case>
<Case Value="1">
<Image Name="Fire_Warning_On.bmp" ImageSizes="118,59"/>
</Case>
</Select>
</Element>
<Element>
<Select>
<Value>(A:Eng1 on fire,bool) 0 &gt; (L:StopSound12,bool) ! and 
if{ 1 (&gt;L:dsd_fsx_sound_id_12,number) }</Value>
</Select>
</Element>
<Mouse>
<Area Left="0" Top="0" Width="118" Height="59">
<Cursor Type="Hand"/>
<Tooltip>FIRE Silence</Tooltip>
<Click>
0 (&gt;L:dsd_fsx_sound_id_12,number) 1 (&gt;L:StopSound12,bool)</Click>
</Area>
</Mouse>
</Gauge>

Thanks again for pointing me in the right direction and making sound possible.

Cheers Greg
 
Back
Top