Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Prim side announcer (won't destroy textures on existing objects)

Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
01-06-2007 06:12
Script announces how many sides are in an object, and then with each touch it changes that side to red, restoring the previous texture and color on the next mouse click. Makes it possible to drop the script into an existing, textured prim without losing the texture work already applied to it. Normal caveats about having modify rights and permissions, etc -- if you don't own the texture or the prim use at your own risk.

CODE

integer sides;
integer current_side = 0;
string saved_texture;
vector saved_color;
integer set_blank = TRUE;

default
{
state_entry()
{
sides = llGetNumberOfSides();
llSay(0, (string)sides + " sides");
}

touch_start(integer total_number)
{
if (set_blank == TRUE) {
saved_texture = llGetTexture(current_side);
saved_color = llGetColor(current_side);
llSay(0, "Side " + (string)current_side);
llSetTexture("5748decc-f629-461c-9a36-a35a221fe21f", current_side);
llSetColor(<1.0, 0.0, 0.0>, current_side);
set_blank = FALSE;
}
else {
llSay(0, "Restoring side " + (string)current_side);
llSetTexture(saved_texture, current_side);
llSetColor(saved_color, current_side);
set_blank = TRUE;
current_side += 1;
if (current_side >= sides) {
current_side = 0;
}
}
}
}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
01-06-2007 09:33
/54/9c/158927/1.html
_____________________
i've got nothing. ;)