Homeworld Effects Manual: subTextureDWORD()

subTextureDWORD(filename texture, int dimensions, int flag)

Specifies a frame of a texture animation.

mesh is the filename of a texture, starting from homeworld\, not including the .lif extension. dimensions crams four values into one variable, much like an RGBA variable. Its format is [x1 * 16777216 + y1 * 65536 + x2 * 256 + x2] (x1, y1) is the texture co-ordinate for the bottom-left corner, and (x2,y2) indicate the top-right cornesr. Note that this mirrors the Cartesian plane more than it does the standard co-ordinate system of computer graphics, where the origin is at the top-left. flag is usually 1 for the first frame, 2 for the last frame, and 0 elsewhere, but setting it to 0 always doesn't seem to mess anything up.

To create a texture animation, you must follow several steps. First find the textures you want to use. Usually you'll have a set of same-sized textures, one per frame. However, you can also use one large texture with many pictures on it, and use dimensions to choose different pats of that texture for each frame. You can even combine the two approaches, if you are so inclined. Once you have the textures, put them in Homeworld's directory structure: I recommend somewhere in homeworld\etg\textures\, just to be consistant. Finally, create a name for the texture animation in the EBG file, between eventStart() and variable, as seen below:

label(anim_name)
subTextureDWORD(filename1,[64 * 16777216 + 64 * 65536 + 0 * 256 + 0], 0)
subTextureDWORD(filename2,[64 * 16777216 + 64 * 65536 + 0 * 256 + 0], 0)
subTextureDWORD(filename3,[64 * 16777216 + 64 * 65536 + 0 * 256 + 0], 0)
subTextureDWORD(filename4,[64 * 16777216 + 64 * 65536 + 0 * 256 + 0], 0)
int 4294967295
The label() gives the texture animation its name. The subTextureDWORD() commands say which textures to use, and in which order. The oddly placed int statement marks the end of the texture animation. The value 4294967295 is important, don't change it, or the game will think your whole file is an animation, which it isn't. Texture animations are used by calling setAnimation() with the name of the animation.