Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help please I really hope there is a fix for this

Anjo Mirabeau
Registered User
Join date: 20 Aug 2005
Posts: 266
01-10-2006 08:21
I put a rotation on a texture and got it looking right. But when I make copies they are out of wack again. Is there something I can do about that?
Thanks for any help.
Anjo Mirabeau
Registered User
Join date: 20 Aug 2005
Posts: 266
01-10-2006 10:22
Here is the script I am using. Maybe I set the wrong numbers to 0. Which are the correct numbers to set to 0 in order to be able to stretch the texture and have it stay that way even on copies? Thanks for helping.

// anim SMOOTH Script
// By Doug Linden (I think)
//
// Drop on an object to make it change colors.
//
// If you are interested in scripting, check out
// the Script Help under the help menu.

// The double slash means these lines are comments
// and ignored by the computer.

// All scripts have a default state, this will be
// the first code executed.
default
{
// state_entry() is an event handler, it executes
// whenever a state is entered.
state_entry()
{
// llSetTextureAnim() is a function that animates a texture on a face.
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,1,1,1.0, 0,0.15);
// animate the script to scroll across all the faces.
}


}
Anjo Mirabeau
Registered User
Join date: 20 Aug 2005
Posts: 266
01-10-2006 10:50
Update....I found a script that works even when copied. But....there's always a but lol...
Its a little jerky. Can someone help me smooth it out some? Also it sleeps a couple seconds too long for what I am wanting. Thanks Here it is...


// SCRIPT_NAME = "animated texture-simple";
// DESCRIPTION = "animated the texture my offseting the texture at intervals";

//by bUTTONpUSHER Jones
//Mod by BuhBuhCuh Fairchild
//v 1.0

// global variables
integer gCellsAcross = 72;
integer gCellsDown = 1;
// seconds between cells
float gSwitchTime = 0.000;
float gOffsetU;
float gOffsetV;
float gScaleU;
float gScaleV;

key gKey;
vector gScale;


// all scripts start in the default state
default
{
//this state will allow colors to be set
state_entry()
{

gScaleU = 1/(float)gCellsAcross;
gScaleV = 1/(float)gCellsDown;
// U range is -0.5 to 0.5 left to right
// V range is 0.5 to -0.5 top to bottom
// divided by 2 to put focus at the center of the cell
gOffsetU = -0.5 + gScaleU / 2;
gOffsetV = 0.5 - gScaleV / 2;
// next line automatically scales the texture
// llScaleTexture(gScaleU, gScaleV, -1);

// next line focuses the texture on the last cell - for use if this is a click-started animation
// llOffsetTexture(0.5-gScaleU/2, -0.5+gScaleV/2, -1);

state Movie;
}

}

state Movie
{
state_entry()
{
integer i;
integer j;
integer k;
float OffsetU;
float OffsetV;
@Loophere;
// set local offset variables equal to global offset constants
OffsetU = gOffsetU;
OffsetV = gOffsetV;

for (i=0; i<gCellsDown; i++)
{

for (j=0; j<gCellsAcross; j++)
{

llOffsetTexture(OffsetU, OffsetV, -1);
llSleep(gSwitchTime);
OffsetU = OffsetU + gScaleU;
}
OffsetU = OffsetU - 1.0;
OffsetV = OffsetV - gScaleV;

}

jump Loophere;
}

}