Hi. Today I'm going to talk about using particles in the SFM.
Particles are visual effects that you can add to enhance your scene, like dust, smoke, and fire.
I've set up a simple scene where I've recorded myself both as a Medic and Heavy moving through this area.
Because I captured this alone, I wasn't able to use my medicgun on the Heavy, so I'll have to insert that particle system.
For any scene to which you want to add particles, you can browse what's available to you by selecting Windows > Particle Editor Tool.
This switches the window to a mode where you can load in a particle file, which are grouped by function, to preview how it appears.
This may change your window to be smaller, and one which cannot be resized on the fly.
To change this, you can alter your launch properties for the SFM. Right-click on the application icon and select Properties.
In the space next to Target, add the options -w and -h to set the width and height in pixels. I've got this set to 1920 by 1080.
These changes take effect when you re-launch the tool.
So, since I want to add the medicgun beam, I'll go to File > Open, where I can browse for a particle configuration file.
Navigate to the game\tf\particles folder, then select medicgun_beam.pcf.
This shows me all the particle definitions that exist in that group,
and I can preview which one is appropriate to use: in this case, medicgun_beam_blue.
Now, I'll select Tools > Switch to SFM, then right-click in the Animation Set Editor and select Create Animation Set for New Particle System.
This brings up a window where I can browse the particle system definition file, then use the drop-down menu to select medicgun_beam_blue.
Note that the start time is where the playhead currently is located, but I can easily change this number,
and I'll make it before the shot, so the particles exist when the shot starts.
Then, I'll lengthen its duration and lifetime to go beyond my shot length, and select OK.
You can easily change these values in the Animation Set Editor, right-clicking on the particle system,
and selecting Edit Particle System Start/Stop/End Times.
Now, I'll quickly attach this to the medicgun and Heavy using the techniques shown in the tutorial video called "Locks."
If you haven't yet watched that, I'd suggest you do,
so you can understand how I'm able to lock the particle system to the motion of the medicgun and Heavy.
Note that if a particle system has two control points, control point 0 is where the particle emits from, and control point 1 is where it moves to.
If you don't see a particle system that you've just added, move the playhead to another shot, and move back,
and that will refresh the shot and the particles will be visible. Now his medicgun beam appears as it does in the game.
But you can control every parameter of the particle system to change its appearance however you wish.
Doing so is not for the faint of heart, as it's a very complex process
with lots of variables and functions that aren't easy to understand, so do so with that expectation.
As an example, if I wanted to make the medicgun beam green as if it made players sick instead of healing them,
I can change its parameters to do just that.
To edit a particle system, right-click on it in the Animation Set Editor and select Show in Element Viewer > Particle System.
Then, right-click on the particle system, and select Instance Particle System.
This essentially creates a copy of the particle system, and allows you to play with its properties.
A plus sign is added next to the particle system definition, which, when you expand it, has all the information about the particles.
It also adds a button to the right with three dots in it, and clicking on that brings up the Particle System Editor.
The medicgun beam particle system is fairly complex, with many children listed in the children properties,
so to simplify things, I'm going to delete all but the blue_trail_stage_3 and pluses. In the lower right, click Accept.
It's a little easier to alter these particles one at a time, so in the particle system definition,
clicking on the plus next to the medicgun_beam_blue_trail expands some of its parameters,
and another box with three dots in it appears next to the child. I'll click that to bring back up the Particle System Editor.
Since this particle system has two control points, where particles flow from point 0 to point 1,
in the Ctrl Pts (control points) tab in the upper left, I'm going to move point 1 100 units in X so I can see the effect over a distance.
I can control the view in the window to the right by left-mouse-clicking and dragging to orbit, middle-mouse to pan, and right-mouse to zoom.
I'll start by changing the color of the trail to green. In the lower-left window, all the particle system properties are listed,
and these are the parameters which effect how the particle system behaves.
This is where things can get very complicated very fast, so again, proceed with caution.
And as long as you save a lot, there's no harm in playing with these to see what effect each parameter has.
There are only two attributes in the system properties that you'll likely ever adjust.
Material is the image or sprite used by the particle system.
The particle system is actually placing an image on a square plane that's oriented to camera,
and this button allows you to browse which image the system will use.
Max_particles sets the upper limit for the number of particles that system will allow, and is used more for optimization in the game,
but if you increase your emission rate, you might want to increase this number as well.
Under the System Properties are different fields which determine how they're rendered,
what properties they start with, how those properties change over time, and what forces are acting on them.
Each particle has its own list of parameters in these sections which define how the particles behave,
and you can alter, remove, or add functions in these sections to affect its behavior.
Right-click on any of these parameters to do that. For example, right-clicking on Operator and selecting Add brings up a huge list of functions
that can be added to that section to affect what changes happen as the particle system is running,
and seeing that list gives you an idea of how involved the controls can be.
This is where advanced users can really dig in to get the effect they want. But for this example, we'll keep things simple.
Selecting the Renderer affects some overall properties for the particles, but it's rare that you'll need to change parameters in this section.
The three sections in which you'll do the most changing are Emitter, Initializer, and Operator.
Emitter usually has a function called "emit_continuously,"
and the parameters you'll most likely alter are the emission_rate, which sets how many particles are emitted per second,
and emission_duration, which sets how long, in seconds, particles will be emitted.
Note that this is set to 0, which means it will continue indefinitely. You can fade it in and out here as well.
The Initializer section determines how the particles will act when emitted,
and the Operator section determines how the particles will act over time.
So to change the beam to green, I'll select Color Random under the Initializer list.
The first two parameters are color1 and color2, so by clicking on the color swatches, I can quickly change each of them to green.
Click OK to accept these changes. Note that this change is reflected in the main viewport as well.
You'll notice that over the length of the beam, the color changes from green to blue.
That's because there's a parameter in the Operator section called Color Fade.
Again, all these properties act on the particle system after each particle is emitted.
Select the Color Fade parameter, click on the swatch next to Color Fade, and make it green.
Click Accept in the lower right to close out the window.
Now I'll alter the pluses. Click on the three dots next to the child parameter for medicgun_beam_blue_pluses.
I want to change their rotation by 45 degrees so they look more like an X than a plus,
so I'll add a parameter to the Initializer called Rotation Random.
If I change the value of rotation_initial to 45, and set rotation_offset_max to 0,
you can see that they all are now rotated 45 degrees and look more like an X.
I'll change their Color Random and Color Fade to green just as I did for the beam.
And lastly, instead of having them get smaller, I'll make them get bigger over time. I'll select Radius Scale in the Operator list,
and change the radius_start_scale to 2, and the radius_end_scale to 10, and you can see that over time, they grow bigger.
So that's a brief overview of how to modify particle systems in the SFM. This just scratched the surface of its capabilities,
as its features are quite complex and deep, and really mastering the toolset and understanding the parameters
will take a lot of experimentation by those who wish to explore it,
but this gives you an idea of how you can alter existing particle systems or create your own to get the exact look you're aiming for.
Thanks for watching, and good luck!