Creating Animated Sprites and Textures

A Tutorial for Source Engine

Hey, you! We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending Xero points.
  • Post: Give Xero your thoughts on this Tutorial.
  • Vote: Help Xero win the Monthly Awards.
  • Rate: Give this Tutorial a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Tutorial.
  • Watch: Get notified when this Tutorial is updated.
Mascot

Interested?

Sign up

Already a Bananite? Login

To create an animated sprite or texture you must first create a tga for each frame of the animation. Name these images image001.tga, image002.tga, image003.tga, etc, etc. Now create a text file with the following format and name it the same as the images (e.g. for the above example use image.txt):
 "startframe" "1"
 "endframe" "3"
Run the vtex command just as if you where creating a single texture, but instead of putting the tga on the command line use the .txt file, e.g. vtex -mkdir -shader sprite materialsrc/mymaterials/image.txt This will create a vmt and vtf file in materials/mymaterials For a an animated sprite edit the vmt file to look like the following :
 "Sprite"
 {
 	"$spriteorientation" "parallel\_upright"
 	"$spriteorigin" "[ 0.50 0.50 ]"
	"$basetexture" "mymaterials/image"
 }
NOTE: The frame rate and scale of the sprite are specified in the env_sprite entity For an animated texture which can be used on walls or skyboxes you need a different vmt as follows
 "LightMappedGeneric"
 {
  "$baseTexture" "mymaterials/image"
  "Proxies" 
       { 
         "AnimatedTexture" 
         { 
            "animatedTextureVar" "$basetexture" 
            "animatedTextureFrameNumVar" "$frame" 
            "animatedTextureFrameRate" "2" 
         }
    } 
 }
If you are creating a texture for a model, then change the shader from LightMappedGeneric to VertexLitGeneric. For animated textures the framerate is specified in the vmt file (In the above example it is 2 frame/sec) NOTE: Setting framerate of a spraypaint's vmt-file doesn't seem to work! Tutorial by CannonFodder, brought to CSB by [Xero].

Posts

  • 9y
    Treet avatar
    Treet Offline
    Member Joined 10y
    775 points Ranked 5908th
    Pros: It tells you how to basically get through it easily, and it's basically a copy and paste thing, which isn't bad. I liked this tutorial.
    Cons: Here is the thing, the tutorial title is misleading, it tells you the final step on making it, but you don't know how to install it, or if you want to edit a sprite or something, it doesn't really help you. Screenshots are not provided but it's still good. You don't have the sizes needed for things, so it might not work for some people.
    Improvements: Try and add the sizes that you should use, and maybe a FAQ. Like some people get an error where it says it has to be a power of 2. Maybe explain what that means and work on that to make more questions or problems; with answers of course.
    Notes: Very good tutorial but like said it needs more improvement. : )

    8.8/10

    It's time for another; so I ca avatar
    Mantra
    It's time for another; so I ca
  • 9y
    NeonWarrior avatar
    Member Joined 9y
    2,358 points Ranked 1986th
    Nvm i worked it out

    good tut
    wanna-be skinner avatar
    Mantra
    wanna-be skinner
  • 9y
    Ayo Ionic avatar
    Ayo Ionic Offline
    Member Joined 9y
    377 points Ranked 10961st
    Is it possible to make a non-looping texture? Like a decal? I'm just wondering.

    And if so, how do you do it?
    Nobody gets out alive. avatar
    Mantra
    Nobody gets out alive.
  • 11y
    Mr. Colt avatar
    Mr. Colt Offline
    Member Joined 11y
    188 points Ranked 18541st
    Posted by maxdamage68

    Is it possible to make an animated sprite for a muzel flash?


    Nah I think the mozzle flash is only a single frame sprite, because valve thought it would be a nice idea...NOT!
    Banned
  • 11y
    maxdamage68 avatar
    Member Joined 12y
    1,182 points Ranked 3977th
    Is it possible to make an animated sprite for a muzel flash?
    Bananite avatar
    Mantra
    Bananite
  • 11y
    //.exe avatar
    //.exe Offline
    Member Joined 11y
    1,223 points Ranked 3850th
    Share... Enlighten us.
    //.executioner avatar
    Mantra
    //.executioner
  • 11y
    Apez avatar
    Apez Offline
    Member Joined 12y
    149 points Ranked 21779th
    : D I use Somtin Else : D
    ~The Ape Needs Banana~ avatar
    Mantra
    ~The Ape Needs Banana~

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Original Authors
Cannonfodder
Author
Contributors
Xero
Xero Offline
Member Joined 12y
8,312 points Ranked 527th
Formatting

Submitter

Xero avatar
Xero Offline
Member Joined 12y
8,312 points Ranked 527th

Xero
Redistributor
Are you the owner? Request Ownership
Sign up to access this!
Sign up to access this!
Sign up to access this!
Sign up to access this!

Details

Difficulty Level
Intermediate Difficulty

Attributes

Stats

Posts
8
Views
19,969
Date Added
12y
Date Modified
2y

Scores

80 bScore
9.3 Rating
8.8 Critic

3 voters

1 critic

Sign up to access this!

More from Submitter

bcp.crwdcntrl.net tracking pixel