Homeworld Effects Manual: setAnimation()
setAnimation(string animName, float frameRate, float repititions)
Plays the animName texture animation at frameRate frames per second, up to repetitions times.
This command requires some setup earlier in the file. You must make define what exactly animName means. This is done with a label() statement, a number of subTextureDWORD() statements, and int 4294967295 to mark the end of the animation. Here's an example from my Impossible Creatures billboard:
label(creatureloop)
subTextureDWORD(ETG\textures\ic\archerfish,[256 * 16777216 + 256 * 65536 + 0 * 256 + 0], 0)
subTextureDWORD(ETG\textures\ic\chimpfish,[256 * 16777216 + 256 * 65536 + 0 * 256 + 0], 0)
subTextureDWORD(ETG\textures\ic\chimp,[256 * 16777216 + 256 * 65536 + 0 * 256 + 0], 0)
subTextureDWORD(ETG\textures\ic\chimpgon,[256 * 16777216 + 256 * 65536 + 0 * 256 + 0], 0)
subTextureDWORD(ETG\textures\ic\dragon,[256 * 16777216 + 256 * 65536 + 0 * 256 + 0], 0)
subTextureDWORD(ETG\textures\ic\dragster,[256 * 16777216 + 256 * 65536 + 0 * 256 + 0], 0)
subTextureDWORD(ETG\textures\ic\lobster,[256 * 16777216 + 256 * 65536 + 0 * 256 + 0], 0)
subTextureDWORD(ETG\textures\ic\wolfster,[256 * 16777216 + 256 * 65536 + 0 * 256 + 0], 0)
subTextureDWORD(ETG\textures\ic\wolf,[256 * 16777216 + 256 * 65536 + 0 * 256 + 0], 0)
int 4294967295
animName has to match up with the name of a label() somewhere in the file. The subTextureDWORD() statements specify which textures to use, and you'd better have some. If you try to make an animation that doesn't have any frames, Homeworld makes up some textures for about a second, then crashes. It's not pretty. The int 4294967295 statement lets Homeworld know that there aren't any more frames. If you don't include int 4294967295, Homeworld contines to parse past the end of your animation, finds things it doesn't expect, and crashes. 4294967295 = 2^32 - 1
frameRate is the number of pictures displayed per second.
repetitions is the number of times the animation is allowed to repeat. If you dont have many frames and a high framerate, it's quite possible you will run out of frames before the object the animation is on dies. If repetitions = 0, the last frame will remain. If repetitions is greater than zero, the animation will start over again with the first frame. After repetitions times through all the frames, the animation will stop on the last frame.
Texture animation can be applied to meshes or sprites. If you use an animation on a mesh, every part of the mesh will be textured with the animation, using the texture co-ordinates on the mesh.