Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Cycling Indicated Textures

Takan Hannibal
Registered User
Join date: 21 Jun 2004
Posts: 10
08-22-2004 23:16
I've been rattling my brain trying to figure this out, how would i setup a script to do the following

-when button is touched the scirpt will cycle 2 textures and loop them every second

Thank You
Goshua Lament
Registered User
Join date: 25 Dec 2003
Posts: 703
08-22-2004 23:31
If you want the switching to swap the textures once after it is touched, the code should be something like this:

CODE
default
{

touch_start(integer num_detected)
{

llSetTexture("Texture", ALL_SIDES);
llSleep(0.5);
llSetTexture("Texture 2", ALL_SIDES);
llSleep(0.5)

}

}


If you want it to loop endlessly once touched, use something like this:

CODE
default
{

touch_start(integer num_detected)
{

while (1==1)
{
llSetTexture("Texture", ALL_SIDES);
llSleep(0.5);
llSetTexture("Texture 2", ALL_SIDES);
llSleep(0.5)
}

}

}


I can't login from my current computer to test this code for bugs, but with some slight syntax changes, this is roughly how you would do it.
_____________________
Flickr Second Life Photo Gallery

I no longer regularly login to SecondLife, but please contact me if an issue arises that needs my attention.
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
08-23-2004 10:47
If you actually change the texture, it probably won't look so good, since the texture has to "load" every time it changes.

What you probably want to do is make one big texture containing all the textures you want to use and use
llSetTextureAnim
_____________________
Sarcasm meter:
0 |-----------------------*-| 10
Rating: Awww Jeeze!