• 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 Announcement Gauges for Flaps, Altitude and more

Messages
31
Country
germany
Hi,

New to XML programming, I'm trying to develop announcement gauge for FSX based on Doug Dawson's dsd_fsx_xml_sound.gau.

The following XML syntax works with the exception that the sound does not play once, but in a loop:

Code:
<Gauge Name="Flaps Announcements" Version="1.0">
    <Element>
        <Select>
            <Value>
            (A:Sim on Ground, bool) ! if{ (A:Flaps Handle Index, number) 0 ==
                                      if{ 1 (&gt;L:FH_xml_sound_id_FU, number) } }
           
            (A:Sim on Ground, bool) ! if{ (A:Flaps Handle Index, number) 1 ==
                                      if{ 1 (&gt;L:FH_xml_sound_id_F1, number) } }
           
            (A:Sim on Ground, bool) ! if{ (A:Flaps Handle Index, number) 2 ==
                                      if{ 1 (&gt;L:FH_xml_sound_id_F2, number) } }
           
            (A:Sim on Ground, bool) ! if{ (A:Flaps Handle Index, number) 3 ==
                                      if{ 1 (&gt;L:FH_xml_sound_id_F3, number) } }
           
            (A:Sim on Ground, bool) ! if{ (A:Flaps Handle Index, number) 4 ==
                                      if{ 1 (&gt;L:FH_xml_sound_id_FF, number) } }
           
            (L:Flaps Deployed in Air, bool) ! if{ (A:Flaps Handle Index, number) 0 ==
                                              if{ 1 (&gt;L:FH_xml_sound_id_FU, number) } }
           
            (L:Flaps Deployed in Air, bool) ! if{ (A:Flaps Handle Index, number) 1 ==
                                              if{ 1 (&gt;L:FH_xml_sound_id_F1, number) } }
           
            (L:Flaps Deployed in Air, bool) ! if{ (A:Flaps Handle Index, number) 2 ==
                                              if{ 1 (&gt;L:FH_xml_sound_id_F2, number) } }
           
            (L:Flaps Deployed in Air, bool) ! if{ (A:Flaps Handle Index, number) 3 ==
                                              if{ 1 (&gt;L:FH_xml_sound_id_F3, number) } }
           
            (L:Flaps Deployed in Air, bool) ! if{ (A:Flaps Handle Index, number) 4 ==
                                              if{ 1 (&gt;L:FH_xml_sound_id_FF, number) } }
           
            (L:Retract Flaps, bool) if{ (&gt;L:FH_xml_sound_id_FU, number) }
            </Value>
        </Select>
    </Element>
</Gauge>

Any help is highly appreciated!

Best, Fritz
 

rcbarend

Resource contributor
Messages
435
Country
netherlands
Fritz,

As explained in my reponse on the flightsim.com forum, you need to check if the flaps have actually changed before writing the Lvar.

So like in:
Code:
  <Element>
  <Select>
  <Value>
 
(A:Flaps Handle Index, number) (L:PreviousFlapsHandle,number) == !          (* check if the current flaps value is different then the previous value *)
if{
   (A:Flaps Handle Index, number) 0 == if{ 1 (&gt;L:FH_xml_sound_id_FU, number) }
   (A:Flaps Handle Index, number) 1 == if{ .......
   etc etc
}
  </Value>
  </Select>
  </Element>

Followed by (at the end of the gauge)

  <Element>
  <Select>
  <Value>

(A:Flaps Handle Index, number) (&gt;L:PreviousFlapsHandle,number)

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

Rob
 
Messages
31
Country
germany
Thanks so much Rob, it's working!!!!!!!!!:rotfl:

I will now try to create gauges the same way for "Passing 10000 ft", "Localizer alive" and Glide Slope alive".:stirthepo

A real challenge for me will be the gauge "1000 ft to go".

I will post here, if I get in trouble.:banghead:

Thanks again! Best,

Fritz
 

Heretic

Resource contributor
Messages
6,830
Country
germany
Is "1000 feet to go" meant as "1000 feet above ground"?

If so, here's the code from a callout gauge I've done:
Code:
980 1000 (A:Radio Height,feet) (A:STATIC CG TO GROUND,feet) - rng
  (L:Old_Callout_1000_Played, bool) ! and
  if{ 1 (>L:Old_Callout_1000, number) }
   
  (L:Old_Callout_1000, number) 1 ==
  if{ 1 (>L:Old_Callout_1000_Played, bool) }
   
  900 1100 (A:Radio Height,feet) (A:STATIC CG TO GROUND,feet) - rng !
  (L:Old_Callout_1000_Played, bool) and
  if{ 0 (>L:Old_Callout_1000_Played, bool) }

The first bit triggers the sound, the second bit locks the callout so that it is played only once while the condition for playing it is true and the third bit unlocks the sound again after the aircraft altitude is outside of the trigger range for the sound. I use "rng" to define a range of valid altitudes because "1000 ==" is nearly impossible to achieve due to veerying sink rates during approach.
 
Messages
31
Country
germany
Rob,

Thanks for your next reply.

"1000 feet to go" is meant as "1000 ft to next approved flight level" (climbing and descending!!!). Here I am at early stage:

Code:
<Gauge Name="1000ft to go" Version="1.0">
    <Element>
        <Select>
            <Value>
            <Comment: So far I have variables only />
            (A:Indicated Altitude, feet) (A:Autopilot altitude lock var, feet) - abs 1000 &1t; (A:Autopilot altitude lock, bool)
            if{
            <Comment: I don't know yet /> 1 == if{ 1 (&gt;L:FH_xml_sound_id_64, number) }
            }
            </Value>
        </Select>
    </Element>
    <Element>
        <Select>
            <Value>
            <Comment: I don't know yet /> <Comment: I don't know yet />
            </Value>
        </Select>
    </Element>
</Gauge>

I have tried to setup the gauge "Localizer alive", which faces the problem you solved in your code above: I starts playing correctly, but continues to play until I change the frequency. How do I lock the callout so that it is played only once while the condition for playing it is true? The code so far is:

Code:
<Gauge Name="Localizer Announcement" Version="1.0">
    <Element>
        <Select>
            <Value>
            (A:HSI has localizer,bool) (L:PreviousHSIhasLocalizer,bool) == !
            if{
            (A:HSI has localizer,bool) 1 == if{ 1 (&gt;L:FH_xml_sound_id_LA, number) }
            }
            </Value>
        </Select>
    </Element>
    <Element>
        <Select>
            <Value>
            (A:HSI has localizer,bool) (L:PreviousHSIhasLocalizer,bool)
            </Value>
        </Select>
    </Element>
</Gauge>

Also, I am working on an announcement gauge replacing the none existing Co-Pilot stating "Passing 10000 ft" to get reminded on switching of Landing Lights and so on. The code I have so far is:

Code:
<Gauge Name="Passing 10000ft" Version="1.0">
    <Element>
        <Select>
            <Value>
            (A:Indicated Altitude, feet) (L:PreviousIndicatedAltitude,feet) == !
            if{
            (A:Indicated Altitude, feet) 10000 == if{ 1 (&gt;L:FH_xml_sound_id_65, number) }
            }
            </Value>
        </Select>
    </Element>
    <Element>
        <Select>
            <Value>
            (A:Indicated Altitude, feet) (L:PreviousIndicatedAltitude,feet)
            </Value>
        </Select>
    </Element>
</Gauge>

This gauge isn't playing for some reason.

Thanks for all your help!
 

rcbarend

Resource contributor
Messages
435
Country
netherlands
In both cases you forget to WRITE the Lvar in the last section.

So:
Code:
(A:Indicated Altitude, feet) (&gt;L:PreviousIndicatedAltitude,feet)
or
(A:Indicated Altitude, feet) (>L:PreviousIndicatedAltitude,feet)

instead of
(A:Indicated Altitude, feet) (L:PreviousIndicatedAltitude,feet)

Rob
 
Messages
31
Country
germany
Rob,

one little tiny bit make the difference here! Thanks so much! Those gauges are working fine now!

With regard to the "1000ft to go" I have the following now:

Code:
<Gauge Name="1000ft to go" Version="1.0">
    <Element>
        <Select>
            <Value>
            (A:Indicated Altitude, feet) (A:Autopilot altitude lock var, feet) - abs 1000 &1t; (A:Autopilot altitude lock, bool) == ! and and
            if{
            (A:Autopilot altitude lock var, feet) - abs 1000 &1t; == if{ 1 (&gt;L:FH_xml_sound_id_64, number) }
            }
            </Value>
        </Select>
    </Element>
    <Element>
        <Select>
            <Value>
            (A:Indicated Altitude, feet) (A:Autopilot altitude lock var, feet) (A:Autopilot altitude lock, bool)
            </Value>
        </Select>
    </Element>
</Gauge>

I think I need to involve a Lvar here as well. What are your thoughts?

Best Fritz
 
Messages
31
Country
germany
Rob,

would the complete code of your own callout gauge be

Code:
<Gauge Name="1000ft to ground" Version="1.0">
    <Element>
        <Select>
            <Value>
            980 1000 (A:Radio Height,feet) (A:STATIC CG TO GROUND,feet) - rng
            (L:Old_Callout_1000_Played, bool) ! and
            if{ 1 (>L:Old_Callout_1000, number) }

(L:Old_Callout_1000, number) 1 ==
  if{ 1 (>L:Old_Callout_1000_Played, bool) }
           
            900 1100 (A:Radio Height,feet) (A:STATIC CG TO GROUND,feet) - rng !
            (L:Callout_1000_Played, bool) and
            if{ 0 (>L:Callout_1000_Played, bool) }
            </Value>
        </Select>
    </Element>
<Gauge/>
 

Heretic

Resource contributor
Messages
6,830
Country
germany
Well yes, that's the code that I've posted.

You just need to change the conditions to play the sound and lock the variable.


Code:
<Gauge Name="1000ft to alt select" Version="1.0">
<Element>
<Select>
<Value>
(A:Autopilot altitude lock, bool)
if{ 980 1000 (A:Autopilot altitude lock var, feet) (A:Indicated Altitude, feet) - rng
(L:1000_To_Go_Played, bool) ! and
if{ 1 (>L:1000_To_Go, number) }

(L:1000_To_Go, number) 1 ==
if{ 1 (>L:1000_To_Go_Played, bool) }

900 1100 (A:Autopilot altitude lock var, feet) (A:Indicated Altitude, feet) - rng !
(L:1000_To_Go_Played, bool) and
if{ 0 (>L:1000_To_Go_Played, bool) } 
}
</Value>
</Select>
</Element>
<Gauge/>
 
Messages
31
Country
germany
Heretic,

Thanks for your input. I continue in English despite we are living in the same country.

I have the following three gauges now and none of them is working:

"1000ft to go"

Code:
<Gauge Name="1000ft to go" Version="1.0">
    <Element>
        <Select>
            <Value>
            (A:Autopilot altitude lock, bool)
            if{ 980 1000 (A:Autopilot altitude lock var, feet) (A:Indicated Altitude, feet) - rng
            (L:1000_To_Go_Played, bool) ! and
            if{ 1 (>L:1000_To_Go, number) }

            (L:1000_To_Go, number) 1 ==
            if{ 1 (>L:1000_To_Go_Played, bool) }

            900 1100 (A:Autopilot altitude lock var, feet) (A:Indicated Altitude, feet) - rng !
            (L:1000_To_Go_Played, bool) and
            if{ 0 (>L:1000_To_Go_Played, bool) }
            }
            </Value>
        </Select>
    </Element>
<Gauge/>

"1000ft to ground"

Code:
<Gauge Name="1000ft to ground" Version="1.0">
    <Element>
        <Select>
            <Value>
            980 1000 (A:Radio Height,feet) (A:STATIC CG TO GROUND,feet) - rng
            (L:Callout_1000_Played, bool) ! and
            if{ 1 (>L:Callout_1000, number) }
           
            (L:Callout_1000, number) 1 ==
            if{ 1 (>L:Callout_1000_Played, bool) }
           
            900 1100 (A:Radio Height,feet) (A:STATIC CG TO GROUND,feet) - rng !
            (L:Callout_1000_Played, bool) and
            if{ 0 (>L:Callout_1000_Played, bool) }
            </Value>
        </Select>
    </Element>
<Gauge/>

and "Passing 10000ft"

Code:
<Gauge Name="Passing 10000ft" Version="1.0">
    <Element>
        <Select>
            <Value>
            (A:Indicated Altitude, feet) (L:PreviousIndicatedAltitude,feet) == !
            if{
            (A:Indicated Altitude, feet) 10000 == if{ 1 (>L:Passing_10000, number) }
            }
            </Value>
        </Select>
    </Element>
    <Element>
        <Select>
            <Value>
            (A:Indicated Altitude, feet) (>L:PreviousIndicatedAltitude,feet)
            </Value>
        </Select>
    </Element>
</Gauge>

Any hint and help is highly appreciated!

Best, Fritz
 

Heretic

Resource contributor
Messages
6,830
Country
germany
Check the very last line of the first two gauges and you'll find what's wrong with them.

The third one can't work because the altitude is very seldomly exactly 10000 fett. Define a valid range as in the other gauges.


P.S: English is the primary language in this forum and in aviation in general. So unless we're running into serious communication issues we stick to it.
 
Messages
31
Country
germany
Thanks! (open your eyes, Dear...) Both gauges are working fine now!

I put a range in the "Passing 10000ft", but now it's playing permanently:

Code:
<Gauge Name="Passing 10000ft" Version="1.0">
    <Element>
        <Select>
            <Value>
            (A:Indicated Altitude, feet) (L:PreviousIndicatedAltitude,feet) == !
            if{
            9800 10200 (A:Indicated Altitude, feet) rng == if{ 1 (>L:Passing_10000, number) }
            }
            </Value>
        </Select>
    </Element>
    <Element>
        <Select>
            <Value>
            (A:Indicated Altitude, feet) (>L:PreviousIndicatedAltitude,feet)
            </Value>
        </Select>
    </Element>
</Gauge>

I probably need a second measure unit like in your gauges, but I don't know what to select.

Thanks for your advice!
 

Heretic

Resource contributor
Messages
6,830
Country
germany
How about this:

Code:
<Gauge Name="Passing 10000ft" Version="1.0">
<Element>
<Select>
<Value>
(A:Indicated Altitude, feet) 10000 &gt;
(L:Passing_10000_Played, bool) ! and
if{ 1 (>L:Passing_10000, number) 1 (>L:Passing_10000_Played, bool) } }

(A:Indicated Altitude, feet) 10000 &lt;
(L:Passing_10000_Played, bool) and
if{ 1 (>L:Passing_10000, number) 0 (>L:Passing_10000_Played, bool) } }
</Value>
</Select>
</Element>
</Gauge>
 
Messages
19
Country
spain
Thanks so much Heretic! This one works perfectly!

Hi, I have problems with the xml code "1000 to go". I think it worked but did not raise the corrected code. If you can give me the code, I appreciate it.



The code I need to work:

"1000ft to go"

Code:
<Gauge Name = "1000ft to go" Version = "1.0">
<Element>
<Select>
<Value>
(A: Autopilot altitude lock, bool)
if {980 1000 (A: Autopilot altitude lock var, feet) (A: Indicated Altitude, feet) - rng
(L: 1000_To_Go_Played, bool)! and
if {1 (> L: 1000_To_Go, number)}

(L: 1000_To_Go, number) 1 ==
if {1 (> L: 1000_To_Go_Played, bool)}

900 1100 (A: Autopilot altitude lock var, feet) (A: Indicated Altitude, feet) - rng!
(L: 1000_To_Go_Played, bool) and
if {0 (> L: 1000_To_Go_Played, bool)}
}
</ Value>
</ Select>
</ Element>
<Gauge />

I THINK YOU CHANGED SOME LINE OF THE END OF THE CODE TO WORK, BUT IT WAS NOT PUBLISHED.

Best regards,

Rubén M.
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
You have left out a ton of blank spaces which are required in XML...
...and put spaces where there should not be any!

For example, you have:
Code:
if {1 (> L: 1000_To_Go, number)}
this must be:
Code:
if{ 1 (>L:1000_To_Go, number) }
See the differences?
 

Heretic

Resource contributor
Messages
6,830
Country
germany
A) Use [code][/code] tags to wrap code.

B) A whole lot of spaces and the gauge end tags are messed up in your code.

Code:
<Gauge Name = "1000ft to go" Version = "1.0">
<Element>
<Select>
<Value>
(A: Autopilot altitude lock, bool)
if{ 980 1000 (A: Autopilot altitude lock var, feet) (A: Indicated Altitude, feet) - rng (L:1000_To_Go_Played, bool) ! and
if{ 1 (> L: 1000_To_Go, number) }

(L: 1000_To_Go, number) 1 == if{ 1 (> L: 1000_To_Go_Played, bool) }

900 1100 (A: Autopilot altitude lock var, feet) (A: Indicated Altitude, feet) - rng ! (L: 1000_To_Go_Played, bool) and
if{ 0 (> L: 1000_To_Go_Played, bool) } }
</ Value>
</ Select>
</ Element>
</Gauge>
 
Messages
19
Country
spain
Thanks for your replies!

I have error in sintax code. There is my new code:

<Gauge Name="1000ft to go" Version="1.0">
<Element>
<Select>
<Value>
(A:Autopilot altitude lock, bool)
if{ 980 1000 (A:Autopilot altitude lock var, feet) (A:Indicated Altitude, feet) - rng
(L:1000_To_Go_Played, bool) ! and
if{ 1 (>L:1000_To_Go, number) }

(L:1000_To_Go, number) 1 ==
if{ 1 (>L:1000_To_Go_Played, bool) }

900 1100 (A:Autopilot altitude lock var, feet) (A:Indicated Altitude, feet) - rng !
(L:1000_To_Go_Played, bool) and
if{ 0 (>L:1000_To_Go_Played, bool) }
}
</Value>
</Select>
</Element>
<Gauge/>

WHY DOESN´T IT WORK? I believe that I write correctly the .xml code.

PD. In other file I have the LVARS (1000_To_Go.wav) OK!!

Best regards, Rubén M
 
Top