That is done by creating an animated texture. I'm going off of my memory on this, because i've never tried to make an animated texture for TF2. This is just a modified version of how I did it for CSS.
What you do is make 4 .tga files, each one is your "frame" of animation, so one .tga will be a solid color of red, then blue, etc. Save those .tga images in the following format:
"imagename000.tga" for the first one, and "imagename003.tga" for the last.
Then create a .txt file and call it "imagename.txt" (the "imagename" always being the same as your .tga files.) Inside that .txt file, you should have the following, exactly as you see it below.
"startframe" "0"
"endframe" "3"
Put that .txt file and your 4 .tgas into a folder in the "sourcesdk_content\tf\materialsrc" directory. That folder you made should also be in your "team fortress 2\tf\materials" directory. Make sure it's the same name, because if it isn't, then Vtex won't find a place for your textures, and it'll give you an error. If you don't have a "materialsrc" folder in your "sourcesdk_content\tf\" directory, make one. Leave that directory open, and open another one and go to "sourcesdk\bin\orangebox\bin" and look for "vtex.exe". Drag your "imagename.txt" file onto the vtex.exe and release it. Vtex should then automatically make your animated texture, and place it in the proper directory: "team fortress 2\tf\materials". Now you'll have to make your .vmt files. To do that, make a new .txt file, and put the following in it:
Code: Select all
"LightMappedGeneric"
{
"$baseTexture" "foldername/texturename"
$surfaceprop metal [Change "metal" to whatever you want this texture to act like when walked on or shot. Basic surfaceprops are metal, concrete, wood and glass.]
"Proxies"
{
"AnimatedTexture"
{
"animatedTextureVar" "$basetexture"
"animatedTextureFrameNumVar" "$frame"
"animatedTextureFrameRate" "2" [Set this number higher if you want it to flash faster]
}
}
}
Feel free to change "LightMappedGeneric" to "UnlitGeneric" if you don't want your texture to be affected by lights, ie: to make it always seem to be fully lit up. That's what I used for my animated textures. Save that file as "imagename.vmt", ensure that you keep the same name for all your .tga files, .vmf and .vmt files, for convienience's sake.
That should be it. Like I said, this was all from memory, so if something doesn't work out right, let me know and i'll see how I can go about fixing it.