• There seems to be an uptick in Political comments in recent months. Those of us who are long time members of the site know that Political and Religious content has been banned for years. Nothing has changed. Please leave all political and religious comments out of the forums.

    If you recently joined the forums you were not presented with this restriction in the terms of service. This was due to a conversion error when we went from vBulletin to Xenforo. We have updated our terms of service to reflect these corrections.

    Please note any post refering to a politician will be considered political even if it is intended to be humor. Our experience is these topics have a way of dividing the forums and causing deep resentment among members. It is a poison to the community. We appreciate compliance with the rules.

    The Staff of SOH

  • Server side Maintenance is done. We still have an update to the forum software to run but that one will have to wait for a better time.

Smoke.n .fx Are Controllable via XML!

n4gix

SOH-CM-2016
A fellow posted at http;//avsim.com the other day an interesting discovery. It seems that the K:SMOKE_ON and K:SMOKE_OFF events are not binary! In other words, each entry in the aircraft.cfg file may be toggled on/off by simply passing a value to either of the two K:events...

...unfortunately, the "smoke system" is only available when the a/c is off the ground, but still...

...this discovery opens up some interesting possibilities, as we can use any type of .fx file and have it "controllable" now, including .fx files that play sounds... :gossip:

For example, I put the following in the C172's aircraft.cfg file. This will display the "lights" just forward of the windshield in either 2d or VC view:
Code:
[SMOKESYSTEM]
smoke.1=13.3, -1.0, 4.0, fx_navred.fx
smoke.2=13.3, -0.5,  4.0, fx_navgre.fx
smoke.3=13.3, 0.5, 4.0, fx_strobe.fx
smoke.4=13.3, 1.0,  4.0, fx_beacon.fx
I then created a simple XML "gauge" to control each of the four smoke.n .fx files independently:
Code:
<Gauge Name="SmokeTest" Version="1.0">
    <Image Name="SmokeTest.bmp" />
    <Mouse>
      <Area Left="0" Top="0" Height="30" Width="150">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle">1 (>K:SMOKE_ON)</Click>
         <Tooltip>Smoke 1 On</Tooltip>
      </Area>
      <Area Left="151" Top="0" Height="30" Width="150">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle">1 (>K:SMOKE_OFF)</Click>
         <Tooltip>Smoke 1 Off</Tooltip>
      </Area>
 
      <Area Left="0" Top="32" Height="30" Width="150">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle">2 (>K:SMOKE_ON)</Click>
         <Tooltip>Smoke 2 On</Tooltip>
      </Area> 
      <Area Left="151" Top="32" Height="30" Width="150">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle">2 (>K:SMOKE_OFF)</Click>
         <Tooltip>Smoke 2 Off</Tooltip>
      </Area>       
 
      <Area Left="0" Top="64" Height="30" Width="150">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle">3 (>K:SMOKE_ON)</Click>
         <Tooltip>Smoke 3 On</Tooltip>
      </Area>  
      <Area Left="151" Top="64" Height="30" Width="150">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle">3 (>K:SMOKE_OFF)</Click>
         <Tooltip>Smoke 3 Off</Tooltip>
      </Area>       
 
      <Area Left="0" Top="96" Height="30" Width="150">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle">4 (>K:SMOKE_ON)</Click>
         <Tooltip>Smoke 4 On</Tooltip>
      </Area>
      <Area Left="151" Top="96" Height="30" Width="150">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle">4 (>K:SMOKE_OFF)</Click>
         <Tooltip>Smoke 4 Off</Tooltip>
      </Area>       
 
      <Area Left="0" Top="128" Height="30" Width="300">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle">0 (>K:SMOKE_ON)</Click>
         <Tooltip>All Smoke On</Tooltip>
      </Area>  
      <Area Left="0" Top="160" Height="30" Width="300">
         <Cursor Type="Hand"/>
         <Click Kind="LeftSingle">0 (>K:SMOKE_OFF)</Click>
         <Tooltip>All Smoke Off</Tooltip>
      </Area> 
    </Mouse>
</Gauge>
Here is the test gauge's bitmap:
smoketest.jpg


It will be interesting to see what purpose -if any- to which some clever person might decide to use this discovery... :applause:
 
... It will be interesting to see what purpose -if any- to which some clever person might decide to use this discovery... :applause:

I so wish I'd have come across this thread a month or so ago ...

In the aircraft.cfg;

smoke.1=-20.8, 0.0, 1.25, fx_engineLightning // Eng1 Lit
smoke.2=-20.8, 0.0, 3.70, fx_engineLightning // Eng2 Lit
smoke.3=-20.8, 0.0, 1.25, fx_EELightning_EngRun // Eng1 over 45%
smoke.4=-20.8, 0.0, 3.70, fx_EELightning_EngRun // Eng2 over 45%
smoke.5=-21.0, 0.0, 1.25, fx_EELightning_Reheat // Eng1 Reheat
smoke.6=-21.0, 0.0, 3.70, fx_EELightning_Reheat // Eng2 Reheat

Code:
<Gauge Name="Smoke">

<!-- Engine 1 Lit -->
<Element>
  <Select>
    <Value>(A:TURB ENG1 N2,percent) 25 > if{ 1 (>K:SMOKE_ON) }</Value>
  </Select>
</Element>

<Element>
  <Select>
    <Value>(A:TURB ENG1 N2,percent) 20 < if{ 1 (>K:SMOKE_OFF) }</Value>
  </Select>
</Element>

<!-- Engine 2 Lit -->
<Element>
  <Select>
    <Value>(A:TURB ENG2 N2,percent) 25 > if{ 2 (>K:SMOKE_ON) }</Value>
  </Select>
</Element>  

<Element>
  <Select>
    <Value>(A:TURB ENG2 N2,percent) 20 < if{ 2 (>K:SMOKE_OFF) }</Value>
  </Select>
</Element>

<!-- Engine 1 N2 > 45% -->
<Element>
  <Select>
    <Value>(A:TURB ENG1 N2,percent) 45 > if{ 3 (>K:SMOKE_ON) }</Value>
  </Select>
</Element>

<Element>
  <Select>
    <Value>(A:TURB ENG1 N2,percent) 45 < if{ 3 (>K:SMOKE_OFF) }</Value>
  </Select>
</Element>

<!-- Engine 2 N2 > 45% -->
<Element>
  <Select>
    <Value>(A:TURB ENG2 N2,percent) 45 > if{ 4 (>K:SMOKE_ON) }</Value>
  </Select>
</Element>

<Element>
  <Select>
    <Value>(A:TURB ENG2 N2,percent) 45 < if{ 4 (>K:SMOKE_OFF) }</Value>
  </Select>
</Element>

<!-- Engine 1 Reheat -->
<Element>
  <Select>
    <Value>(A:TURB ENG1 AFTERBURNER,bool) 1 == if{ 5 (>K:SMOKE_ON) }</Value>
  </Select>
</Element>

<Element>
  <Select>
    <Value>(A:TURB ENG1 AFTERBURNER,bool) 0 == if{ 5 (>K:SMOKE_OFF) }</Value>
  </Select>
</Element>

<!-- Engine 2 Reheat -->
<Element>
  <Select>
    <Value>(A:TURB ENG2 AFTERBURNER,bool) 1 == if{ 6 (>K:SMOKE_ON) }</Value>
  </Select>
</Element>

<Element>
  <Select>
    <Value>(A:TURB ENG2 AFTERBURNER,bool) 0 == if{ 6 (>K:SMOKE_OFF) }</Value>
  </Select>
</Element>

</Gauge>
Now let me get this into all the models ...

Thanks again Bill, and thanks to knivpekka on avsim of course.

Chris.
 
Bill, am I understanding this correctly? That I can take your bitmap and add it to my panel of said aircraft, add the XML gauge to the panel folder (along with the needed effects files), and this would in turn, render the bitmap clickable for either light (or smoke) effects in any pit?
 
Back
Top