Creating Animated Sprites and Textures

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].

Oh noes! You're not a Member!

Want access to cool stuff? As a member you can:

  • Post. Give the submitter your thoughts on this Tutorial.
  • Say Thanks. Show your appreciation by sending the submitter points.
  • Stamp Posts. Let other posters know what you think of their posts.
  • Rate. Give this Tutorial a rating out of 10.
  • Flag. Alert moderators and warn members of a problem with this Tutorial.
  • Vote. Vote the submitter for the Monthly Awards.
  • Subscribe. Get notified when this submitter submits again.

Interested? Register or Login

Comments

  • Treet's Levels
    • P1: Beggar
      Points: 775
    • E2: Guide
      EF: 27
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 5 years ago

    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. : )

    User Title
    It's time for another; so I ca
  • NeonWarrior's Levels
    • P2: Drudge
      Points: 2,358
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 5 years ago

    Nvm i worked it out

    good tut

    User Title
    wanna-be skinner
  • Ayo Ionic's Levels
    • P1: Beggar
      Points: 377
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 5 years ago

    Is it possible to make a non-looping texture? Like a decal? I'm just wondering.

    And if so, how do you do it?

    User Title
    Nobody gets out alive.
  • Mr. Colt's Levels
    • P1: Beggar
      Points: 188
    • C1: Member
    • A6: Elder
      Account Age: 7 years
    Posted 7 years ago
    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
  • maxdamage68's Levels
    • P2: Drudge
      Points: 1,182
    • C1: Member
    • A6: Elder
      Account Age: 7 years
    Posted 7 years ago

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

    User Title
    Bananite
  • //.exe's Levels
    • P2: Drudge
      Points: 1,218
    • C1: Member
    • A6: Elder
      Account Age: 7 years
    Posted 7 years ago

    Share... Enlighten us.

    User Title
    //.executioner
  • Apez's Levels
    • P1: Beggar
      Points: 149
    • C1: Member
    • A6: Elder
      Account Age: 8 years
    Posted 7 years ago

    : D I use Somtin Else : D

    User Title
    ~The Ape Needs Banana~

Credits

Submitter
Xero's Levels
  • P3: Peasant
    Points: 8,168
  • E1: Helper
    EF: 17
  • C1: Member
  • A6: Elder
    Account Age: 8 years
Xero (Creator/Co-creator)
Key Authors
unknown
Unknown

Rating

9.3/10
Based off 3 rating(s)

Additional Info

Genre
Other/Misc
Difficulty Level
Intermediate

Stats

Post Count
8
ViewCount
15,232
Date Added
8 years ago
Date Modified
1 year ago

Share

Embed Code
Code to use:

More embeddable images

Bookmark and Share