• 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 engine failure gauge

Messages
149
Country
newzealand
hi everyone,

can somebody help me with the code for a invisible gauge foe FSX that will make a piston engine fail if it runs at full throttle for too long, at which point I would like the engine to choke and run roughly for a while before dying down. At the same time it starts to choke I would like to trigger an effect which simulates an engine fire.

anyone?

thanx in advance!
 
You could try out Realengine. It may do most of what you're looking for.

I would suggest to use version 1.2.
It's only available at SOH:
http://www.sim-outhouse.com/sohforu...eal-Engine-1-1&p=454217&viewfull=1#post454217
(frankly I don't know why I've never uploaded it to any of the sites...)

The main parameters to adapt the modules to a specific aircraft can be set in a single file (RE1_Parameters_v12.xml). This makes adapting RE to a plane much easier than previous versions.
(v1.1 is available at flightsim.com, but more complex to configure.)

The engine runs rough before failing, and most aircraft give off smoke due to the default FS engine start/engine off animation associated with the cutting out of the engine.

Severity of engine skipping can be read out by variable (L:RE1_EngineRoughnessSeverity,number), Values 0-1. It's probably easy to add an engine fire animation effect using that variable.
 
When the engine throttle is on full the rpm will max at a specific number.
Use this number for the gauge that will fail the engine. But the gauge will have an if statement that uses a timer.

Smoke can be triggered from another element within this gauge.

So i think 1 gauge might help you achieve this goal.

i think i will write something like this soon. Sounds like a good idea! Might take some time to test!

DG;)
 
Last edited:
Hi
Here something you can mod to suit ...the "Update Frequency" value is used to set the speed of the fuel valve toggle on/off (to model a stuttering engine)
Code:
<Gauge Name="Hurt me baby" Version="1.0">
<Update Frequency="1"/>


<comment> =================  start =============== </comment>
  <Element>
    <Select>
      <Value>(A:GENERAL ENG1 RPM,rpm) 2590 &gt; 
              if{ (G:Var1) 0 == (L:marker,bool) 0 == &amp;&amp; if{ 1 (&gt;G:Var1) (P:Local Time, seconds) 20 + (&gt;G:Var2) } }
             els{ (G:Var1) 0 &gt; (L:marker,bool) 0 == &amp;&amp; if{ 0 (&gt;G:Var1) } }
      </Value>
    </Select>
 </Element>
<comment> ======   Check clock, start run-rough and enable/start nurse or die if nec ==== </comment>
  <Element>
    <Select>
      <Value>(G:Var1) 1 == (L:marker,bool) 0 == &amp;&amp;
              if{ (P:Local Time, seconds) (G:Var2) &gt; if{ 1 (&gt;G:Var3) } }
      </Value>
    </Select>
 </Element>
<comment> ==================================  Run Rough/broke a rod ========================== </comment>
  <Element>
    <Select>
      <Value>(G:Var4) ! (&gt;G:Var4)</Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(G:Var3) 1 == 
              (L:marker,bool) 0 == &amp;&amp;
               if{ (G:Var4)
                    if{ (A:general eng1 fuel valve,bool) 1 == if{ (&gt;K:TOGGLE_FUEL_VALVE_ENG1) } }
                   els{ (A:general eng1 fuel valve,bool) 0 == if{ (&gt;K:TOGGLE_FUEL_VALVE_ENG1) } }
                 }
      </Value>
    </Select>
 </Element>
<comment> ==================================  Nurse or die ==================================== </comment>
  <Element>
    <Select>
      <Value>(G:Var3) 1 == (A:GENERAL ENG1 THROTTLE LEVER POSITION,percent) 80 &gt; &amp;&amp;
              if{ (G:Var6) 0 == if{ 1 (&gt;G:Var6) (P:Local Time, seconds) 15 + (&gt;G:Var7) } }
             els{ (G:Var6) 0 &gt; if{ 0 (&gt;G:Var6) } }
      </Value>
    </Select>
 </Element>
  <Element>
    <Select>
      <Value>(G:Var6) 1 == 
              if{ (P:Local Time, seconds) (G:Var7) &gt; if{ (&gt;K:TOGGLE_ENGINE1_FAILURE) (&gt;K:FUEL_SELECTOR_OFF)  } }
      </Value>
    </Select>
 </Element>

</Gauge>
 
That looks great! Matter of fact it is just as i explained.

Has this been tested? or did you quickly write it.
Looks like it's been around because it even has labels.

Thanks!:eek:
 
What moi post code that didnt work ...perish the thought ...lol
it should work fine....... so long as the conditions are meet
 
What moi post code that didnt work ...perish the thought ...lol
it should work fine....... so long as the conditions are meet
I confirm that gauge is working very nicely.
It has provided me with some tense moments desperately looking for the next airport with stuttering engine. :D
 
Nice! I did have one question though, what is the purpose of the variable (L:marker,bool)? It doesn't seem to do anything as far as I can tell.

Geoff
 
Nice! I did have one question though, what is the purpose of the variable (L:marker,bool)? It doesn't seem to do anything as far as I can tell.

Geoff

Perhaps he sets it in another gauge? Otherwise, within this gauge it never changes from zero...

For the life of me though, I've never understood the "purpose" of (G:varn) variable types, except perhaps to obfuscate the script's logic.

Yes, I do know that they are both "unitless" and confined to the gauge in which they are used, but otherwise seem rather pointless... :confused:
 
As Bill said, it can be used to stop the gauge should you wish...also it helps to firm up the logic....... sometimes its handy to have something that stays the same ;)

Bill the G.vars are handy when your working on multiple gauges all doing the same thing ie engine 1 ,2 ,3 and 4. The G:vars wont effect the same in the other gauges .....just make's it easier and Im lazy :D
 
Back
Top