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

XML Gauge Sound Assistance

Messages
16
Country
unitedstates
First time posting here! I did a ton of research and worked for hours yesterday and today trying to figure this out. I'm adding my own sounds to a panel for a hydraulic spool, whine, and shut down. I've come very far and I've gotten it to work! I had it triggered by a single indicator light being extinguished, and it worked great. Now I want it to be triggered by any of 4 lights extinguishing (meaning the pump is pressurized).

I'm working off something that someone posted many years ago, this is what I have:


<Gauge Name="KeyEvent_SND.xml" Version="2.0">
<Element>
<Select>
<Value>
<!-- A HYD Pump Is On -->
(L:O04_016_LT2,number) 0 ==
(L:O04_015_LT2,number) 0 == or
(L:O04_008_LT2,number) 0 == or
(L:O04_009_LT2,number) 0 == or
if{ 1 (L:HYD_PUMP_IS_ON,number) }

<!-- Hydraulic pump start sound -->
(L:HYD_PUMP_IS_ON,number) 1 ==
(L:Hyd_Pump_State,number) 0 == and
if{ 1 (&gt;L:HYD_ON,number) 1 (>L:Hyd_Pump_State,number) }

<!-- Check if start sound has been played, then switch sound control state -->
(L:Hyd_Pump_State,number) 1 ==
(L:HYD_ON,number) 0 == and
if{ 2 (&gt;L:Hyd_Pump_State,number) }

<!-- When state is "2" play the loop sound -->
(L:Hyd_Pump_State,number) 2 ==
(L:HYD_RUNNING,number) 0 == and
if{ 2 (>L:HYD_RUNNING,number) }

<!-- End Loop and play "off" sound when switch is clicked again, then reset control variable -->
(L:HYD_PUMP_IS_ON, number) 0 ==
(L:Hyd_Pump_State,number) 2 == and
if{ 1 (&gt;L:HYD_OFF,number) 0 (&gt;L:HYD_RUNNING,number) 0 (>L:Hyd_Pump_State,number) }

</Value>
</Select>
</Element>
</Gauge>


FSUPIC is showing these VARS are running:

1317593 L:HYD_PUMP_IS_ON = 0.000000
1317593 L:Hyd_Pump_State = 0.000000
1317593 L:HYD_ON = 0.000000
1317593 L:HYD_RUNNING = 0.000000
1317593 L:HYD_OFF = 0.000000
616546 L:O04_008_LT2 = 0.000000
616546 L:O04_009_LT2 = 0.000000
616546 L:O04_016_LT2 = 0.000000
616546 L:O04_015_LT2 = 0.000000

So the lights are extinguished, why is my variable called HYD_PUMP_IS_ON not working? Instead of OR I also tried the symbol || with no luck.
Thanks in advance!


Alex
 
I found the symbol I was missing; disregard please. Couldn’t figure out how to delete the thread.

The issue I'm having now is that HYD_PUMP_IS_ON is always returning true no matter what, so my

<!-- A HYD Pump Is On -->
(L:O04_016_LT2,number) 0 ==
(L:O04_015_LT2,number) 0 == or
(L:O04_008_LT2,number) 0 == or
(L:O04_009_LT2,number) 0 == or
if{ 1 (>L:HYD_PUMP_IS_ON,number) }

section isn't working properly
 
Last edited:
The is the XML method of changing the value in a variable - in this case it is overwriting whatever value was in L:HYD_PUMP_IS_ON with the value of 1. It is used later on in the script you showed above. Sometimes you can see it written as: 1 (>L:HYD_PUMP_IS_ON,number), so your second attempt should have worked. That format is also used in the original script above.
 
The is the XML method of changing the value in a variable - in this case it is overwriting whatever value was in L:HYD_PUMP_IS_ON with the value of 1. It is used later on in the script you showed above. Sometimes you can see it written as: 1 (>L:HYD_PUMP_IS_ON,number), so your second attempt should have worked. That format is also used in the original script above.

Thanks so much for your replies, I get it now that they're interchangeable!
 
Thanks so much for your replies, I get it now that they're interchangeable!
Just a word of caution:
Code:
Using > instead of &gt;   or using <  instead of &lt;  doesnot allways work, depending on how you use it in XML code.

Examples
3 2 &gt;
if{ ………. }

is identical to 
3 2 >
if{ ………. }

However:
3 2 &lt;
if{ ………. }

is NOT the same (as you probably would expect) as 
3 2 <
if{ ………. }

The later gives  an XML syntax error.

Rob
 
Back
Top