Archived

This topic is now archived and is closed to further replies.

Guest knivpekka

Multiple smoke systems in FSX

Recommended Posts

This may be old stuff to most of you people but for me it was definitely an epiphany:I just discovered that it is possible to control multiple smoke effects (smoke.0, smoke1, etc) independently by parsing a number to the SMOKE_ON variable. According to the SDK this variable is a boolean, but that is obviously untrue:

1 (>K:SMOKE_ON)  <!-- enable smoke.0 -->2 (>K:SMOKE_ON)  <!-- enable smoke.1 -->0 (>K:SMOKE_ON)  <!-- enable all smokes -->1 (>K:SMOKE_OFF)  <!-- disable smoke.0 -->2 (>K:SMOKE_OFF)  <!-- disable smoke.1 -->0 (>K:SMOKE_OFF)  <!-- disable all smokes -->

...and so on. The nifty thing about this is of course that it can be used to trigger any fx, not just smoke. /Tom

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Well, that is indeed quite interesting! I'll have to try it myself soon... :(

Share this post


Link to post
Share on other sites
This may be old stuff to most of you people but for me it was definitely an epiphany:I just discovered that it is possible to control multiple smoke effects (smoke.0, smoke1, etc) independently by parsing a number to the SMOKE_ON variable. According to the SDK this variable is a boolean, but that is obviously untrue:
1 (>K:SMOKE_ON)  <!-- enable smoke.0 -->2 (>K:SMOKE_ON)  <!-- enable smoke.1 -->0 (>K:SMOKE_ON)  <!-- enable all smokes -->1 (>K:SMOKE_OFF)  <!-- disable smoke.0 -->2 (>K:SMOKE_OFF)  <!-- disable smoke.1 -->0 (>K:SMOKE_OFF)  <!-- disable all smokes -->

...and so on. The nifty thing about this is of course that it can be used to trigger any fx, not just smoke. /Tom

Oops ... If that is really true, what happens if you don't specify a number ?? (so just the event, like in FS9 )Does that mean that the event just picks an undefined value from the stack (so effectively an arbitrary value that happens to be the last stack value) ??Definitely would make FS9 code incompatible with FSX code using this event ...Rob

Share this post


Link to post
Share on other sites

Initializing the event without a value should have set the boolean to TRUE, but that didn't work as the type is evidently not BOOL but ENUM. That's what got my attention in the first place, since my smoke trigger function worked perfectly well in FS9 but not so in FSX. I had two smoke systems, and putting 1 in the SMOKE_ON var only triggered the smoke.0 effect, not smoke.1. So I tried sending 0, and hey presto, both of them came on. For the hell of it, I tried 2, and now only smoke.1 worked... Then I stayed up all night. :( (Maybe this will help with the dusk/dawn "plasma" problem from light triggered fx, using smoke events instead?)BTW I haven't tried this out in FS9 yet but my guess is it won't work.

Share this post


Link to post
Share on other sites

Smoke will only work if one engine is started...Still, it may be useful to have 'additional lighting' available even with this limitation.I had hoped to be able to control multiple "vclights" to simulate individual overhead reading/spot lights. :(

Share this post


Link to post
Share on other sites
Unfortunately, this will only work for a/c that're off the ground...The "smoke system" is inhibited unless airborne...
Sorry Bill but that is not quite correct, this works perfectly well on the ground. At least one engine must be started (combustion=true) for smoke fx to work though. :(

Share this post


Link to post
Share on other sites
Sorry Bill but that is not quite correct, this works perfectly well on the ground. At least one engine must be started (combustion=true) for smoke fx to work though. :(
I can confirm this with what I tested.With all engines Off, the Smokesystem function in FSX still works (that is: the toggle/On/Off event still works, and the On/Off variable still indicates the current On/Off position), but the effects coupled to the Smokesystem are disabled.Yet another example of a subtill (and undocumented *sigh*) change from FS9 to FSX (why changes in such a detail anyway ???)Especially since the original implementation of the Smokesystem (since FS4 ??) had nothing to do with engines or engine smoke, but was created for the "spray-effect" of a cropduster aircraft .....Cheers, Rob

Share this post


Link to post
Share on other sites
Sorry Bill but that is not quite correct, this works perfectly well on the ground. At least one engine must be started (combustion=true) for smoke fx to work though. :(
As I discovered myself after posting that. Even so, it makes it fairly useless for controlling multiple interior lighting...All XML variables are FLOAT64 type anyway, despite the various "unit" labels of bool, number, string. The XML parsing engine uses these "unit" labels as a flag to pre-format the XML variable for consumption/display by the gauge engine.I suspect that internally the actual value is using "bit flags" to decode which of the smoke.n entries to enable/disable.It's interesting that the actual bit being set is indexed according to the smoke.n are listed. For example, in a test gauge I scripted, passing 1 (>K:SMOKE_ON) will control the smoke.1 entry, provided there was no smoke.0 entry...Now I wonder what the limit is on the number of entries in the [smokesystem], and if .fx lights from there "count" towards the maximum number allowed by the [lights] section...

Share this post


Link to post
Share on other sites

smoke.98 seems to be the limit regardless of the number of lights.n in the lights section. (I actually built a "Close Encounters" sort of contraption with 100 nav lights in various colors to test this out... ) 090401_002.jpgThis is FSXA btw, haven't tested this anywhere else.

Share this post


Link to post
Share on other sites

Too bloody cool! :(

Share this post


Link to post
Share on other sites

If someone is interested, I found the way to do the same in FS2004.Eric

Share this post


Link to post
Share on other sites

Why not simply post it here for all to locate with a simple search? :(

Share this post


Link to post
Share on other sites