1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

dsd_fsx_xml sound/bmp issues

Discussion in 'Sound' started by swift39, 2/8/11.

  1. swift39

    swift39

    Joined:
    1/8/11
    Messages:
    269
    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>
  2. delivery guy

    delivery guy

    Joined:
    31/1/10
    Messages:
    955
    Country:
    unitedstates
    I have made some changes. So this should play both.

    Or



    DG:rolleyes:
    Last edited: 2/8/11
  3. swift39

    swift39

    Joined:
    1/8/11
    Messages:
    269
    Country:
    ca-britishcolumbia
    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
  4. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,392
    Country:
    unitedstates
    "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!
  5. swift39

    swift39

    Joined:
    1/8/11
    Messages:
    269
    Country:
    ca-britishcolumbia
    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
  6. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,392
    Country:
    unitedstates
    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: 2/8/11
  7. swift39

    swift39

    Joined:
    1/8/11
    Messages:
    269
    Country:
    ca-britishcolumbia
    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
  8. delivery guy

    delivery guy

    Joined:
    31/1/10
    Messages:
    955
    Country:
    unitedstates
    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:
  9. swift39

    swift39

    Joined:
    1/8/11
    Messages:
    269
    Country:
    ca-britishcolumbia
    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.
  10. ddawson

    ddawson Resource contributor

    Joined:
    27/9/06
    Messages:
    405
    Country:
    canada
    You can't re-use the L:playOnce variable. You would have to specify a separate variable for each gauge.

    Doug
  11. swift39

    swift39

    Joined:
    1/8/11
    Messages:
    269
    Country:
    ca-britishcolumbia
    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
  12. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,392
    Country:
    unitedstates
    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!
  13. swift39

    swift39

    Joined:
    1/8/11
    Messages:
    269
    Country:
    ca-britishcolumbia
    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
  14. swift39

    swift39

    Joined:
    1/8/11
    Messages:
    269
    Country:
    ca-britishcolumbia
    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>
  15. swift39

    swift39

    Joined:
    1/8/11
    Messages:
    269
    Country:
    ca-britishcolumbia
    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

Share This Page