1. Hey there Guest,

    The game servers have moved to semi-dedicated hardware and IPs have changed. Please see front page server widget for up-to-date game server information.

The Big Particle Editor Tutorial

Discussion in 'Tutorials & Resources' started by Fearlezz, Nov 7, 2009.

  1. Fearlezz

    Fearlezz L10: Glamorous Member

    Messages:
    787
    Positive Ratings:
    242
    Tutorial Index:
    [ame="http://forums.tf2maps.net/showthread.php?p=120891#post120891"]#1 - Fireballs[/ame]

    [ame="http://forums.tf2maps.net/showpost.php?p=121095&postcount=7"]#2 - Installing your .PCF file[/ame]

    ______________________________________________________________________________________________

    [​IMG]

    So I thought I'd start this series of particle editor tutorials with something fast, easy and fun. A fire ball.
    Usually though when you see tutorials for beginners for applications, they go through the interface and what everything does. But Ive decided to skip that boring part and just jump right to the fun, and eventually, you'll learn what everything does. This is what you should have if you've followed this tut correctly.
    [​IMG]

    So lets get started. First thing you might want to know is how to start the particle editor for TF2.

    Go to your game properties and add this line to the launch options
    Code:
    -tools
    Close it down and start the game. Dont forget tho, when the game has started, go to tools and choose the particle editor.

    Go ahead and go to File, and press New. This will create a blank .PCF. A PCF file is the file that contains all the particle systems.
    [​IMG]
    So this is probably what you should see right now. If not, you've already done something bad, so go back and read again. :p

    So, let's start then. Press, Create in the Particle System Browser window. Enter a name of your liking, I decided to use Fireball_main. This name will also be the name you will use in hammer to use the particle.

    [​IMG]
    When you've created your particle system, go ahead and press it once to select it. When you've selected it, you can change it's properties, and other cool stuff. You can navigate through the other properties by clicking on the drop down menu.​

    The very basic properties you need for any particle are the following;
    1. A emitter, can be found in the Emitter menu
    2. render_animated_sprites, can be found in the Renderer menu, and is needed to render the particle
    3. Lifetime random, can be found in the Initializer menu
    4. Alpha Fade and Decay, can be found in the Operator menu
    5. Movement Basic, can also be found in the Operator menu. And this is needed for any dynamic particle.

    To add a attribute to one of the properties, you right click and press Add. It looks like this.
    [​IMG]

    A new window pops up, this is where you select the attribute. On the image, I'm adding a emitter. For this case, a fireball, you'll need to add emit_continuously. This means that particles will continuously be created in this particle system ;)
    [​IMG]

    When you've added the emitter, you might notice how the particle count goes from 0 to 1000 pretty fast, without you seeing anything. This is why we need a renderer, so we can actually see the particle.

    Go to the Renderer menu and add the render attribute I mentioned before (render_animated_sprites). It doesn't matter if the material we are gonna use for the particle is animated or not, this is the basic render attribute you want for the particles to show up.

    [​IMG]
    So now that you added the render attribute, you will see a white box in the preview. This is the default material for the particle. You'll also notice that its just standing there, doing nothing, well, thats because we haven't added any other attributes needed in the other menus. Lets do it!​

    But first, lets change the material to a animated fire material. Go to the properties menu and find a animated fire texture
    [​IMG]
    A animated texture always looks like this in the preview​

    Now let's quickly go back to the emitter and change the Rate value, from 1000 to 20. This value tells the game how many particles per second should be created. This is why you should be really careful so you don't get too many particles to avoid lag.
    Now let's go back to the Renderer. Change the value animation_rate to 0.9. This just tells the speed of the animation of the animated material we selected.

    Go to the Initializer menu and Add these attributes;
    • Lifetime random, tells the game how long one particle should be alive, before decaying.
    • Color Random, the color of a particle.
    • Position Within Sphere Random, decides where, within a sphere a particle should be spawned. If you do not have a "Position within.." attribute in your particle, it will spawn at the 0 0 0 cords in the map its used in.
    • Radius Random, size of a particle.
    • Rotation Random, rotation of a particle.

    If you where to zoom in, in the preview window right now, you would see a very small fireball. But this is not exactly what we want to achieve. So go ahead and change these values in the attributes.

    Lifetime random
    Lifetime_min - 1
    Lifetime_max - 2
    Color random
    Color 1 - 255 223 95 255
    Color 2 - 255 187 120 255
    Position Within Sphere Random
    distance_max - 5
    Radius random
    radius_min - 8
    radius_max - 10

    Basically, you have your fireball now. But we aren't done quite yet. Go to the Operator menu and add these attributes;
    • Alpha fade and Decay, fades the particle and removes them. Reads from lifetime random.
    • Movement Basic, basic movement.
    • Radius Scale, scale the size of a particle after it has been spawned.

    Change these values in them;

    Movement Basic
    gravity - 0 0 50
    Radius Scale
    radius_end_scale - 3

    And there you go. You should have something that looks decent enough like a fireball. But if you take the performance problem away you can always change the emitter rate value to, say, 200 and it will look even move like a fireball. But you cant use anything like that ingame without anyone lagging.

    Now go try some stuff and play with the properties of the fireball to get a better hang of things!
     
    • Thanks Thanks x 18
    Last edited: Nov 8, 2009
  2. jpr

    aa jpr

    Messages:
    1,095
    Positive Ratings:
    543
    argh, I see waffles even outside tf2!
    ...oh wait, that's just the sprite sheet
     
    • Thanks Thanks x 1
  3. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,884
    Positive Ratings:
    5,127
    Ahh, thank you. I've used the particle editor before but never well. This helps!
     
    • Thanks Thanks x 1
  4. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,517
    Looks like a good starter tutorial!
    When I decided to start making my own particle effect (panic stage2) I was just going in there blindly and adjusting every value possible to see what it did... in the end it took me so much time I got frustrated and didn't learn much.

    Might have another go with this one.

    For a next (since this is #1 I assume...) tutorial can I put a vote in for 'something' that uses positions/control points? I never really understood them.
     
    • Thanks Thanks x 1
  5. gamemaster1996

    gamemaster1996 L13: Stunning Member

    Messages:
    1,065
    Positive Ratings:
    134
    Damn i never new this was there...sooo making mad explosions
     
  6. Fearlezz

    Fearlezz L10: Glamorous Member

    Messages:
    787
    Positive Ratings:
    242
    Maybe for a number 4 or 6 since I plan to go harder as I go higher in number.
     
  7. Fearlezz

    Fearlezz L10: Glamorous Member

    Messages:
    787
    Positive Ratings:
    242
    [​IMG]
    Installing your .PCF file​

    This one is shorter then the first tutorial. But I simply think that this needs to be out there for those who still don't know how to install particles so they can use it in their map.

    Let's continue from where we left off. The fireball. Let's save the PCF file and name it whatever you want. I usually save my PCF files in this format; mapname_particles.PCF

    But it doesn't matter what you name the PCF. For this fireball pcf, I'll just save it as, fireball_particle.PCF. Save your PCF file in your particles folder, if you don't have one, create it.
    [​IMG]
    Just remember what you named it and let's move on.​

    Go to your map folder and create a .TXT file and name it what ever you map is named and add _particles.txt
    A example would be, ctf_mymapname_a7_particles.txt. In it, you need this piece of text;

    Code:
    particles_manifest
    {
    		"file"		"!particles/[B]fireball_particle[/B].pcf"
    }
    
    You must replace fireball_particle with the name of your .PCF file.

    Now go into hammer and load your map. Put a info_particle_system entity where you want your particle in the map.

    [​IMG]
    In the properties, in the Particle System Name field, type in the name of the particle system you made, not the name of the .PCF file, but the name of the particle file you typed in when you pressed Create in the Particle Editor. In my case, its fireball_main.​

    Change "Start Active?" to Yes, if you want the particle to start emitting when the map starts.

    [​IMG]
    If you've done everything right, you should have your custom particle ingame working like a charm. ​
    Any questions? Ask away!
     
    • Thanks Thanks x 9
  8. cownaetion

    cownaetion L1: Registered

    Messages:
    32
    Positive Ratings:
    1
    This tutorial was great, definitely a good primer for just diving in and meddling. A few more examples of different applications would be a nice addition.

    How do we bundle these with our maps so others can use them? I don't know if they can now be pakratted or not. Anyone know? The only solution I can think of is including them in an archive and having them decompressed at the 'tf' root folder.
     
  9. XFunc_CaRteR

    XFunc_CaRteR L5: Dapper Member

    Messages:
    248
    Positive Ratings:
    17
    It's not explained in this tutorial how to run the game in tools mode.
     
  10. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,377
    Yes it is.