PDA

View Full Version : Smoke.n .fx Are Controllable via XML!



n4gix
March 31st, 2009, 14:35
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:


[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:


<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:
http://img13.imageshack.us/img13/9413/smoketest.jpg

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

Chris Keane
May 9th, 2011, 14:37
... 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


<Gauge Name="Smoke">

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

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

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

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

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

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

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

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

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

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

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

<Element>
<Select>
<Value>(A:TURB ENG2 AFTERBURNER,bool) 0 == if{ 6 (&gt;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.

OleBoy
May 9th, 2011, 15:20
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?