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

FSX:SE Select statement to select bitmap within an element

Messages
45
Country
australia
Hi all,

I'm finding it a little bit challenging trying to make sense of how to use the select statement.

See the below code for a really simple example that obviously has a problem somewhere because it's not working. I've used the FS2004 guide from here.

Is the below code something that would work in FS2004 but no longer in FSX? Or am I simply doing something wrong? If so, what am I doing wrong?

Thanks everyone, really appreciate your help.

Trent

Code:
<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document Type="AceXML" version="1,0">
    <Descr>AceXML Document</Descr>
    <Filename>annunciator_auto_brake_disarm.xml</Filename>
    <SimGauge.Gauge id="annunciator_auto_brake_disarm" ArtDirectory=".">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Size>47,27</Size>

        <Element id="Element0">
            <FloatPosition>0.000,0.000</FloatPosition>
        <Select>
            <Value>(A:LIGHT PANEL, bool)</Value>
            <Case Value="0">
                    <Image Id="Image01" Name="annunciator_auto_brake_disarm_off.bmp"></Image>

            </Case>
            <Case Value="1">
                    <Image Id="Image02" Name="annunciator_auto_brake_disarm_off_night.bmp"></Image>
            </Case>
        </Select>
    </Element>

    </SimGauge.Gauge>
</SimBase.Document>
 
Trent

You are mixing up two different xml syntax , be very careful .
The referenced guide is in FS9 syntax .
Your code sample is in FSX syntax .

You need to study the guide more carefully , it is a very good tutorial on xml in FS9 syntax .
I recommend that at this stage you stay away from the FSX syntax , it is very verbose , complex , and only a few use it
therefore it will be often difficult to get assistance at forums .

Below is a sample code written in FS9 syntax ,
Code:
<Gauge Name="annunciator_auto_brake_disarm.xml" Version="1.0">
<Size>47,27</Size>

   <Element>
   <Position X="0" Y="0"/>
      <Select>
         <Value>(A:LIGHT PANEL, bool)</Value>
         <Case Value="0">
            <Image Name="annunciator_auto_brake_disarm_off.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="annunciator_auto_brake_disarm_off_night.bmp"/>
         </Case>
      </Select>
   </Element>
 
</Gauge>

If you need further help please advise what your switch or instrument is supposed to be doing .

Cheers
Karol
 
Last edited:
Thanks Karol for your response.

What I am doing is making amendments to the default FSX 737-800 aircraft.

I've changed the emissive mode on most gauges from additive-usercontrolled-nightonly to additive-usercontrolled. With this, the panel lights can be turned on any time and aren't just effective at night. So, when the panel lights are on during the day, I would like to be able to control which bitmap shows in the VC in order to apply the night texture whenever the panel lights are on.

To make this work in each of the affected gauges, I simply duplicated the xml code, and pasted it below...each gauge document basically has 2x gauges in it. I control which one appears through visibility. The first gauge has the day texture, the second gauge has the night texture. The Select statement (if I can make it work), seems a cleaner and more optimal way to go about what I'm trying to achieve.

Once I can figure out the basic syntax and how to apply it, I'll then work through the existing gauges and apply it (and remove the duplicated 'night' gauge). Unfortunately these gauges are basically the default ones in FSX syntax, and that's how I'll need to apply it I imagine?

If anyone is able to provide me a working example of a select statement resulting in a bitmap image being selected and applied in FSX syntax, I'd be very appreciative.

I've pasted the autobrake annunciator code below as I have it at the moment. You'll be able to see what I mean about basically having 2x gauges, and how I'd like to get rid of the 'Gauge Visibility Night' element by utilising a select statement in the 'Gauge Visibility Day' Element. While this particularly simple example doesn't really show any efficiency gain, other more complex gauges might.

Thank you!

Trent

Code:
<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document Type="AceXML" version="1,0">
    <Descr>AceXML Document</Descr>
    <Filename>annunciator_auto_brake_disarm.xml</Filename>
    <SimGauge.Gauge id="annunciator_auto_brake_disarm" ArtDirectory=".">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Size>47,27</Size>

        <Element id="Gauge Visibility Day">
    <Visibility>(A:LIGHT PANEL, bool) 0 ==</Visibility>
        <Element id="Gauge Element 1">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Image id="Image" Name="annunciator_auto_brake_disarm_off.bmp">
            <Transparent>True</Transparent>
        </Image>
        </Element>
        </Element>

        <Element id="Gauge Visibility Night">
    <Visibility>(A:LIGHT PANEL, bool) 1 ==</Visibility>
        <Element id="Gauge Element 2">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Image id="Image" Name="annunciator_auto_brake_disarm_off_night.bmp">
            <Transparent>True</Transparent>
        </Image>
        </Element>
        </Element>

    </SimGauge.Gauge>
</SimBase.Document>
 
Give this FSX schema format example a try and see if it works for you::

XML:
<SimBase.Document Type="AceXML" version="1,0">
    <!-- <Descr>AceXML Document</Descr> -->
    <!-- <Filename>annunciator_auto_brake_disarm.xml</Filename> -->
    <SimGauge.Gauge id="annunciator_auto_brake_disarm" ArtDirectory=".">
    <!-- <Size>47,27</Size> -->
        <Element id="FSX Schema Select Case Example">
            <FloatPosition>0,0</FloatPosition>
            <Select id="Select">
                <Expression id="Expression">
                    <Script>(A:LIGHT PANEL, bool)</Script>
                </Expression>
                <Case id="Case">
                    <ExpressionResult>0</ExpressionResult>
                    <Image id="Image" Name="annunciator_auto_brake_disarm_off.bmp"></Image>
                </Case>
                <Case id="Case">
                    <ExpressionResult>1</ExpressionResult>
                    <Image id="Image" Name="annunciator_auto_brake_disarm_off_night.bmp"></Image>
                </Case>
            </Select>
        </Element>
    </SimGauge.Gauge>
</SimBase.Document>

For another example of FSX schema and use of <Select><Case>, take a look at the audio_panel.xml gauge that is part of the stock g1000 (Garmin 1000 gps gauge package that is included with FSX). The g1000.cab file is in the Gauges folder - make a copy, unzip it, and have a look...

Compare this to Karol's FS9 schema example and you can see why he describes FSX schema as more verbose.

Hope it helps,

Bob
 
Last edited:
For reference, other FSX schema xml gauges shipped with FSX can also be found in the Gauges folder. Copy the folders listed below, unzip them, and you will find a number of FSX schema xml gauges. AFAIK, all the other stock xml gauge examples in FSX are written using FS9 format, and most of the xml examples and assistance offered in this forum, as already mentioned, is FS9.
  • g1000
  • Missions
  • n_number_plaque
  • Radar
Bob
 
Back
Top