| Scripting Discuss scripting for SL and other platforms |
| |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Senior Member ![]() ![]()
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 |
| | |
| | #2 (permalink) |
| Aims too high ![]() | 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; } } |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |