Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: 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
Original Thread
01-06-2007 09:33
/15/de/158885/1.html
_____________________
i've got nothing. ;)
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
01-06-2007 10:29
I don't want to ruin the party here, because this is a useful little script... but there's an interesting command ni the SL client that you might want to know about. If you hilight a prim face with Select Texture, then press control-alt-shift-T (the actual command is buried in the Client menu), it'll tell you the face number and the resolution of the texture on that face.
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
01-07-2007 06:00
Cool beans! I'll check that out, thanks!