Animated Spray Tutorial

04-01-2007, 09:54 PM Come play on our servers!
Okay guys, I know a handful of people who requested on how I made my animated spray. This spray works on CS:S and DOD:S
Well here is how..

I use photoshop CS2, but similar freeware programs such as the GIMP can be used as well.

1) Make, Or get the images of choice you want to be in your spray. As you can see I took pictures of my disk tray opening... A simple yet funny spray!
You must make sure your images are 128x128 in size, or any acceptable dimensions with an area less than or equal to 128x128.

2) This is extremely important. Save your images as 32 bit .TGA's named spray001.tga , spray002.tga..etc. MAKE SURE THEY ARE IN CORRECT ORDER. For this tutorial i have 3 images, so they are subsequently saved as spray001.tga, spray002.tga and spray003.tga.

3) You will need this program: Animated Texture Converter, Download it here (if link doesn't work, copy and paste it into new internet window) . Unzip the contents of the download. Now, copy and paste your spray TGA's into the: new_working_vtex\hl2\materialsrc\animated folder. You will see a .TXT document in that folder also. You need to open this and change the last line "End Frame" number to the number of frames of animation you have. For this tutorial i have 3 images, so my number will be "3".

Now save the text file

4) Now go back a few folders to your new_working_vtex folder and click on convert.bat. You should see something similar to the following:

5) Now go to your "new_working_vtex\hl2\materials\animated\" folder. You should see 2 files: spray.vmt and spray.vtf. THE FILE SIZE OF YOUR .VTF FILE MUST BE UNDER 120kb or your spray WILL NOT work. If you kept your dimensions to 128x128 or equivelent as stated in step 1, you should be fine.

Now, you must open the spray.vmt file. This can be opened in NOTEPAD. here is how..

Then Click OK.

When it is opened you will see the following:

_"$baseTexture" "animated/spray"

Now erase all of that and copy and paste this in its place

"$basetexture" "vgui/logos/gabedance"
"$decal" "1"
"$decalscale" "1"


6) Now save it. At this point you should have 2 files. The spray.vtf file and your code modified spray.vmt file.

It is now safe to rename these files to distinguish among other custom sprays. They MUST have the same name though. So I will rename mine: DiskTray.vmt and DiskTray.vtf

7) Copy and Paste these files into the root of your hard drive for simple acess, in my case its Drive (D:/) On your computer it is probally Drive (C:/)

8 ) Load up Day of Defeat: Source or Counter Strike: Source

On the main menu click Options and then click the Import Spray button

You will get this

In the drop down menu, Click the Drive letter you pasted the files into (in my case Drive D:/)

Click the YOURFILE.vtf then click ok

Restart your computer!

Load up The game you have the spray on, Join a room..... And test it out!

Here is the final product:

If anything here is not clear, Please ask me and I will point you in the right direction.

Thanks everybody and enjoy!

04-02-2007, 01:13 PM

nice tut Ben

Im sure Ill have a couple questions... see ya on TV1!

Day of Defeat Forum Archive created by Neil Jedrzejewski.

This in an partial archive of the old Day of Defeat forums orignally hosted by Valve Software LLC.
Material has been archived for the purpose of creating a knowledge base from messages posted between 2003 and 2008.