How to create an animated spray in Team Fortress 2

4 August 2009 by Gonzo, 2 Comments
How to create an animated spray in Team Fortress 2

Leaving your mark in Team Fortress 2 is easier then it seems. Users can create their own sprays or download them from a site like gamesprays. How to use them, or how to make normal (transparant) sprays can also be found on over there. As are all the sprays I’ve created so far and (hopefully) this tutorial.

So you want your sprays to have that extra pop? You want them to move and shake a little? Well this handy little guide will tell you how. Here’s what you need:

  • Photoshop C.S. or something simular like GIMP (I’m using PS for this tutorial)
  • Team Fortress 2
  • Winrar
  • Notepad
  • Vtex (provided)

Ok, here’s the spray we’ll be making:

spray-exemp

It’s important to remember that there is a size limitation of 120KB, which is why we are creating these sprays at 128×128 pixels instead of 256×256 pixels. The game itself will enlarge them to 256×256, albeit a bit blurry (as seen in the example). Due to this size limitation, there’s also a limit to the number of frames. It’s a bit touch and go there, I found that 5 frames is safe.

First we’re making the frames we’re using. Create a new document in photoshop at 126×126 pixels and a transparent background. Write a 1 in the center of the frame (in courier sans). Save this image as .psd so you can later repeat the steps below for the 2 and the 3, simply by changing the writing.

tut1

Next rightclick on the layer and choose rasterize type.

tut2

Now we have a pixelated 1 in the middle of an empty document.
Next click the channel tab and the new channel tab to create an alpha channel.
tut3

Using the magic wand selection tool, click outside of the 1 and make this black in the alpha layer.

Remember:

  • White = Visible
  • Black = Fully Transparent
  • Shades of Gray = Partial Transparency

tut4

Now it’s time to save the file as spray001.tga

Repeat the above steps for the 2 and the 3 and place these three files in the same folder with filenames ending with 00# where # is the number of the frame, 1 being the first frame.

When you’re done you should have three files: spray001.tga for the 1, spray002.tga for the 2 and spray003.tga for the 3.

Now it’s time to convert the file to a spray for Team Fortress. The method I’m using is something that I’ve taken from another website which has been taken down now, so I’m hosting the file myself. But the credits go to a guy named SMiDDY. I have left the original readme.txt in the rar, so credits go where credits are due.

First download this file and unrar it somewhere on your computer.

Now put all three .tgas in the hl2/materialsrc/animated folder inside the folder that was made when un-raring the file.

Edit the spray.txt file (in the same folder) in notepad and replace the endframe value to the amount of frames you have, 3 in this case.

Run convert.bat – your .vtf will appear at hl2/materials/animated/
Note: If your .vtf file is over 120kb, you will have to go back and edit the amount of frames you have of the size of your frames until they are under 120kb, otherwise you will not be able to use the spray.

I advise to rename the file now to something like: counting-ani.vtf

Put the .vtf file into <steamfolder>\steamapps\<your_steam_ID>\team fortress 2\tf\materials\VGUI\logos\

Open notepad and make a new file and put in this text:

LightmappedGeneric”
{
“$basetexture” “vgui\logos\gabedance”
“$decal” “1″
“$decalscale” “1″

}

Then save it as counting-ani.vmt in the same dir as you saved the .vtf (or a different name if you renamed the file differently).

And that’s all, fire up Team Fortress and test out your new spray.

FacebookHyvesTwitterDiggStumbleUponShare

2 Responses to “How to create an animated spray in Team Fortress 2”

  1. Gonzo 4 August 2009 at 16:34 #

    And yes, I do realise the example .gif is a different 1 (now) but that’s because the courier is apparently different on the mac then it’s on my p.c.

  2. Wordpres templates 23 April 2011 at 11:27 #

    Great artical, I unfortunately had some problems printing this article out, The print formating looks a little screwed over, something you might want to look into.


Leave a Reply