// New Texture Animation engine (2009)
// This script is free from Elite Technology
///////////////////////////////////
// How to make textures animations
//////////////////////////////////
// Things you will need for this.
// 1. Adobe Photoshop version 7.0 or better.
/////////////////////////////////////////////
// 1. Load PS and make a new image at 1024x1024
// Go to edit, then Preferences, then Guides, Grid, Slices & Count and where it says Gridline every. Change this to 256 and make sure it is set on pixels, next to it, you will see the pull down box, the Subdivisions should be 1. Now go to view and turn on Extars and you will see 16 cells and each cell is 256x256 and comes out to 16 frames.
// You do not have to use all the 16 frames if you dont want to. Change the SetLength to how many frames you are using.
// Once you are done with the picture just upload it to sl. When you got it all uploaded just right, click the image and copy asset uuid. You can now just paste the uuid where it says On_UUID_Texture=. For the off mode texture just do same but make sure it is still image only.
CODE
// Club Elite, The Pit UUID texture key
string On_UUID_Texture="e8b37308-ccf3-51e2-48f7-0c84cbcba7a4";
// Off Mode default UUID texture key
string Off_UUID_Texture="334bab25-00dd-4e8c-ef53-bbf7d16d1f45";
integer FACE_SIDE = ALL_SIDES; // Face side of the object to show on
integer TextureAnimationOn = TRUE; // Animation is on by default
integer Off_Mode = FALSE; // Off Mask Mode
integer SetSizeX = 4; // horizontal frames
integer SetSizeY = 4; // vertical frames
float SetStart = 0.0; // Start position/frame number
float SetLength = 16.0; // 16 frames
float SetRate = 5.0; // frames per second
// New function for setting texture animation by BigJohn Jade
SetTextureAnim(integer Modes, integer ObjFace, string UUIDTexture, integer SizeX, integer SizeY, float Start, float Length, float Rate)
{
llSetTexture(UUIDTexture,ObjFace);
llSetTextureAnim(Modes,ObjFace,SizeX,SizeY,Start,Length,Rate);
}
// Turns off the Texture Animation and sets the off mode texture.
TurnAnimOff()
{
SetTextureAnim(Off_Mode,FACE_SIDE,Off_UUID_Texture, 0, 0, 0.0, 0.0, 1.0);
}
default
{
state_entry()
{
if(TextureAnimationOn)
{
llSetColor(<1,1,1>,FACE_SIDE);
SetTextureAnim(ANIM_ON | LOOP,FACE_SIDE,On_UUID_Texture, SetSizeX, SetSizeY,SetStart, SetLength, SetRate);
return;
}
if(!TextureAnimationOn)
{
llSetColor(<0,0,0>,FACE_SIDE);
TurnAnimOff();
llSetColor(<1,1,1>,FACE_SIDE);
}
}
on_rez(integer i)
{
if(TextureAnimationOn)
{
SetTextureAnim(ANIM_ON | LOOP,FACE_SIDE,On_UUID_Texture, SetSizeX, SetSizeY,SetStart, SetLength, SetRate);
return;
}
if(!TextureAnimationOn)
{
llSetColor(<0,0,0>,FACE_SIDE);
TurnAnimOff();
llSetColor(<1,1,1>,FACE_SIDE);
}
}
// If you want to use the linkmessage event
/////////////////////////////////////////////////////////////////
// For on: llMessageLinked(LINK_SET,TRUE,"TURN TEXTURE ANIMATION ON",NULL_KEY);
// For Off: llMessageLinked(LINK_SET,FALSE,"TURN TEXTURE ANIMATION OFF",NULL_KEY);
/////////////////////////////////////////////////////////////////
link_message(integer sender_num, integer num, string str, key id)
{
if (str == "TURN TEXTURE ANIMATION OFF")
{
TextureAnimationOn = (integer)num;
llSetColor(<0,0,0>,FACE_SIDE);
TurnAnimOff();
llSetColor(<1,1,1>,FACE_SIDE);
}
if (str == "TURN TEXTURE ANIMATION ON")
{
TextureAnimationOn = (integer)num;
llSetColor(<0,0,0>,FACE_SIDE);
SetTextureAnim(ANIM_ON | LOOP,FACE_SIDE,On_UUID_Texture, SetSizeX, SetSizeY,SetStart, SetLength, SetRate);
llSetColor(<1,1,1>,FACE_SIDE);
}
}
}

