View Full Version : dsd_fsx_xml sound/bmp issues
swift39
02 Aug 2011, 00:24
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 > if{ 1 (>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>
delivery guy
02 Aug 2011, 02:13
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 (>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 (>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:
swift39
02 Aug 2011, 10:31
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"...
(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!
swift39
02 Aug 2011, 14:20
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
(>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 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 >
(L:PlayOnce,bool) 0 == and
if{
1 (>L:dsd_fsx_sound_id_00,number)
1 (>L:PlayOnce,bool)
}
(A:Exit Open,percent) 0 ==
(L:PlayOnce,bool) 1 == and
if{ 0 (>L:PlayOnce,bool) }
</Update>
<Element>
<Select>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
</Failures>
<Value>
(A:Exit Open,percent) 0 > 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>
swift39
02 Aug 2011, 16:40
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
delivery guy
02 Aug 2011, 17:20
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:
swift39
02 Aug 2011, 20:34
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.
ddawson
03 Aug 2011, 08:14
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
swift39
03 Aug 2011, 09:49
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!
swift39
04 Aug 2011, 08:07
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
swift39
07 Aug 2011, 11:09
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 >
(L:PlayOnce4,bool) 0 == and
if{
1 (>L:dsd_fsx_sound_id_04,number)
1 (>L:PlayOnce4,bool)
}
(A:Eng1 on fire,bool) 0 ==
(L:PlayOnce4,bool) 1 == and
if{ 0 (>L:PlayOnce4,bool) }
</Update>
<Element>
<Position X="0" Y="0"/>
<Select>
<Value>(A:Eng1 on fire, bool) >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>
swift39
06 Oct 2011, 10:05
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.
<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) >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 > (L:StopSound12,bool) ! and
if{ 1 (>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 (>L:dsd_fsx_sound_id_12,number) 1 (>L:StopSound12,bool)</Click>
</Area>
</Mouse>
</Gauge>
Thanks again for pointing me in the right direction and making sound possible.
Cheers Greg
vBulletin® v3.8.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.