Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Client-Side Color Loop

Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
01-14-2005 20:21
Moving from simple script to insane script to simple again, here's a ubiquitous script I should have posted a long time ago.

CODE
//Passive, Client-Side Color-Changer by Jeffrey Gomez
//Please use this. It saves a lot of color-swap grief. =D

key colorpallete = "0c23e2ea-a6aa-4ee5-7d86-efafa4b9e221";
//Basic image I uploaded that defines the useable colors.
//For those wondering, this is the MS Paint default pallete, minus black :P
default
{
state_entry()
{
llSetTexture(colorpallete,ALL_SIDES);
llSetTextureAnim(ANIM_ON | LOOP,ALL_SIDES,5,5,0,0,1);
}
}


Looks can be deceiving on why I choose this, out of all the scripts I've written, to put up. Put simply...

If you enjoy color changers in a script, use a variant of this instead of an llSetColor loop. Please! :o

I cannot stress this enough. Cheers to a little bird for giving me the idea to write this.

Simply put, this script is a grief-ender. It solves the problem of having 500 flashing lights going off 50 times, all while making server calls. Instead, this script only makes a single call when invoked, either by the server or a client entering viewing range. Much, much better on the sim as a result.

And for those wondering, here's the sample color palette I've used. You can easily alter it and/or the script to better fit your tastes. The script will run right out of the box, but it uses a texture UUID I uploaded.
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
Original Thread
01-16-2005 23:57
/15/de/33008/1.html


original post that i jacked

one thing I would add to this, as I suggested in this post is that since texture anims are not only client side but are a permanent property of a prim all you have to do to completely eliminate the server having to think about this blinker again is add a llRemoveInventory(llGetScriptName());

if every single llSetText, llParticleSystem, llSetTextureAnim, that never updates would do this we'd save a bunch of extra server cycles.

L8r,
UU
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
02-02-2005 20:13
The problem with this is that it replaces any texture you currently have on the prim, thereby making this script useless if you want the actual light COLOR changed.

But thanks, though.
Zindorf Yossarian
Master of Disaster
Join date: 9 Mar 2004
Posts: 160
06-02-2005 14:55
Well maybe if you put another semi-transparent prim around the one whose color you want to change, and have that cycles colors, you could do it.
_____________________
Badass Ninja Penguin: Killing stuff it doesn't like since sometime in May 2004.
a lost user
Join date: ?
Posts: ?
08-26-2005 20:18
That or make your own textured/multi colored .gif and upload it. =P
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
server-side vs. client-side
03-19-2006 16:39
Really, this is all just more hassle than it's worth. LL simply needs to implement server-side functions for most, if not all, functions. Not EVERYTHING needs to be server-side. Everyone doesn't NEED to have EVERYTHING in-sync. Movement, rotation, scaling, primitive parameters, etc, could all be animated MUCH smoother if client-side. Active Worlds does this and it works well--and it even has a new "global" command where EVERYONE (in range) sees/hears the same SMOOTH effect.
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
03-20-2006 08:41
/54/5e/94850/1.html
_____________________
i've got nothing. ;)