Animated Textures
Creating and using animated textures in PAC.
Requirements
VTFEdit
Creating Textures
Getting image files
To create an animated texture file you'll need a sequence of image files, you can get them by converting existing animation files such as .GIFs or creating them yourself. There are multiple methods of acquiring those files, some of them will be listed here but you can use your own methods if you prefer.
If you already have the image files you can skip to Creating animated .VTFs
- Go to EZGIF.COM
- Click on Browse/Choose Files and select your file
- Click Upload!
- Once you're done editing, select the Split tool
- Scroll down to Split options:
- If your .GIF is transparent select Output images in PNG format
- If your .GIF is NOT transparent select Output images in JPG format
- Click Split to frames!
- Click Download frames as ZIP
- Open the .ZIP file and extract all the files to a folder
Creating animated .VTFs
This section explains creating animating .VTF files from image sequences. If you already know how to do this and just want to know how to use those files in PAC, go to Using animated .VTF files in PAC
- Open VTFEdit and click on File → Import
- Navigate to the folder with your images, select all of them and click Open
- In the VTF Options window
- Set Normal Format to DXT1
- Set Alpha Format to DXT5
- Set Texture Type to Animated Texture
- (Optional) If you want to reduce the size of your texture, you can use the Clamp option and set the Maximum Width and Height
- Click OK
- Go to File → Save As…
- Name your file and click Save
Using animated .VTF files in PAC
- Upload the .VTF file → Hosting custom content online
- Add a Model to your outfit
- If you're looking for a flat, one-sided model → Use this .ZIP as your model
- Attach a material to the model
- Paste the .VTF link into the basetexture field
- Attach a Proxy to the material
- Set variable to frame
If it is for sprites, beams or particles, the material MUST be an unlitgeneric material, which is found in the 'advanced' part group. And because these parts don't support dynamic material linking (materials can only automatically apply to their parent if it's a model-based part : model, entity, weapon), you MUST name the material part and use that name in the part's path. Rewear if needed. Also, consider placing the material outside the sprite if it still fails to apply. When wearing, the sprite checks the material only once, which is a problem if the material part gets created after it.
Materials are shared, except when dynamic linking (which only works with models). So particles don't support frame progressions that run independently for each particle.
Examples
Expression: Frame range
Expression: start_frame+(timeex()*fps)%range
start_frame - the frame that you want the animation to start on
fps - frames per second
range - how many frames you want to play
Example: 5+(timeex()*24)%10 — Starts on frame 5 and plays 10 frames
Additional Information
Replacing materials → Replacing materials/textures
Proxy expressions → Proxy