Team Fortress 2

Team Fortress 2

196 次評價
In Depth Guide to making Unusual Effects
由 HasteReapr 發表
This is an in depth guide on how to make unusual effects, since I felt like the old one did not really explain why it was doing what it was doing.

As of 4/19/2024, the -tools launch option broke, meaning the particle editor is no longer accessible. The fix for this is in the first chunk of the guide.
5
2
5
   
獎勵
加入最愛
已加入最愛
移除最愛
Tools fix 4/19/24
As of 4/19/2024, -tools no longer works with Team Fortress 2 through Steam. You need to make a batch file with this code, and place it in your TF2 folder, which can be found at

C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2

start "" tf.exe -tools -console exit 0

You can add any launch options after console, it's doing the same thing as putting them in the steam options.

Going through this batch code line by line, it isn't malicious.

"start" runs whatever program is put in afterwards, the empty quotation marks are there so the command window will go away after startup.

"exit 0" closes out of the command window, the 0 enables it to close without spitting out a message.
Why Make Unusuals?
There are many reasons
  • To say you made an unusual effect.
  • To get your effects in game.
  • Because you enjoy making them.
There are many more than this, but this is just off the top of my head, and why I make effects.

Sidenote before you continue reading, this guide covers just the basics, but if you would like to learn about everything in a lot of depth, you can check out the Advanced Unusual Effect Guide here :-> https://steamproxy.net/sharedfiles/filedetails/?id=2875877786

This covers almost everything you could ask (if it is filled out, as it's still a major WIP)

Setting up our workspace
To set up our workspace we'll have to do 2 simple things.
Turn on tools mode
  1. Right click TF2 in your library.
  2. Click Properties
  3. Under general add -tools and -console to your launch properties.

Images to follow along

Once we start TF2 again, we'll be in tools mode. We'll need to go to the particle editor mode to do anything with particles.
It should look like this;

After going to particle mode, click File > New File to make a new particle system.
Our screen should look like this;
Setting up ExampleParticleGlow
Once we're on the screen like before, we click create to make a new particle. We will be naming this particle ExampleParticleGlow.
I know the screenshots say ExampleParticle, while taking the screenshots I initially planned on just having ExampleParticle.

Once we're here, we click on Properties to open up a drop down menu. Once in this drop down menu we click on Renderer to set up how we render this particle. Here is where we make a crucial choice, do we want to render our particle as an animated sprite or as a rope? Animated sprite will make your particle render as shown in the PNG, while rendering as a rope will stretch the png between the point of origin and the current position of the particle.

In this tutorial, we will be sticking with animated sprite.
Click Add... then click render_animated_sprite

Next to actually set the sprite of the particle we will go back to Properties through the dropdown menu.
Once here, we will click on the three dots next to vgui/white. This will be the material row.
After clicking this, a window that looks like this will pop up.
This is where we choose the sprite to use for our particle, and the most common particle used is sc_softglow.
Important note, do not ever use any sprites in the /workshop/ path unless you are given express permission by the sprite creators.
Once we select sc_softglow our screen will show this.
Emitting ExampleParticleGlow
We need to set up the emitter to make our glow particle actually show up, so we open up the drop down menu and select emitter.


Right click in the function name area, much like Renderer and click Add... then add emit continuously.
Our particle should look like this now.
The default value for emit continuously is 100, this is too much though, as that creates 100 particles per second, so we're going to turn it down to something that's more acceptable, for this we'll use 4.
Now our particle will look like this.
Initializing ExampleParticleGlow
We need to set up the initializer to tell our particle how to spawn, and what conditions to spawn with. So we open the dropdown menu again, and go to Initializer.


Right click in the function name area, like before, click add and select Lifetime Random.

Now we set this up to have a minimum lifetime of 1.25 seconds, and a maximum lifetime of 1.75 seconds.


Now we're going to add Alpha Random to our initializer, this will make our particle slightly transparent, based on how low the alpha value is.
As always, click Add... then click Alpha Random, it will be at the very top of the list.
After that, we will be changing the min and max values to 128, since 128 is roughly half the value of 255.



The glow is spawning in the exact same spot every time, so now we're going to use Position Modify Offset Random instead of Position Within Box Random, since we will be childing the glow to another particle afterwards.
As always, click Add... then click Position Modify Offset Random

Now we want the glow to spawn within a box of 8 hammer units, so we set the max value to 4, 4, 4.

And set the min value to -4, -4, -4.

Notice how the box is much bigger now.



Like before, we said this will be a child to another particle, so we're adding Position from Parent Particles. Make sure it's Parent Particles, NOT Parent Cache
We don't need to edit any values in this.
Operating ExampleParticleGlow
We need to set up Operators to ExampleParticleGlow so the particle knows what to do after it spawns.

The first issue we have is the particle lasting forever, so we need to add Lifespan Decay, this operator makes the particle die after the Lifetime Random value we set before expires.
As always, click Add... then click Lifespan Decay.
We don't need to change any of the values here.



Now it looks like the glow just appears and disappears, which makes it look bad. To fix this, we add Alpha Fade In Random to fix the appearing randomly, and Alpha Fade Out Random to fix the disappearing randomly. These operators behave the exact same, so I'll just be showing how to set up Alpha Fade In Random.
First we set the Proportional value to 0, so it will take 0.25 seconds to fade in, instead of 25% of 1.25 seconds to spawn in.
Now we have a particle that fades in and out over it's life span.



What if we wanted the glow to move down after spawning? We would need to add Movement Basic and set the Gravity value to 0 0 -4
X Y Z, 0 0 0, X is the red line, Y is the green line, Z is the blue line, so you can play with the Gravity value to see how the glow moves after spawning.



Now if we look at the particle count, we'll see that it's 7/1004. This means the game will expect 1000 individual particles to spawn from this system, instead of just 7. So to fix this, we go back to properties and set Max Particles to 7, instead of 1000.
It will show 7/12, but it's a visual bug, the max is always 4-7 more than the actual max of the particles.
Setting up ExampleParticleOrbit
Let's make a simple orbiting particle. So like before, click Create, and name the new particle ExampleParticleOrbit.
We set the max to 1 here, since we only want one particle to spawn and orbit around the head.
We're also going to set the particle image to effects\animated_cow\animated_cow.vmt
Rendering ExampleParticleOrbit
This is an animated sprite, instead of just a static png, so we're going to have to do something else in Renderer.
Like before go to Renderer, add render_animated_sprites, now here's where it gets different.
We set use animation rate as FPS, since this is easier to understand. We change the animation rate until we like how fast the cow is spinning. For this example, we use 4.
Initializing ExampleParticleOrbit
In Initializer, we use Position Within Box Random instead of Position Modify Offset Random, since this particle will not be a child to another particle.
We set the max and min value to 12 0 0 so the cow always spawns 12 hammer units offset on the X axis.
Operating ExampleParticleOrbit
We want to set up the actual orbiting function of our particle, so we go to Operator, and add Movement Rotate Particle Around Axis.
These default values will do exactly what we want, so we don't change these.
We also add Movement Lock to Control Point, so that the cow's orbit is locked to the player's head, instead of staying still.
Childing our Glow to our Orbit
We want the glow to be a child to our orbit, so we go to the dropdown menu and go to Children, click Add... and click on ExampleParticleGlow. This will make the glow spawn from our cow.
Testing and Debugging our Particle System
Now we want to debug our particle system. The first step is to save our particle system in tf/custom as ExampleUnusualEffect.
Now we're going to override Sunbeams. Click Create and make a new particle called Superrare_beams1, and child our ExampleParticleOrbit to it. Save our file once again, and then click F10 F11 in that order. None of the menu buttons will work so we have to operate our game through the console.

Type
map itemtest to load into the itemtest map. This is done because this map loads pretty quickly.

After loading into our map we open the console again and type in
itemtest
This will open up a new menu that looks like this
We can click buttons here, so we select the class we want to test our effect with. In this example, we use Medic.

After clicking on our class, the menu should look like this now.
Click on headgear, and a new window will open up, set the hat to an existing item, this will open up a dropdown menu in alphabetical order, most people use Unusual Cap to test, so that's what we will do here.

Now set the effect to Sunbeams.
Click Apply Test Items, and if everything goes right, our effect will show up in game.

In our case, it did not go right.
So we press F10 again to go back to the particle editor UI.
Delete Superrare_beams1 and create a new one called superrare_beams1, since the unusual effects are case sensitive.

Press F10 F11 to get back into game, and to reload our particle system we type
record fix; stop into the console, and if everything goes right our effect will show up in game!


Hopefully this has helped you in creating unusual effects, and good luck on your journey!
112 則留言
Барсик 7 月 27 日 上午 1:06 
But the fact is that I'm in the game menu with the console open and I don't know what to do next. The program for creating effects has not appeared. Maybe I did something wrong?
HasteReapr  [作者] 7 月 26 日 下午 1:31 
when you load into the map, as the tutorial shows, you have to open your console and type sv_cheats 1 so you can use the options like itemtest
Барсик 7 月 26 日 下午 1:01 
Do I need to specify this in a batch file or in a launch parameter? (I'm a novice in this matter)
HasteReapr  [作者] 7 月 26 日 下午 12:42 
You didnt do sv_cheats 1 when you loaded into itemtest
Барсик 7 月 26 日 上午 4:45 
I wanted to try to create an unusual effect. I created a batch file, put the code there, and moved it to the Team Fortress 2 folder. I wrote a command to launch and unfortunately the game starts with the command line, which says that cheats cannot be used in multiplayer. Honestly, I don’t know what to do, but after reading below I realized that this function is not available due to a breakdown :(
HasteReapr  [作者] 7 月 24 日 下午 7:42 
Put it in a .zip file, go through the workshop upload process. It's best to get promotionals for your effect done and then use those in the upload process too.
HasteReapr  [作者] 7 月 14 日 下午 8:25 
That means you didn't add any "position within X" initializers, so it defaults to the map origin. Add either "position within box", "position within sphere", or theres another one but its ehhh
egg 5 月 16 日 下午 3:05 
i have tried it. it didnt work but i cant confirm that its not working cuz i think i messed up with smth
HasteReapr  [作者] 5 月 16 日 下午 1:41 
Yeah, the particle editor is currently broken. As I stated in the intro of the guide, you can find a fix.
egg 5 月 16 日 上午 9:36 
idk why but when i type -tools the game start like nothing happened