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

Getting Effects to Repeat

Messages
8
Country
australia
Hey all.

I've been playing with some manual edits of an effects file to create a shell blast and smoke plume. There's gunnery range in the scenery I've been working on and I can see from the GE imagery that it's in active use. So, I'm trying to replicate the activity for the location. I'm sure it's a restricted area and you'd never get close enough in a plane to see this, but thought it'd be fun have it going on in the distance.

Anyway, all seems to be going well, but I'm stumped on getting the effect to repeat. I've combined elements of the 'fireworks1' effect for the blast and the 'campfire' effect for the smoke plume. The fireworks go off immediately as designed, followed by a delayed smoke plume. I've got the plume to 'drag' in response to the wind and reduced the 'lifetime' of the effect so the smoke peters out. However, I can't see any parameters for getting the effect to repeat.

Could someone please point me in the right direction?

Cheers,
Matthew.
 
Hi Matthew:

One of the best examples in FS (although more complex than some might need) can be seen by taking a look at these files in [FS install path]\Effects: :idea:

1.) "Cntrl_fireworks.fx"
2.) "fx_firework1.fx" through "fx_firework15.fx"
3.) "FW_show1.fx"

You'll then see how they interact on a "Random", yet cyclic basis. ;)

NOTE: In the VisualFxTool dialog for an effect, the associated *.Wav file can be changed to other sounds from [FS install path]\Sound (check out "Exp_OilRig0x.wav" series !) :p


Hope this helps ! :)

GaryGB
 
Last edited:
Hey Gary,

can you please tell me whether 'RANDOM=100,1;' section of the XML code is correct?

<Effect effectName="FW_show1_MT" effectParams="RANDOM=100,1;DAWN=0;DAY=1;DUSK=0;NIGHT=0;"/>

I'm trying to use the RANDOM parameter so that the effect does not appear all the time. However, it's very difficult to test whether I've got the code right, as I can't see it in my test area. Either the entry is wrong, or it is correct but the number generated is less than 'random_threshold' and therefore the effect is not created. However, I've used a 'random_range' of 100 and a 'random_threshold' of 1 giving me a 99% chance of the effect being generated. I've started the sim numerous times to trigger the effect, but no show. If I don't include the RANDOM parameter the effect works fine, so all my effects files are working perfectly well.

Any thoughts?

Cheers,
Matthew.
 
Hi Matthew:

I lost track of this thread for a few days, but I see now your question involves a control parameter used for XML placement of an Fx file.


This is explained in the online reference to the FSX ESP SDK (essentially identical to FSX retail as far as the SDK goes): :teacher:

http://msdn.microsoft.com/en-us/library/cc526969.aspx

BTW: The SDK examples use 2-digit values (ex: 10,9) for the Random= variables, but in theory the use of 3-digits (ex: 100,1) should still work. ;)

Code:
RANDOM=random_range,random_threshold; 	 Specifies that the effect occurs randomly.

A random number is generated between 0 and random_range;
if the number generated is less than random_threshold, the effect is not created.

For example:
RANDOM=10,9 (10% chance of seeing the effect)
RANDOM=10,6 (40% chance of seeing the effect)

I am not at my FS system at this time and do not have access to the current FSX files for the FS default "Fireworks" examples cited above, but IIRC, whenever there is more than 1 Effect "control" parameter to be implemented for conditional "display" of a *.Fx file, one should put those parameters into a separate Cntrl_*.Fx file rather than in the XML placement code, and observe carefully the syntax and types of parameters used in that sub-type of Fx file compared to a "basic" Fx file.

Note these SDK caveats too:

Code:
Notes: Parameter Precedence

* "RANDOM" takes highest precedence, then periods of the day
(for example, "DAWN")., and then times of the day (for example, "HOD”).

* "RANDOM" is determined when the scenery is first loaded.

If the random check fails, the effect will not occur at all until the scenery
is completely reloaded (at which point it may fail the random check again).

* It is possible to set up an effect's parameters such that the effect never
occurs.

If any of the "DAWN," "DAY," etc. parameters are specified, they take
precedence over "HOD," "MOH," and "SOM."

Therefore if you set "NIGHT=0;" and "HOD=22;", the effect will not show
at 10:00PM because it should not appear at night.



IIUC, there is a SDK bug that prevents more than 1 type of control parameter being used for Fx in XML placement code at a time.

You may note also the intermediate Fx file "FW_show1.fx" which you may be experimenting with, has a slightly different syntax compared to the other 2 *.Fx files in the FS default "Fireworks" examples cited above.

It is particularly important to distinguish the "Type=" in each of the Fx files, and in each sub-section of a given Fx file, which defines perhaps more than other parameters, just what operations the FS rendering engine has to perform with the info in Fx files regardless of Fx file-naming used (which is primarily for the convenience of the end user), as Fx files are essentially plain ASCII text files otherwise.

(ex: Type=26 is for "Effects emitting effects")


Although the variety of Effect under discussion is different here, you might find some of the ideas and caveats regarding placement of sound effects in this thread to be pertinent to successful placement of effects in general:

http://www.fsdeveloper.com/forum/showthread.php?p=124738#post124738

http://www.fsdeveloper.com/forum/showthread.php?t=8781


Hope this info helps ! :)

GaryGB
 
Last edited:
Back
Top