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

Fire extinguisher doesn't work

Vitus

Resource contributor
Messages
1,480
Country
newzealand
Hello again,

I modeled a fire extinguisher for my aircraft and added some nice animations. Unfortunately, it refuses to extinguish any fire. It should work like this:
1. Choose the engine with the lever on the left
2. Pull the trigger
3. land ASAP. :D

All the animations work - and it seems like all the variables are set correctly as well. I modified my debug gauge to review the status of the fire extinguisher - marked with the red circle:
2009691995013.jpg


The value shown under "fire bottle status" is the value of (A:FIRE BOTTLE DISCHARGED:1,bool) and "fire bottle switch" refers to (A:FIRE BOTTLE SWITCH:1,bool).

Here is the callback code for the trigger:
Code:
      <CallbackCode>
          (L:FIRE HANDLE,bool) 0 ==
          if{
            (L:FIRE ENGINE SELECTOR, enum) 1 ==
            if{
              1 (&gt;L:FIRE HANDLE,bool)
              11 (&gt;K:EXTINGUISH_ENGINE_FIRE)
              quit
            }
            (L:FIRE ENGINE SELECTOR, enum) 2 ==
            if{
              1 (&gt;L:FIRE HANDLE,bool)
              12 (&gt;K:EXTINGUISH_ENGINE_FIRE)
              quit
            }
          }
          els{
            0 (&gt;L:FIRE HANDLE,bool)
          }
      </CallbackCode>

The inner ifs are actually executed - you can see that L:FIRE HANDLE is true and the animation is carried out. But the key event doesn't do anything an my plane keeps burning and burning and burning...

I hope you have an idea!
Regards
Vitus


edit: I think I have to mention that it is FSX code ;-)
 
Last edited:
The only clue I can see is that your diagnostic gauge indicates that the token variable
(A:FIRE_BOTTLE_SWITCH:1) is false, when it should be true...

What are your [Effect] entries in the aircraft.cfg file?
 
Hi Bill,

here is the complete effects entry (did not touch it - its the same as in the DC3):
Code:
[EFFECTS]
wake=fx_wake
water=fx_spray
dirt=fx_tchdrt
concrete=fx_sparks
startup=fx_engstrt_jenny
touchdown=fx_tchdwn_s, 1

Regards
Vitus
 
Add an entry for the engine fire then:

EngineFire=fx_engFire
 
Hello Bill,

I tried that - no luck. Any further ideas?

Vitus
 
I'm afraid that I'm out of ideas. I've never bothered with the fire extinguisher system at all, so have no direct experience from which to draw...
 
I am using simConnect to interact with all these nasty variables that can't be set using eventIds (payload, gear, flaps,...). Coming back to this old issue I tried to extinguish the engine fire using simconnect but didn't succeed.

All the logic is done in my XML gauge and after the bottle is discharged (an L: variable, counting down from 100 to 0) the the variable (L:FIRE LEFT EXTINGUISH,bool) is set to "1".

In my C++ gauge the following code is supposed to clear out the flames:
Code:
int tmp;
BOOL tmp_fire;
HRESULT hr;

execute_calculator_code("(L:FIRE LEFT EXTINGUISH,bool)",NULL,&tmp,NULL);
if(tmp!=0)
{
  tmp_fire=FALSE;
  hr = SimConnect_SetDataOnSimObject(hSimConnect, DEF_LEFT_FIRE, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(BOOL), &tmp_fire);
  execute_calculator_code("0 (&gt;L:FIRE LEFT EXTINGUISH,bool)",NULL,NULL,NULL);

the definition is declared and linked to the variable "A:ENG ON FIRE:1" in the initialization part:
Code:
hr = SimConnect_AddToDataDefinition(hSimConnect, DEF_LEFT_FIRE, "A:ENG ON FIRE:1", "bool");

Buuuuut the engine keeps burning. What am I missing?

Regards,
Vitus
 
Hey Vitus,

Which version of FSX/SimConnect are you using? There was a bug in the ENG ON FIRE SimVar from SimConnect that I fixed in one of the Service Packs, but can't remember if it was in 1 or 2.
 
Engine fires and fire bottles do work in FSX SP2, I've implemented both on several airplanes.

Here's the entire operative part for a 727-200 fire handle that works in SP2:

Code:
		case PANEL_SERVICE_PRE_UPDATE:

			lookup_var(&eng1_on_fire);

			if (eng1_on_fire.var_value.n > 0 || FireTest1) {
				if (FireBell1 == 0) {
					if (!FireTest1)
						FireBell1 = 1;
					(GaugePlaySound)("sound\\B722\\Rp727_2_fire_bell.wav","",0);
				}
				HIDE_ELEMENT(pgauge->elements_list[0],2);
				HIDE_ELEMENT(pgauge->elements_list[0],4);
				if (FireHandle_1_Switch) {
					HIDE_ELEMENT(pgauge->elements_list[0],1);
					SHOW_ELEMENT(pgauge->elements_list[0],3);
				} else {
					SHOW_ELEMENT(pgauge->elements_list[0],1);
					HIDE_ELEMENT(pgauge->elements_list[0],3);
				}
			} else {
				FireBell1 = 0;
				HIDE_ELEMENT(pgauge->elements_list[0],1);
				HIDE_ELEMENT(pgauge->elements_list[0],3);
				if (!FireHandle_1_Switch) {
					HIDE_ELEMENT(pgauge->elements_list[0],2);
					SHOW_ELEMENT(pgauge->elements_list[0],4);
				} else {
					SHOW_ELEMENT(pgauge->elements_list[0],2);
					HIDE_ELEMENT(pgauge->elements_list[0],4);
				}
			}

			if(FireHandle_1_Switch)	{
				if (eng1_on_fire.var_value.n > 0) {
					if (FireBottle1 == 0) {
						FireBottle1 = 1;
						FireBell1 = 0;
						trigger_key_event(KEY_EXTINGUISH_ENGINE_FIRE, 0);
					}
				}
			}

			break;

Offhand your XML looks okay to me. It really isn't hard to do with the key events. The default 737-800 has a working set of fire extinguishers, take a look at ecu.xml in the 737-800 panel and see how that works. You might want to try and light a fire in an engine and extinguish it first to make sure the process is working.

Hope this helps,
Dutch
 
Hi Tim,

I am using FSX/Acc and the latest SDK. Still, it doesn't work.


Hi Dutch,

It was pointed out to me that the fire extinguisher doesn't work with piston engines (see here) - sorry, I forgot to mention it before. My aircraft actually has two piston engines...


There must be SOME way to extinguish an engine fire or not!? Why setting up a failure in a Flight Simulator if it is not possible to solve it? :rolleyes:

Regards,
Vitus
 
I belive that it actually DOEs because both A2A and Aeroplane heaven have fire extinguishing systems in their B-17's that can extinguish one engine fire at a time and select the proper engine. My problem though is I want to add fire extinguishers to the Embraer Regional Jet. I took the advice here about the default 737-800. In the virtual cockpit they have switches that rotate and put out the fire in either engine or the APU. I thought that if i used this xml gauge divided it into three different gauges and substituted the proper bmp's that it would work. Well it doesn't. I understand mouse click gauges and there are no clicks in this at all but it does turn and put out the fire which i started in failures. I also programmed a key press of CTRL+F and it will put out a fire in a jet engine. Below is the gauge I tweaked and borrowed along with the bmp's. The first is the handle; then illuminated to indicate an engine fire; pulled handle and fiinally a turned activation of the A squib. NOW, can someone help me make this work or do we need to start from scratch which is NOT what I am good at. You have helped me a lot before and I can use some help again to make this work. FSX Acceleration

<Gauge Version="1.0" Name="Fire Extinguisher1">
<Element id="Eng 1 Fire Ext - Fire ON">
<Visibility>(A:Eng On Fire:1,bool) 1 == (A:Fire Bottle Discharged:1,bool) 1 == or </Visibility>
<Select id="Select">
<Expression id="Expression">
<Minimum>0.000</Minimum>
<Maximum>1.000</Maximum>
<Script>(A:Fire bottle switch:1, bool)</Script>
</Expression>
<Case id="Case">
<ExpressionResult>0</ExpressionResult>
<Image id="Image" Name="ecu_fire_ext_eng_1_off_annunciator_on.bmp">
<Bright>True</Bright>
<Transparent>True</Transparent>
</Image>
</Case>
<Case id="Case">
<ExpressionResult>1</ExpressionResult>
<Image id="Image" Name="ecu_fire_ext_eng_1_right_annunciator_on.bmp">
<Bright>True</Bright>
<Bright>True</Bright>
<Transparent>True</Transparent>
</Image>
</Case>
</Select>
</Element>
<Element id="Eng 1 Fire Ext">
<Visibility>(A:Eng On Fire:1,bool) 0 == (A:Fire Bottle Discharged:1,bool) 0 == and</Visibility>
<Select id="Select">
<Expression id="Expression">
<Minimum>0.000</Minimum>
<Maximum>1.000</Maximum>
<Script>(A:Fire bottle switch:1, bool)</Script>
</Expression>
<Case id="Case">
<ExpressionResult>0</ExpressionResult>
<Image id="Image" Name="ecu_fire_ext_eng_1_off.bmp">
<Transparent>True</Transparent>
</Image>
</Case>
<Case id="Case">
<ExpressionResult>1</ExpressionResult>
<Image id="Image" Name="ecu_fire_ext_eng_1_right.bmp">
<Transparent>True</Transparent>
</Image>
</Case>
</Select>
</Element>
</Gauge>

ecu_fire_ext_eng_1_off_annunciator_on_zpsn7iqfbev.png



ecu_fire_ext_eng_1_right_annunciator_on_zpshccx1ia2.png


ecu_fire_ext_eng_1_off_zpsoh9mubcw.png


ecu_fire_ext_eng_1_right_zpszqzefp5x.png


The handle doesn't need to rotate, just a different bmp displayed when the squib is discharged.

thank you in advance for your help, I'm lost on this.
 
My approach was/is much simpler in that I simply shut down the engine. I decided to only have a fire when airborne or at a certain speed during take-off.
It does work quite well as fires can occur in any one of three engines or two simultaneously. The random factor also takes one by surprise. When back on the ground a fire bell reset switch (a real switch) also allows for an engine restart.
I have 7 engine fire scenarios (two shown here). Also shown is the code for one fire handle.
Code:
<!-- Engine Fire Scenarios -->
   <Element>
      <Select>
         <Value>(L:RandomNumber,number) 0.101 &lt; if{ (E:LOCAL DAY OF MONTH, enum) 19 == (E:ZULU TIME, hours) 12 > and
(A:SIM ON GROUND, bool) 0 == and
(L:ENG1 FIRE EXT,bool) 0 == and
(L:FIRE HANDLE 1 PULLED,number) 0 == and
(L:isolated,bool) 0 == and
if{ 1 (>L:EF_1,number) 2 (>L:Sound_Fire,enum) } }</Value>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(L:RandomNumber,number) 0.261 &lt; if{ (E:LOCAL DAY OF MONTH, enum) 21 == (E:ZULU TIME, hours) 12.44 > and
(A:AIRSPEED INDICATED,knots) (L:DM REF V1,number) > and (A:AIRSPEED INDICATED,knots) 0 &gt; and (L:DM REF V1,number) 0 &gt; and
(L:ENG1 FIRE EXT,bool) 0 == and
(L:FIRE HANDLE 1 PULLED,number) 0 == and
(L:isolated,bool) 0 == and
if{ 1 (>L:EF_1,number) 2 (>L:Sound_Fire,enum) } }</Value>
      </Select>
   </Element>


<!-- Engine Fire Handle -->
<Gauge Name="Fire handle 1" Version="1.0">
   <Image Name="Fire handle_1_background.bmp"/>
   <Element>
      <Position X="0" Y="0"/>
      <Select>
         <Value>(L:ENG1 FIRE EXT,bool) </Value>
         <Case Value="1">
            <Image Name="Fire_handles_1_on.bmp" Bright="No"/>
         </Case>
         <Case Value="0">
            <Image Name="Fire_handle_1_off.bmp"/>
         </Case>
      </Select>
   </Element>

   <Element>
      <Position X="0" Y="0"/>
      <Select>
         <Value>(L:ENG1 FIRE EXT,bool)</Value>
         <Case Value="1">
            <Image Name="Fire_handles_1_on_light.bmp" Bright="Yes"/>
         </Case>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(L:ENG 1 FIRE TEST,number) (L:ENG FIRE TEST,number) |</Value>
         <Case Value="1">
            <Image Name="Fire_handles_1_on_test_light.bmp" Bright="Yes"/>
         </Case>
<Case Value="0">
            <Image Name="SWAP.bmp"/>
         </Case>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(L:FIRE HANDLE 1 PULLED,number)</Value>
         <Case Value="1">
            <Image Name="Fire_handles_1_on_test_light.bmp" Bright="Yes"/>
         </Case>
<Case Value="0">
            <Image Name="SWAP.bmp"/>
         </Case>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(L:EF_1,number)</Value>
         <Case Value="1">
            <Image Name="Fire_handles_1_on_test_light.bmp" Bright="Yes"/>
         </Case>
         <Case Value="0">
            <Image Name="SWAP.bmp"/>
         </Case>
      </Select>
   </Element>

   <Mouse>
      <Area Top="61" Bottom="106" Left="20" Right="126">
         <Tooltip>Eng.1 Fire Control Handle</Tooltip>
         <Cursor Type="Hand"/>
         <Click>(L:ENG1 FIRE EXT,bool) 0 != if{ 0 (&gt;L:ENG1 FIRE EXT,bool) (>K:TOGGLE_FUEL_VALVE_ENG1) 0 (>L:Sound_Fire,enum) 1 (>L:FIRE HANDLE 1 PULLED,number) } els{ 1 (&gt;L:ENG1 FIRE EXT,bool) 0 (>L:EF_1,number) (>K:TOGGLE_FUEL_VALVE_ENG1) 2 (>L:Sound_Fire,enum) }
1 (&gt;K:TOGGLE_AFTERBURNER1)
</Click>
      </Area>
   </Mouse>
</Gauge>
 
My approach was/is much simpler in that I simply shut down the engine. I decided to only have a fire when airborne or at a certain speed during take-off.
It does work quite well as fires can occur in any one of three engines or two simultaneously. The random factor also takes one by surprise. When back on the ground a fire bell reset switch (a real switch) also allows for an engine restart.
I have 7 engine fire scenarios (two shown here). Also shown is the code for one fire handle.
Code:
<!-- Engine Fire Scenarios -->
   <Element>
      <Select>
         <Value>(L:RandomNumber,number) 0.101 &lt; if{ (E:LOCAL DAY OF MONTH, enum) 19 == (E:ZULU TIME, hours) 12 > and
(A:SIM ON GROUND, bool) 0 == and
(L:ENG1 FIRE EXT,bool) 0 == and
(L:FIRE HANDLE 1 PULLED,number) 0 == and
(L:isolated,bool) 0 == and
if{ 1 (>L:EF_1,number) 2 (>L:Sound_Fire,enum) } }</Value>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(L:RandomNumber,number) 0.261 &lt; if{ (E:LOCAL DAY OF MONTH, enum) 21 == (E:ZULU TIME, hours) 12.44 > and
(A:AIRSPEED INDICATED,knots) (L:DM REF V1,number) > and (A:AIRSPEED INDICATED,knots) 0 &gt; and (L:DM REF V1,number) 0 &gt; and
(L:ENG1 FIRE EXT,bool) 0 == and
(L:FIRE HANDLE 1 PULLED,number) 0 == and
(L:isolated,bool) 0 == and
if{ 1 (>L:EF_1,number) 2 (>L:Sound_Fire,enum) } }</Value>
      </Select>
   </Element>


<!-- Engine Fire Handle -->
<Gauge Name="Fire handle 1" Version="1.0">
   <Image Name="Fire handle_1_background.bmp"/>
   <Element>
      <Position X="0" Y="0"/>
      <Select>
         <Value>(L:ENG1 FIRE EXT,bool) </Value>
         <Case Value="1">
            <Image Name="Fire_handles_1_on.bmp" Bright="No"/>
         </Case>
         <Case Value="0">
            <Image Name="Fire_handle_1_off.bmp"/>
         </Case>
      </Select>
   </Element>

   <Element>
      <Position X="0" Y="0"/>
      <Select>
         <Value>(L:ENG1 FIRE EXT,bool)</Value>
         <Case Value="1">
            <Image Name="Fire_handles_1_on_light.bmp" Bright="Yes"/>
         </Case>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(L:ENG 1 FIRE TEST,number) (L:ENG FIRE TEST,number) |</Value>



         <Case Value="1">
            <Image Name="Fire_handles_1_on_test_light.bmp" Bright="Yes"/>
         </Case>
<Case Value="0">
            <Image Name="SWAP.bmp"/>
         </Case>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(L:FIRE HANDLE 1 PULLED,number)</Value>
         <Case Value="1">
            <Image Name="Fire_handles_1_on_test_light.bmp" Bright="Yes"/>
         </Case>
<Case Value="0">
            <Image Name="SWAP.bmp"/>
         </Case>
      </Select>
   </Element>

   <Element>
      <Select>
         <Value>(L:EF_1,number)</Value>
         <Case Value="1">
            <Image Name="Fire_handles_1_on_test_light.bmp" Bright="Yes"/>
         </Case>
         <Case Value="0">
            <Image Name="SWAP.bmp"/>
         </Case>
      </Select>
   </Element>

   <Mouse>
      <Area Top="61" Bottom="106" Left="20" Right="126">
         <Tooltip>Eng.1 Fire Control Handle</Tooltip>
         <Cursor Type="Hand"/>
         <Click>(L:ENG1 FIRE EXT,bool) 0 != if{ 0 (&gt;L:ENG1 FIRE EXT,bool) (>K:TOGGLE_FUEL_VALVE_ENG1) 0 (>L:Sound_Fire,enum) 1 (>L:FIRE HANDLE 1 PULLED,number) } els{ 1 (&gt;L:ENG1 FIRE EXT,bool) 0 (>L:EF_1,number) (>K:TOGGLE_FUEL_VALVE_ENG1) 2 (>L:Sound_Fire,enum) }
1 (&gt;K:TOGGLE_AFTERBURNER1)
</Click>
      </Area>
   </Mouse>
</Gauge>


Thank you for the quick reply. I will try and implement this with my bmps. Any more suggestions totally welcome.
 
I tried this and it "kinda works" for me. The bmps gave me a problem. You can see the progression above. When there is no fire the dark red horizontal handle 1 should be visible. When an engine fire starts, The Bright Orange should show up. Then when I click it should show that it has been pulled down to the Extinguisher horizontal handle. This handle should have a click spot to activate squib A and end up with the angle handle and put out the fire. Can you do that for me with your XML to do that? I tried and the bright orange is always there til I click it and then down to the Extinguisher handle and put out the fire, but when I tried to switch around bmps to the way they should be messed it up and don't know what to do. Thanks for your help. If you can make this do that, I can substitute for Engine 2. BTW, there IS no actual test switch for these, just an inactive button on the panel bmp. I also need this to work for the APU which is a square shielded button as is the Cargo 1 and Cargo 2 but I will experiment with those from this xml.

Richard
 
Well, the bmps are a bit complicated. first in the normal position and second in a extinguisher discharged position. I only modelled one fired position instead of two. When the extinguishant has been discharged the handle can be reset but the light stays on until after landing when the firebell reset button is pushed. Next the lights. In the normal position with the fire bell and the discharged position. The normal position doubles for the firebell test as well.
 
I can deal with that if you would be kind and set it up. The normal position is already in the overhead bmp so the bright handle that comes on when there is a fire with the bell sounding could be the first bmp. Then when it is clicked to show that "it was pulled down" can be the second bmp and the squib discharged. Can you replace your bmps with these two I need to make this work? You have more bmps named so I am confused where to put these. thank you.
 
Bmps are quite easy to do. The lights are either on or off or if the handle is pulled. I'm sure you can do those. Especially if you are familiar with the air craft. As for the coding do a flow chart first and in that you can see more clearly the cause and effect of a fire warning. My example is very simple and as said just cuts the fuel until after landing. All I did was bmps for the fire handles and bmps for the lights which overlay the fire handles. Very basic stuff!
 
I appreciate your gauge, thanks, you name 5 bmps in this gauge:

<Image Name="Fire handle_1_background.bmp"/>
<Image Name="Fire_handles_1_on.bmp"
<Image Name="Fire_handle_1_off.bmp"/>
<Image Name="Fire_handles_1_on_light.bmp"
<Image Name="Fire_handles_1_on_test_light.bmp"


but you said that you only have 2 ???????

That is why I'm confused which bmp of mine equals which bmp of yours to make this work in my panel.

Thank you, sorry for being a bother.
 
I appreciate your gauge, thanks, you name 5 bmps in this gauge:

<Image Name="Fire handle_1_background.bmp"/>
<Image Name="Fire_handles_1_on.bmp"
<Image Name="Fire_handle_1_off.bmp"/>
<Image Name="Fire_handles_1_on_light.bmp"
<Image Name="Fire_handles_1_on_test_light.bmp"


but you said that you only have 2 ???????

That is why I'm confused which bmp of mine equals which bmp of yours to make this work in my panel.

Thank you, sorry for being a bother.
Yes, you are confused. Above I illustrated the code for 2 of 7 fire scenarios plus one of the fire handles. The bmps are for the handles in their different positions and for the lights which are part of the handles so their positions change if the handles move when they are lit.
 
I am totally aware of that, two bmps = a switch off/on. I have made quite a few of these gauges. I have even with help here had a rotary switch and a rotary handle. This is quite different. I could totally understand Fire handles 1 on and Fire handle 1 off for an on and off. That is if the handle were a click spot or a switch. Now what...??? PLEASE
 
Back
Top