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

P3D v2 Management of jet glow and smoke commands/flooding

Messages
10,158
Country
us-arizona
Hey all,

May I ask what a good way of handling the code (commands) might be for jet afterburners and engine glow (smoke) effects?

For instance, these are based on throttle position. On mine, the commands are an amount of flooding that is going on. Is this typical? Should I worry about it? When I run Dougs Event Logger, I see the commands for the engine going out many times a second.

This is my working code for the engines;

Code:
<Gauge Name="Turbine Engine Glow" Version="1.1">
  <Size X="5" Y="5" />

<!-- ENGINE GLOW ONE -->

<!-- ENGINE 1 -->

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:1, bool) 1 ==
      if{ 3 (>K:SMOKE_ON) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:1, bool) !
      if{ 3 (>K:SMOKE_OFF) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:1, bool) 1 ==
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 35 &gt; and
      if{ 5 (>K:SMOKE_ON) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:1, bool) !
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 34 &lt; or
      if{ 5 (>K:SMOKE_OFF) }
     </Value>
    </Select>
   </Element>


  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:1, bool) 1 ==
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 50 and
      if{ 6 (>K:SMOKE_ON) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:1, bool) !
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 49 &lt; or
      if{ 6 (>K:SMOKE_OFF) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:1, bool) 1 ==
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 75 &gt; and
      if{ 7 (>K:SMOKE_ON) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:1, bool) !
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 74 &lt; or
      if{ 7 (>K:SMOKE_OFF) }
     </Value>
    </Select>
   </Element>

<!-- ENGINE 2 -->

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:2, bool) 1 ==
      if{ 4 (>K:SMOKE_ON) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:2, bool) !
      if{ 4 (>K:SMOKE_OFF) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:2, bool) 1 ==
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 35 &gt; and
      if{ 8 (>K:SMOKE_ON) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:2, bool) !
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 34 &lt; or
      if{ 8 (>K:SMOKE_OFF) }
     </Value>
    </Select>
   </Element>


  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:2, bool) 1 ==
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 50 and
      if{ 9 (>K:SMOKE_ON) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:2, bool) !
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 49 &lt; or
      if{ 9 (>K:SMOKE_OFF) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:2, bool) 1 ==
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 75 &gt; and
      if{ 10 (>K:SMOKE_ON) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
      (A:GENERAL ENG COMBUSTION:2, bool) !
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 74 &lt; or
      if{ 10 (>K:SMOKE_OFF) }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
  (A:GENERAL ENG COMBUSTION:1,bool) 1 ==
     if{ 25 50 (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) rng
        if{ (&gt;L:Lear LH Engine Dim,bool) } }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
  (A:GENERAL ENG COMBUSTION:1,bool) 1 ==
     if{ 51 75 (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) rng
        if{ (&gt;L:Lear LH Engine Medium,bool) } }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
  (A:GENERAL ENG COMBUSTION:1,bool) 1 ==
     if{ 76 100 (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) rng
        if{ (&gt;L:Lear LH Engine Bright,bool) } }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
  (A:GENERAL ENG COMBUSTION:2,bool) 1 ==
     if{ 25 50 (A:GENERAL ENG THROTTLE LEVER POSITION:2,percent) rng
        if{ (&gt;L:Lear RH Engine Dim,bool) } }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
  (A:GENERAL ENG COMBUSTION:2,bool) 1 ==
     if{ 51 75 (A:GENERAL ENG THROTTLE LEVER POSITION:2,percent) rng
        if{ (&gt;L:Lear RH Engine Medium,bool) } }
     </Value>
    </Select>
   </Element>

  <Element>
   <Select>
     <Value>
  (A:GENERAL ENG COMBUSTION:2,bool) 1 ==
     if{ 76 100 (A:GENERAL ENG THROTTLE LEVER POSITION:2,percent) rng
        if{ (&gt;L:Lear RH Engine Bright,bool) } }
     </Value>
    </Select>
   </Element>

</Gauge>


Would one fill this with a ton of initilizers?
 
Just check that conditions have not already been met.
I'm at work just now. If nobody else answers, I'll dig mine out tonight.
 
Why not let it be controlled by fuel flow which is more realistic than throttle position?
 
Yes, you should worry about that ..;)
The way you code it now means that there is a continous stream of either SmokeOn or SmokeOff events, disturbing multi-event commands like EngineSelect, PushbackTurn, Exit, etc.
Plus it floods e.g. multiplayer servers.


Code:
Suppose you have:
 
[SMOKESYSTEM]
smoke.0=0,0,0,file0
smoke.1=0,0,0,file1
smoke.2=0,0,0,file2
smoke.3=0,0,0,file3
smoke.4=0,0,0,file4
etc ...
 
Before issueing a SmokeOn or SmokeOff event, test it's current condition first.
 
Like in (if you want smoke.2 only active when "condition" is true)
 
"condition"
if{ (A:SMOKE ENABLE:2,bool) ! if{ 2 (&gt;K:SMOKE_ON) } }
els{ (A:SMOKE ENABLE:2,bool) if{ 2 (&gt;K:SMOKE_OFF) } }
 
This way you give an event only once, untill "condition" changes again.
 
Note that (this is in FSX-ACCEL, dunno about P3D since I don't have that; but probably likewise):
0 (&gt;K:SMOKE_ON) : sets all smoke.* lines On
1 (&gt;K:SMOKE_ON) : sets smoke.0 AND smoke.1 On
2 (&gt;K:SMOKE_ON) : sets only smoke.2 On
3 (&gt;K:SMOKE_ON) : sets only smoke.3 On
etc...
 
Simularly for SMOKE_OFF.

Cheers, Rob
 
Last edited:
Nice... A thousand thanks Rob. The way I was going to do it was with Initializers. That is a nightmare. This will be a lot easier to write the list.

Basically, code in P3D is the same as FSX, the cores are the same for reading models. They do now support 2 different other forms of code. My apologies as I do not remember what those are. The new big thing is sim connect. :S But, XML is the same, so no worries there.

You should try out the newest P3D V2.3. Get the 'one month only' developers purchase, $10.00 USD for 30 days. You will freak on the new shadows and shading technolgies, 3D clouds and fog (volumetric actual mist) and some other cool things they now have. And it runs smoother.

Thanks again.
 
Bill, I used a single (L:Eng1SmokeStep,enum) to control the entire afterburner sequence as a series of 'steps'. Note that there are separate step UP and step DOWN sequences:

Code:
      <!-- ENGINE 1 AFTERBURNER ON-->
      (A:TURB ENG CORRECTED N2:1, Percent) 100 >
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 85 > and
      if{
      (L:Eng1SmokeStep,enum) 1 ==
      if{ 1 (>K:SMOKE_ON) 2 (>L:XMLSND110,enum) 2 (>L:Eng1SmokeStep,enum) }
      (L:Eng1SmokeStep,enum) 2 ==
      (E:Time of Day,enum) 1 != and
      if{ 3 (>K:SMOKE_ON) 3 (>L:Eng1SmokeStep,enum) }
      (L:Eng1SmokeStep,enum) 3 ==
      (E:Time of Day,enum) 1 != and
      if{ 5 (>K:SMOKE_ON) 4 (>L:Eng1SmokeStep,enum) }
      (L:Eng1SmokeStep,enum) 4 ==
      if{ 7 (>K:SMOKE_ON) 5 (>L:Eng1SmokeStep,enum) }
      (L:Eng1SmokeStep,enum) 5 ==
      if{ 9 (>K:SMOKE_ON) 6 (>L:Eng1SmokeStep,enum) }
      }
      <!-- ENGINE 1 AFTERBURNER Off-->
      (A:TURB ENG CORRECTED N2:1, Percent) 100 &lt;=
      (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 85 &lt; or
      (A:GENERAL ENG COMBUSTION:1, bool) and
      if{
      (L:Eng1SmokeStep,enum) 6 ==
      if{ 9 (>K:SMOKE_OFF) 5 (>L:Eng1SmokeStep,enum) }
      (L:Eng1SmokeStep,enum) 5 ==
      if{ 7 (>K:SMOKE_OFF) 4 (>L:Eng1SmokeStep,enum) }
      (L:Eng1SmokeStep,enum) 4 ==
      if{ 5 (>K:SMOKE_OFF) 3 (>L:Eng1SmokeStep,enum) }
      (L:Eng1SmokeStep,enum) 3 ==
      if{ 3 (>K:SMOKE_OFF) 2 (>L:Eng1SmokeStep,enum) }
      (L:Eng1SmokeStep,enum) 2 ==
      if{ 1 (>K:SMOKE_OFF) 3 (>L:XMLSND110,enum) 1 (>L:Eng1SmokeStep,enum) }
    }
 
Just for the sake of people finding this thread in the future to help them out, here is my finished code. Works nicely.


Code:
<Gauge Name="Turbine Engine Glow" Version="1.1">
  <Size X="5" Y="5" />
<Update>

<!-- ENGINE 1 -->

   (A:GENERAL ENG COMBUSTION:1, bool) 1 ==
   (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 1 &gt; and
      if{ (A:SMOKE ENABLE:3,bool) ! if{ 3 (&gt;K:SMOKE_ON) } }
     els{ (A:SMOKE ENABLE:3,bool) if{ 3 (&gt;K:SMOKE_OFF) } }

   (A:GENERAL ENG COMBUSTION:1, bool) 1 ==
   (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 25 &gt; and
      if{ (A:SMOKE ENABLE:5,bool) ! if{ 5 (&gt;K:SMOKE_ON) } }
     els{ (A:SMOKE ENABLE:5,bool) if{ 5 (&gt;K:SMOKE_OFF) } }

   (A:GENERAL ENG COMBUSTION:1, bool) 1 ==
   (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 50 &gt; and
      if{ (A:SMOKE ENABLE:6,bool) ! if{ 6 (&gt;K:SMOKE_ON) } }
     els{ (A:SMOKE ENABLE:6,bool) if{ 6 (&gt;K:SMOKE_OFF) } }

   (A:GENERAL ENG COMBUSTION:1, bool) 1 ==
   (A:GENERAL ENG THROTTLE LEVER POSITION:1,percent) 75 &gt; and
      if{ (A:SMOKE ENABLE:7,bool) ! if{ 7 (&gt;K:SMOKE_ON) } }
     els{ (A:SMOKE ENABLE:7,bool) if{ 7 (&gt;K:SMOKE_OFF) } }

<!-- ENGINE 2 -->

   (A:GENERAL ENG COMBUSTION:2, bool) 1 ==
   (A:GENERAL ENG THROTTLE LEVER POSITION:2,percent) 1 &gt; and
      if{ (A:SMOKE ENABLE:4,bool) ! if{ 4 (&gt;K:SMOKE_ON) } }
     els{ (A:SMOKE ENABLE:4,bool) if{ 4 (&gt;K:SMOKE_OFF) } }

   (A:GENERAL ENG COMBUSTION:2, bool) 1 ==
   (A:GENERAL ENG THROTTLE LEVER POSITION:2,percent) 25 &gt; and
      if{ (A:SMOKE ENABLE:8,bool) ! if{ 8 (&gt;K:SMOKE_ON) } }
     els{ (A:SMOKE ENABLE:8,bool) if{ 8 (&gt;K:SMOKE_OFF) } }

   (A:GENERAL ENG COMBUSTION:2, bool) 1 ==
   (A:GENERAL ENG THROTTLE LEVER POSITION:2,percent) 50 &gt; and
      if{ (A:SMOKE ENABLE:9,bool) ! if{ 9 (&gt;K:SMOKE_ON) } }
     els{ (A:SMOKE ENABLE:9,bool) if{ 9 (&gt;K:SMOKE_OFF) } }

   (A:GENERAL ENG COMBUSTION:2, bool) 1 ==
   (A:GENERAL ENG THROTTLE LEVER POSITION:2,percent) 75 &gt; and
      if{ (A:SMOKE ENABLE:10,bool) ! if{ 10 (&gt;K:SMOKE_ON) } }
     els{ (A:SMOKE ENABLE:10,bool) if{ 10 (&gt;K:SMOKE_OFF) } }

</Update>
</Gauge>


For those that do not know, you can have many effects (what ever effects you want to have on a plane but are used via the Smoke section), then set your names for your smoke section there. Here is mine so far.


[SMOKESYSTEM]
smoke.1= -4.38, -7.0, -0.7, fx_Lear_Spoilers_l
smoke.2= -4.40, 7.0, -0.7, fx_Lear_Spoilers_r
smoke.3= -10.9, -3.7, 1.75, LHC_Eng1
smoke.4= -10.9, 3.7, 1.75, LHC_Eng1
smoke.5= -10.9, -3.7, 1.75, LHC_Eng1
smoke.6= -10.93,-3.7, 1.75, LHC_Eng1
smoke.7= -10.97,-3.7, 1.75, LHC_Eng1
smoke.8= -10.9, 3.7, 1.75, LHC_Eng1
smoke.9= -10.93, 3.7, 1.75, LHC_Eng1
smoke.10= -10.97, 3.7, 1.75, LHC_Eng1
smoke.11= 4.97, 3.7, 1.75, fx_engFire_F18
smoke.12= -4.145, -16.5, -0.15, fx_spray //fuel dump
smoke.13= -4.145, 16.2, -0.15, fx_spray //fuel dump
smoke.14= -10.97,-3.7, 1.75, fx_Steam_Sml //Engine Smoke
smoke.15= -10.97, 3.7, 1.75, fx_Steam_Sml //Engine Smoke


When writing a command code, to turn on Smoke effect number 9 for instance, you would write it like this;

9 (&gt;K:SMOKE_ON)
9 (&gt;K:SMOKE_OFF)

Basically repeating what Rob wrote above.
 
Back
Top