FS2004 Gauges to trigger playing sounds

#1
Working on a panel that could trigger playing certain sounds automatically under certain aircraft conditions like flight attendant announcements before takeoff and after landing etc.

For example when parking brake is set and engines cut off it should be 'Doors to manual and cross check' etc.

I guess it could be done in connection with Doug Dawson's XML Sound Gauge. Should it be his freeware or payware version?

I'd appreciate if you could give me some leads on where to start.
 
Last edited:
#3
Talk to Doug, but AFAIK if the panel is freeware then so is the sound gauge.
Yes, It would be freeware. Can anybody help me with the correct wording for adjusting the gauge to play an announcement 'Doors to Manual'.

Should I start with values (A:SIM ON GROUND,bool) (A:GROUND VELOCITY,knots)?

I'm not actually a programmer and sometimes XML wording and logic is difficult for me to understand.

That's why I'd appreciate your help.
 
#4
show up your part of code that you working at, then some expert guys will correct it

note:
please use "insert Code" for code programming for easier when reading in this forum thread
 
#5
And we would need to know exactly the conditions when you want the sound to play. On the ground and a specific velocity is not enough.
 
#6
All said above is true, but it goes like this to start with:
Code:
(A:SIM ON GROUND,bool) (A:GROUND VELOCITY,knots) 0 == and if{play sound}
you set first your conditions (plane on ground, and standing still etc etc) and than you condition what will be done, in this case playing the sound you want.
But you need to learn some basic for coding in XML. Look for the tutorials wide available or search through the forum for a mine of code examples, that is how I started.
Best luck.
Adino
 
#7
Thanks, guys!

Well the conditions are plane on ground, engines running, and parking brake set.

Is there a way to use the above only after landing? Is it possible to use them with Fuel Consumption or whatever so it will sound only if parking brake is set only after landing?

Anyway I started with the following:

Park_xml_sound.ini
Code:
[Config]
MaxSounds=1
GlobalCommands=DSDGlobals
ErrorFlag=0
LvarStop=SoundStop

[Sounds]
Sound00=Sound\Park\park.wav

[LVars]
Lvar00=Park
Park.xml
XML:
<Gauge Name="Park" Version="1.0">
<Element>
    <Select>
      <Value>
            (A:SIM ON GROUND,bool) (A:GROUND VELOCITY,knots) 0 &gt; &amp;&amp;
            (A:Brake parking position,Bool) (A:Master Ignition Switch,bool) || &amp;&amp;
          
            if{ (L:Park,number) 0 ==
              if{ 1 (>L:Park,number)
            }
            els{ 0 (>L:Park,number) }
      </Value>
    </Select>
</Element>
</Gauge>
and panel.cfg Window00 and VirtualCockpit00 entries:

Code:
gauge98=Park!Park, 2,2,2,2
gauge99=Park_xml_sound!Park_xml_sound, 2,2,3,3,./Sound/Park/Park_xml_sound.ini
Didn't test it yet, not sure if all is fine with wording, syntax, and logic also.
 
Last edited:

ddawson

Resource contributor
#8
Park_xml_sound.ini
Code:
[Config]
MaxSounds=1
GlobalCommands=DSDGlobals
ErrorFlag=0
LvarStop=SoundStop
[Sounds]
Sound00=Sound\Park\park.wav

[LVars]
Lvar00=Park
and panel.cfg Window00 and VirtualCockpit00 entries:

Code:
gauge98=Park!Park, 2,2,2,2
gauge99=Park_xml_sound!Park_xml_sound, 2,2,3,3,./Sound/Park/Park_xml_sound.ini
Your path to the sound file is not the same as the path to the config file (no leading 'dot'). Is this what you intended?
Also, you can rename the sound gauge itself if you wish, but you can't change the internal gauge name (the part after the '!' character in the panel.cfg entry.
You will need:
gauge99=Park_xml_sound!sound, 2,2,3,3,./Sound/Park/Park_xml_sound.ini
 

rcbarend

Resource contributor
#9
Code:
<Gauge Name="Park" Version="1.0">
<Element>
    <Select>
      <Value>
            (A:SIM ON GROUND,bool) (A:GROUND VELOCITY,knots) 0 ">&gt; &amp;&amp;
            (A:Brake parking position,Bool) (A:Master Ignition Switch,bool) || &amp;&amp;
         
            if{ (L:Park,number) 0 ==
              if{ 1 (>L:Park,number)
            }
            els{ 0 (>L:Park,number) }
      </Value>
    </Select>
</Element>
</Gauge>
That doesn't work.

First, GroundVelocity > 0 and ParkingBrakes On are conflicting conditions. I assume you want the sound to be played when GroundVelocity = 0 ?
Secondly, the XML sound gauge automaticallyy set the Lvar Park to zero when the sound has finished playing.

You need to find a condition that plays the sound only once when the ParkingBrakes are being set, but ONLY after the aircraft has been moving and has stopped again.

So something like;
Code:
<Gauge Name="Park" Version="1.0">
<Element>
    <Select>
      <Value>
            (* Set the Lvar ARMED when the aircaft stops moving  *)
            (A:GROUND VELOCITY,knots) 0.1 &lt; (L:PREVIOUS GROUND VELOCITY,knots) 0.1 &gt;=  &amp;&amp;
            if{ 1 (>L:ARMED,bool) }
           (A:GROUND VELOCITY,knots)  (>L:PREVIOUS GROUND VELOCITY,knots)

            (* Play the sound when ARMED and ParkingBrakes are set *)
            (A:Brake parking position,bool)  (L:ARMED,bool)  &amp;&amp;
            if{
               1 (>L:Park,number)
               0 (>L:ARMED,bool)                 (* Resets the Lvar so the sound is played once Only untill is has moved again *)
            }
      </Value>
    </Select>
</Element>
</Gauge>
 
Top