Texture change script for a sculpt? - SLUniverse Forums
 
Navigation » SLUniverse Forums > Development Discussion and Support > Scripting » Texture change script for a sculpt?


Scripting Discuss scripting for SL and other platforms

Reply
 
LinkBack Thread Tools Display Modes
Old 10-28-2009, 06:49 PM   #1 (permalink)
Senior Member
 
Pamela Galli's Avatar
Refugee
 
Join Date: Sep 2009
Posts: 296
My Mood:
SLShopper Ads: 1
SL Join Date: 11-12-2007
Business: La Galleria
Texture change script for a sculpt?

I have this simple little script I have put in things along with some textures and the item changes textures on touch.

But I need to put a texture change-on-touch script in two sculpted prims and the script does not work (maybe because the sculpts do not have sides?). Is there anything I can change in this script to make it work with sculpts? Or does anyone know of a script that will do that? I need the prim to be a linked one, but it can be root or child.

Thanks!


integer count;

default
{
state_entry()
{
}

touch_start(integer total_number)
{
integer number = llGetInventoryNumber(INVENTORY_TEXTURE);
string name;
number--;

if (count == number)
{
count = 0;
}

name = llGetInventoryName(INVENTORY_TEXTURE, count);
// llSay(0, (string)count);
llSetTexture(name, ALL_SIDES);
count++;
}

on_rez(integer start_params)
{
count=0;
}
}
__________________
Have a dinner party! Cook it in your kitchen and serve it in your dining room!

LA GALLERIA
Pamela Galli is offline   Reply With Quote
Old 10-28-2009, 09:22 PM   #2 (permalink)
Aims too high
 
Scope's Avatar
 
Join Date: Sep 2007
Location: Australia
Posts: 28
My Mood:
SL Join Date: 2006
Business: SCOPE:Metaversal
Send a message via Skype™ to Scope
I'll have a shot...

integer count;
string name;
integer number;
default
{
state_entry() {
}

touch_start(integer total_number) {
number = llGetInventoryNumber(INVENTORY_TEXTURE);
// number--;//Why were we counting backwards? We only want the total?

if (count == number){
count = 0;
}

name = llGetInventoryName(INVENTORY_TEXTURE, count);
llSay(0, (string)count);//Show these for debugging
llSay(0, (string)name);//and comment out when it all works
llSetLinkTexture(LINK_SET,name, 0);//Sculpts use side zero but ALL_SIDES is ok, "I THINK" it may reduce lag if set to zero if many sculpts are changed at once.
count++;
}

on_rez(integer start_params){
count=0;
}
}
Scope is offline   Reply With Quote
Old 10-28-2009, 09:40 PM   #3 (permalink)
Senior Member
 
Pamela Galli's Avatar
Refugee
 
Join Date: Sep 2009
Posts: 296
My Mood:
SLShopper Ads: 1
SL Join Date: 11-12-2007
Business: La Galleria
Yay! It works! Thanks so much!

Last edited by Pamela Galli; 10-28-2009 at 10:22 PM.
Pamela Galli is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On