• 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 ERJ175 Engine First Test

Messages
967
Country
us-northcarolina
Here is a screenshot of the feelthere ERJ175 Overhead with lines to each gauge that i want to illuminate when the test button is pressed. I wrote this code with some help a few years ago here but only the #2 Fire Handle lights up no other gauges. In FSPS all looks like it will work but when I try in FSX(A) no luck. I am also posting the code hoping that someone who knows a lot more than I will see what is wrong and correct it for me.



<Gauge Name="Engine Fire Test" Version="1.0">
<Element>
<Select>
<Value>(L:ENG FIRE TEST,number)</Value>
<Case Value="0">
<Image Name="out.bmp" Luminous="1"/>
</Case>
<Case Value="1">
<Image Name="in.bmp" Luminous="1"/>
</Case>
</Select>
</Element>
<Element>
<Select>
<Value>(L:ENG FIRE TEST,number)(L:fire test, bool) </Value>
<Case Value="1">
<Image Name="1on.bmp" Bright="Yes"/>
</Case>
<Case Value="1">
<Image Name="2on.bmp" Bright="Yes"/>
</Case>
<Case Value="0">
<Image Name="SWAP.bmp"/>
</Case>
</Select>
</Element>
<Element>
<Select>
<Value>(L:APU FIRE TEST,number)(L:fire test, bool) </Value>
<Case Value="1">
<Image Name="itson.bmp" Bright="Yes"/>
</Case>
<Case Value="0">
<Image Name="SWAP.bmp"/>
</Case>
</Select>
</Element>
<Element>
<Select>
<Value>(L:AFT FIRE TEST,number)(L:fire test, bool) </Value>
<Case Value="1">
<Image Name="itson.bmp" Bright="Yes"/>
</Case>
<Case Value="0">
<Image Name="SWAP.bmp"/>
</Case>
</Select>
</Element>
<Element>
<Select>
<Value>(L:FWD FIRE TEST,number)(L:fire test, bool) </Value>
<Case Value="1">
<Image Name="itson.bmp" Bright="Yes"/>
</Case>
<Case Value="0">
<Image Name="SWAP.bmp"/>
</Case>
</Select>
</Element>
<Mouse>
<Tooltip>All Engine Fire Test</Tooltip>
<Cursor Type="Hand"/>
<Click Kind="LeftSingle+LeftRelease">
(M:Event) 'LeftSingle' scmp 0 == if{ 1 (&gt;L:ENG FIRE TEST,number) 1 (>&egt;L:Sound_firebell,enum) }
(M:Event) 'LeftRelease' scmp 0 == if{ 0 (&gt;L:ENG FIRE TEST,number) 1 (&egt;>L:Sound_firebell,enum) }
</Click>
</Mouse>
</Gauge>
 

tgibson

Resource contributor
Messages
11,343
Country
us-california
All of these images appear in the same place (AFAIK), so probably only the last one that has a valid visibility value will display. In this case you set the L:ENG FIRE TEST value to 1 (TRUE) with the mouse. This means the first element will have a case = 1 and will display in.bmp. But I assume that's not the one that appears from your message, so there must be another valid statement later in the code.

I honestly have no idea how FS evaluates this:

<Value>(L:ENG FIRE TEST,number)(L:fire test, bool) </Value>

but you say the #2 fire handle lights up and I assume that is 2on.bmp? If so that is evaluating to TRUE and since that is the last Case=1 bit of code, that one lights up. The 1on.bmp won't display because it occurs before the 2on.bmp code.

I assume the rest of the code evaluates to FALSE since those L: variables are not set to 1 with the mouse click (if that's how you are trying to light them up).

If you want these lights to appear in different locations within this same gauge (i.e. all on one gauge background bitmap, which you do not include), or at least you need a Size command. Then you need a Position command, like this example code:

XML:
 <Size X="850" Y="100"/>
 <Image Name="l188_ovhd_2_back.bmp"  Luminous="Yes" />

   <Element>
      <Position X="20" Y="10"/>
      <Select>
         <Value>(L:Panel Overhead, bool)</Value>
         <Case Value="0">
            <Image Name="l188_ovhd_swtchoff.bmp"  Luminous="Yes" />
         </Case>
         <Case Value="1">
            <Image Name="l188_ovhd_swtchon.bmp"  Luminous="Yes" />
         </Case>
      </Select>
   </Element>

This positions the upper left corner of the switch bitmaps at 20, 10 pixels from the upper left corner of the background bitmap (or Size rectangle).

If instead these lights are to appear in different gauges, then this code needs to be spread among those gauges.

Hope this helps,
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Also, this 'formula' makes no sense:
<Value>(L:FWD FIRE TEST,number)(L:fire test, bool) </Value>
First of all, there must be a space between the two variables, such as <Value>(L:FWD FIRE TEST,number) (L:fire test, bool)</Value>
Second of all, there must be an operator to defines the relationship between the evaluation to be performed, in other word either an "and" or an "on" conditional.
<Value>(L:FWD FIRE TEST,number) (L:fire test, bool) and</Value>
<Value>(L:FWD FIRE TEST,number) (L:fire test, bool) or</Value>
 
Messages
967
Country
us-northcarolina
Thank you both for your comments. I have downloaded both and will get back to see how I can fix/change this to make it work. Yes, Tom, these are all different gauges which is perhaps why only the last one lights.
 
Messages
289
Country
unitedkingdom
I have created an Annunciator Panel & Fire Test light test switch, what I did was create a gauge for the switch:

Please note that this is FSX schema.
Code:
    <Filename>LR35_Lamp_Test_Sw.xml</Filename>
    <SimGauge.Gauge id="Gauge" ArtDirectory=".">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Image id="Lamp_Test" Name="Lamp_Test">
            <Transparent>True</Transparent>
            <Bright>True</Bright>
        </Image>
        <MouseArea id="MouseArea">
            <FloatPosition>0.000,0.000</FloatPosition>
            <Size>50,50</Size>
            <CursorType>Hand</CursorType>
            <MouseClick id="MouseClick">
                <Script>
                        (M:Event) &apos;LeftSingle&apos; scmp 0 == if{ 1 (&gt;L:Lamp Test,bool) }
                        (M:Event) &apos;LeftRelease&apos; scmp 0 == if{ 0 (&gt;L:Lamp Test,bool) }
                    </Script>
                <ClickType>LeftSingle+LeftRelease</ClickType>
            </MouseClick>
        </MouseArea>
    </SimGauge.Gauge>
</SimBase.Document>

Then all that is needed is to add a visibility string to all the gauge elements you want the lamp test to work with, here's an example:

Code:
            <Visibility>(A:CIRCUIT GENERAL PANEL ON, bool) 1 == (L:Lamp Test, bool) 1 == and if{ (P:Absolute time,seconds) 0.5 % 0.25 1 * > ! } els{ 0 }</Visibility>

This code also enables any warning light to flash on & off.
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
The "Universal Timer" is also handy for custom strobe lights, beacons, and other stuff that needs to blink...

You can even cascade two UTs together to get a "double blink" like this:
XML:
<!-- KA 350 VISIBILITY SCRIPTS -->
<PartInfo>
    <Name>KA_350_LOGIC_NODE</Name>
    <Visibility>
       <Parameter>
         <Code>
          <!-- STROBE LIGHT FLASHER -->
          (A:LIGHT STROBE,bool)
          if{
              (P:Absolute time,seconds) 2 % 0.4 > !
              if{
                  (P:Absolute time,seconds) 0.2 % 0.1 > !
                  if{ 1 (>L:KA_350_Strobe,bool) }
                 els{ 0 (>L:KA_350_Strobe,bool) }
               }
          }

          (A:LIGHT STROBE,bool) !
          if{ 0 (>L:KA_350_Strobe,bool) }
        </Code>
      </Parameter>
    </Visibility>
</PartInfo>
and of course the actual <viz> script for the model's strobe lights:
XML:
  <PartInfo>
    <Name>KA_350_light_strobe_vis</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:KA_350_Strobe,bool)
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

Just for the sake of simplicity, when you want to test a Boolean expression, you don't actually need to be explicit. Instead just list the Boolean variables like this:

(A:CIRCUIT GENERAL PANEL ON, bool) (L:Lamp Test, bool) and if{ ...
 
Last edited:
Messages
967
Country
us-northcarolina
thank you all for taking the time to try and fix this. I have been working with Tom's and Bill's first suggestions and no matter what I did it either didn't work at all or still just lit the #2 Engine Fire Handle. If it were just one lamp it would be simple I even just finished making a full overhead panel bmp with lit gauges and though it worked like it was supposed to with all shown lit (it is just a big bmp) the gauge covers up the overhead which is one complex gau made my feelthere so I couldn't click anything underneath it. I don't know what to do and am almost ready to just leave it non-functional like feelthere did. I will just install the two engine fire handles which both work perfectly to shut down the engines and extinguish an engine fire.
 

tgibson

Resource contributor
Messages
11,343
Country
us-california
Here is an example excerpted from an autopilot annunciator. This lights up little squares on the panel as each AP mode is invoked.

XML:
<Gauge Name="AP Annunciator" Version="1.0">
    <Image Name="apanunc_back.bmp"/>
    <Size X="425" Y="198"/>

   <Element>
     <Visible> (A:AUTOPILOT MASTER, bool) </Visible>
     <Position X="179" Y="155"/>
      <Image Name="apanunc_aparm.bmp">
      </Image>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
   </Element>

   <Element>
     <Visible> (A:AUTOPILOT APPROACH HOLD, bool) </Visible>
     <Position X="174" Y="118"/>
      <Image Name="apanunc_apr.bmp">
      </Image>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
   </Element>

   <Element>
     <Visible> (A:AUTOPILOT ALTITUDE LOCK, bool) </Visible>
     <Position X="176" Y="65"/>
      <Image Name="apanunc_alt.bmp">
      </Image>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
   </Element>

This is not the entire gauge - the rest is just like this, though.

Hope this helps,
 
Top