Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Click Texture Switcher

Erik Bligh
Registered User
Join date: 25 Feb 2006
Posts: 27
02-20-2007 17:11
Hey guys, I need a script that changes to the next texture on click. The free ones I have switch to a random texture in the object, not the one that's next. Does anyone out there have a script that will go to the next texture in line or should I make a script that has a new state for each texture?
Hutton Richez
Registered User
Join date: 4 Dec 2006
Posts: 11
02-20-2007 17:58
Do not make a new state for each texture. This will cause a big problem with touch_start as it will be triggered every time the state changes if the player holds down touch on it.

You may want to check out the inventory functions for grabbing the list of inventory items that are textures and then llSetTexture to set the texture.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-21-2007 01:04
From: Erik Bligh
Hey guys, I need a script that changes to the next texture on click. The free ones I have switch to a random texture in the object, not the one that's next. Does anyone out there have a script that will go to the next texture in line or should I make a script that has a new state for each texture?


Where the orginal script chooses a random number make it just increment to the next item.
bucky Barkley
Registered User
Join date: 15 May 2006
Posts: 200
02-21-2007 09:44
On startup or inventory change, you want to loop through inventory and build up an array of references to your textures. After that, it's a matter of keeping track of a "current" pointer that is affected by previous/next buttons.

Mosey on over to: http://rpgstats.com/wiki/index.php?title=Inventory