Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Texture swapping / texture animation

Goliat Barbosa
Registered User
Join date: 14 Apr 2007
Posts: 5
11-29-2008 04:02
Hi!

Can someone help me with a script that swaps texture every 5-10 secomd.
There are some scripts that rotates the textures or change the textures when clicked, but i need one that changes textures automaticly.

I have searched, but failed in finding one.

Regards,
Goliat
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
11-29-2008 05:54
It should be fairly simple to make one that just cycles through all the textures in the object's inventory. Keep a number (a global integer) which stores what the current inventory texture number is. We'll increment this each time round.

When your script starts, set a timer event, using llSetTimerEvent(), for however often you want the texture to change. In the timer event itself, increment your texture number from above, and check it against the number of textures in the inventory, using llGetInventoryNumber(INVENTORY_TEXTURE)... if it's reached that number, reset it to zero. Get the current texture name using llGetInventoryName(), and apply that to your object using llSetTexture().


I hope that makes sense. One thing to be aware of though is if your texture changes happen too fast, then the textures might not fully download before they get changed.
Goliat Barbosa
Registered User
Join date: 14 Apr 2007
Posts: 5
11-29-2008 06:28
Yes, this make sense, but i'm not a scripter so i'm not sure how to go about it. Maby i can copy parts from some scripts, to make it work. I have some experience in programming, but LSL is a whole new world. Thanks for the help!

Goliat

From: Pedro McMillan
It should be fairly simple to make one that just cycles through all the textures in the object's inventory. Keep a number (a global integer) which stores what the current inventory texture number is. We'll increment this each time round.

When your script starts, set a timer event, using llSetTimerEvent(), for however often you want the texture to change. In the timer event itself, increment your texture number from above, and check it against the number of textures in the inventory, using llGetInventoryNumber(INVENTORY_TEXTURE)... if it's reached that number, reset it to zero. Get the current texture name using llGetInventoryName(), and apply that to your object using llSetTexture().


I hope that makes sense. One thing to be aware of though is if your texture changes happen too fast, then the textures might not fully download before they get changed.
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
11-29-2008 10:25
I would suggest searching through the script library for items that would help you create the script you want.

Otherwise, you might want to post in a Products-Wanted type forum where I'm sure many would be happy to make you a script like the one you want (whether or not they charge you is up to them).

This particular forum is more about offering tips with actual code than about giving finished code blocks to the persons who ask for them :-)
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
11-29-2008 11:07
There are three places to look for scripts that you can learn from:

(1) the Scripting Library at /15/1.html

(2) the LSL Wiki Script Library at http://lslwiki.net/lslwiki/wakka.php?wakka=ScriptLibrary

(3) the archives of this forum, accessible from the "Search This Forum" tab at the right hand side (top) of the forum's main page.

I'm just learning too, and I find the scripts that people post in those three places VERY helpful.
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
11-29-2008 13:52
You can get a free slide viewer script that does this from any number of places, including the box of free useful stuff at my store in Shona.
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-29-2008 14:03
And to start yourself off on the right foot....
Download and install LSLEditor which is free and created by one of our very own.

Code highlighting, built in ref wiki, formatting, syntax checking and has the ability to test most of the functions out of world. This coupled with your previous coding xp and the links already provided should help a lot.

http://www.lsleditor.org/
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
11-29-2008 14:14
From: Jesse Barnett
And to start yourself off on the right foot....
Download and install LSLEditor which is free and created by one of our very own.

Code highlighting, built in ref wiki, formatting, syntax checking and has the ability to test most of the functions out of world. This coupled with your previous coding xp and the links already provided should help a lot.

http://www.lsleditor.org/


FOR WINDOWS only :(
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
Goliat Barbosa
Registered User
Join date: 14 Apr 2007
Posts: 5
11-29-2008 14:21
Thanks for all the help. You have all been very kind, but i give up,

Greetings
Goliat
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
11-29-2008 16:14
From: ArchTx Edo
You can get a free slide viewer script that does this from any number of places, including the box of free useful stuff at my store in Shona.



@ Goliat,

LOL, What? Using the SLURL in my sig to my shop, and going there to get a free copy was too hard for you? :) http://slurl.com/secondlife/Shona/60/220/30

The slide viewer does exactly what you asked for, changes textures every X seconds and you can write in however many seconds you want.
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo