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

FS2004 Engine out warning light

euroastar350

Resource contributor
Messages
863
Country
us-delaware
Hi guys,


I am trying to recreate an annunciator light that warns when an engine has failed on an aircraft and cannot get it to work. Attached is the code I am using. Any help is appreciated.
Code:
<Gauge Name="ann" Version="1.0">
   <Element>
      <Select>
         <Value>(A:CIRCUIT GENERAL PANEL ON, bool) if{ (A:ENG1 FAILED,bool) (L:Lamp Test, bool) || } els{ 0 }</Value>
         <Case Value="0">
            <Image Name="ENG1_OUT_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="ENG1_OUT.bmp"/>
         </Case>
      </Select>
      <Failures>
         <SYSTEM_ELECTRICAL_PANELS Action="1"/>
      </Failures>
   </Element>
</Gauge>
 
You need to SET the value for your L:variable...

1 (>L:Lamp Test, bool)

Also, this makes no sense at all, you don't even need an L:variable at all:

Code:
<Value>(A:CIRCUIT GENERAL PANEL ON, bool) if{ (A:ENG1 FAILED,bool) (L:Lamp Test, bool) || } els{ 0 }</Value>
It should be:

Code:
<Value>
     (A:CIRCUIT GENERAL PANEL ON, bool) 
     (A:ENG1 FAILED,bool)
     and
     if{ 1 } els{ 0 }
</Value>

...for that matter, you don't even need the if{ } else { } either!

Code:
<Value>
     (A:CIRCUIT GENERAL PANEL ON, bool) 
     (A:ENG1 FAILED,bool)
     and
</Value>
...since the above will return TRUE (1) or FALSE (0) all by itself...
 
Last edited:
Hi,

I'm guessing the lamp test variable is for a separate lamp test button. :)

Try adding a space between the } and the </Value>

Hope this helps,
 
Tom, the entire <Value> string is nonsense:

Code:
<Value>(A:CIRCUIT GENERAL PANEL ON, bool) if{ (A:ENG1 FAILED,bool) (L:Lamp Test, bool) || } els{ 0 }</Value>

You don't normally put a read variable (A:something) inside of an if statement's { do something } section.

Translating the above back into pseudo-code:

if "the circuit panel is on"
then "the 'value of eng1 failed' or the 'value of lamp test'"
else "0"

To include the "lamp test," the simplest way to write the script is:
Code:
<Value>
     (A:CIRCUIT GENERAL PANEL ON, bool) 
     (A:ENG1 FAILED,bool)
     and
     (L:Lamp Test, bool)
     or
</Value>
 
Give this a whirl ;) ...prob wont work lol ..... looks fine but not tested
Code:
<Gauge Name="ann" Version="1.0">
   <Element>
      <Select>
         <Value>(A:ENG FAILED:1,number) (L:Lamp Test,bool) || </Value>
       <Failures>
         <SYSTEM_ELECTRICAL_PANELS Action="0"/>
      </Failures>        
         <Case Value="0">
            <Image Name="ENG1_OUT_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="ENG1_OUT.bmp"/>
         </Case>
      </Select>
   </Element>
</Gauge>
Ive used the <failure> code rather than the (A:CIRCUIT GENERAL PANEL ON, bool) pretty much the same anyway
 
Last edited:
Bill,

I tried the code you posted and is a no-go, any ideas?:confused:

Well, I didn't provide ALL of the script, only the <Value> portion. If you didn't plug it into the rest of the required script, then no... it won't work. ;)
 
Okay, this is what I have so far. The light comes on when the caution panel is switched on, but the light doesn't go out when I start the engine.
Code:
<Gauge Name="ann" Version="1.0">
   <Element>
      <Select>
         <Value>(A:CIRCUIT GENERAL PANEL ON, bool) (A:ENG1 FAILED, bool) ! &amp;&amp; if{ 1 } els{ 0 }</Value>
         <Case Value="0">
            <Image Name="ENG1_OUT_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="ENG1_OUT.bmp"/>
         </Case>
      </Select>
      <Failures>
         <SYSTEM_ELECTRICAL_PANELS Action="1"/>
      </Failures>
   </Element>
</Gauge>
 
Here is an idea for a different approach.

Make 2 separate elements, one with the on bitmap, and one with the off bitmap. Use the Visible flag to display only one you are wanting.

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

<SimBase.Document Type="AceXML" version="1,0">
    <Descr>AceXML Document</Descr>
    <SimGauge.Gauge id="Gauge">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Size>50,50</Size>
        <Element id="Annun Off">
            <FloatPosition>0.000,0.000</FloatPosition>
            <Image id="ENG1_OUT_OFF.bmp" Name="ENG1_OUT_OFF.bmp">
                <Transparent>True</Transparent>
            </Image>
        </Element>
        <Element id="Annun On">
            <FloatPosition>0.000,0.000</FloatPosition>
            <Visibility>(L:Lamp Test, bool) (A:ENG1 FAILED, bool) or (A:CIRCUIT GENERAL PANEL ON, bool) and</Visibility>
            <Image id="ENG1_OUT.bmp" Name="ENG1_OUT.bmp">
                <Transparent>True</Transparent>
            </Image>
        </Element>
    </SimGauge.Gauge>
</SimBase.Document>

Note: This is FSX Ace tool Schema, but you should get the idea.

The "OFF" bitmap doesn't need a visibility flag, because when the light is on, the "ON" bitmap is drawn on top the "OFF" bitmap, so you wont see it anyways.

The "ON" light should come on when EITHER the Engine 1 is out, or the Lamp test is true, AND the panel is turned on.

Good Luck

Daniel
 
Better still, don't use the failure flags at all. Check for engine running instead!

That way it will go out when the engine is started.

(A:GENERAL ENG COMBUSTION:1, bool)

(A:GENERAL ENG COMBUSTION:2, bool)
 
Well I finally got it working, but I am using rotor rpm pct as the variable. Thanks for the help guys, learning this XML gauge stuff can be frustrating and rewarding.....even for a first timer doing XML:eek:

Code:
<Gauge Name="ann" Version="1.0">
   <Element>
      <Select>
         <Value>(A:Rotor RPM PCT:1, percent) 60 &lt;</Value>
         <Case Value="0">
            <Image Name="ENG1_OUT_OFF.bmp" />
         </Case>
         <Case Value="1">
            <Image Name="ENG1_OUT.bmp" Bright="Yes"/>
         </Case>
      </Select>
   </Element>
</Gauge>
 
No problem. The reason to avoid the failure flags is because they are used to indicate - well - failure of something, not that something IS working... ;)

Must be a helo your working on, since your using the rotor rpm... ;)
 
Well I finally got it working, but I am using rotor rpm pct as the variable. Thanks for the help guys, learning this XML gauge stuff can be frustrating and rewarding.....even for a first timer doing XML:eek:

Code:
<Gauge Name="ann" Version="1.0">
   <Element>
      <Select>
         <Value>(A:Rotor RPM PCT:1, percent) 60 &lt;</Value>
         <Case Value="0">
            <Image Name="ENG1_OUT_OFF.bmp" />
         </Case>
         <Case Value="1">
            <Image Name="ENG1_OUT.bmp" Bright="Yes"/>
         </Case>
      </Select>
   </Element>
</Gauge>
Dont use rpm as the rotor will still be turning if engine is out/off use
(A:ENG1 COMBUSTION,number) 0 ==
I thought you wanted to show engine failure...meh... so yeah it will only work if the engine failure tag is set to on , you can have the engine off and the failure tag off so thats no good for your intended use :)
Wozza
 
Last edited:
Warwick, I've tried every engine variable there is with no success....thats why I am using rotor rpm...I am open to other suggestions including custom scripts.

Bill, yes its a helo...as a matter of fact, its the one I've been working on for almost a year now, screenshot below:cool: I am using FS9 native gauges for this bird since I am also making an FS9 native model as well, they work quite well in both.
 

Attachments

  • 2011-5-12_6-2-29-978.jpg
    2011-5-12_6-2-29-978.jpg
    92.1 KB · Views: 471
Hi Mate
Well spent some time and tested it, this worked fine with a cobra heli I use for testing perps..
{EDIT}oops changed the code as I got it arse about lol ...you really dont need a case 0 bmp for this sort of gauge btw, just a simple bright bmp placed over the panel.bmp that comes on if conditions meet.

Code:
<Gauge Name="ann" Version="1.0">
   <Element>
      <Select>
         <Value>(A:ENG1 COMBUSTION,number) 0 == (L:Test,bool) 1 == || </Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Case Value="1">
            <Image Name="ENG1_OUT.bmp" Bright="Yes"/>
         </Case>
      </Select>
   </Element>
</Gauge>

and the caution light hot spot I used for testing (the adfbg.bmp was just a blank texture)

Code:
<Gauge Name="Test" Version="1.0">
<Element>
<Select>
<Value>(L:Test,bool)</Value>
<Case Value="0">
<Image Name="adfbg.bmp" />
</Case>
<Case Value="1">
<Image Name="adfbg.bmp"/>
</Case>
</Select>
</Element>
<Mouse>
<Tooltip>Caution Lights Test</Tooltip>
<Cursor Type="Hand"/>
<Click Kind="LeftSingle+Leave"> (M:Event) 'LeftSingle' scmp 0 == if{ 1 (&gt;L:Test,bool) }
(M:Event) 'Leave' scmp 0 == if{ 0 (&gt;L:Test,bool) } </Click>
</Mouse>
</Gauge>

Ive attached an old Annunciator panel xml code that I did that may help........... if not might be good for a laugh ;)

Wozza
 

Attachments

Last edited:
This also works :-)
vololiberista

Code:
<Gauge Name="Engine 1 fail light" Version="1.0">
   <Element>
      <Select>
         <Value>(A:Turb eng1 N2, percent) 1 &lt; (A:GENERAL ENG1 FAILED, bool) ||</Value>
	     <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Case Value="0">
            <Image Name="RED_OFF.bmp" Luminous="0" ImageSizes="12,12"/>
         </Case>
		 <Case Value="1">
            <Image Name="RED_ON.bmp" Bright="Yes" ImageSizes="12,12"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
      <Tooltip>Engine 1 fail light</Tooltip>
   </Mouse>
</Gauge>
 
Back
Top