Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Client sided XMAS lights

White Platini
DNA Fusion
Join date: 12 Jan 2005
Posts: 51
12-14-2005 18:08
Since long ago I wanted to contibute to this place with something so here it is:
CODE

// Random XMAS Light script:
//
// This script picks a random color from a list then uses a specialtexture and the
// animation command to make it blink, this metod reduces the load of the server
// since the animations are done client sided.
//
// By White Platini

float time; //blink of the light, must be betwen 1.0 - 2.0
vector light_color; //color of the light.
list colors = [<1,1,1>, <0.16,0.16,0.16>, <1,0,0>, <0,1,0>, <0,0,1>, <114.000000, 178.000000, 66.000000>, <0.917647, 0.917647, 0.000000>, <1.000000, 0.501961, 0.000000>, <0.541176, 0.070588, 0.952941>, <1.000000, 0.576471, 1.000000>, <0.000000, 0.501961, 1.000000>];

default
{
state_entry()
{
//Get a color from the list
light_color = (vector)llList2String(colors, (integer)llFrand(llGetListLength(colors)));

//Get random time
time = (llFrand(10) * 0.10) + 1; //time of the light, must be betwen 1.0 - 2.0

//Set the color on the prim
llSetColor(light_color, ALL_SIDES);

//Sets the special texture
llSetTexture("52a9d11c-b0ce-e5f2-2d5b-475ac2400537", ALL_SIDES);

//Engages the blinking animation
llSetTextureAnim(ANIM_ON | LOOP, ALL_SIDES,2,1,0,0,1);
}
on_rez(integer blah)
{
llResetScript();
}
}


Hope it can be useful for everyone.
_____________________
-Kaze to issho ni, Mew-
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
original Thread
12-19-2005 20:08
/15/9a/77457/1.html
_____________________
i've got nothing. ;)
Alfred Lardner
Mad Scripter.
Join date: 28 Dec 2005
Posts: 28
01-14-2006 07:52
If you're going to be using per-prim texturing anyway, why not use a repeating particle system for each prim and set them to low-alpha black? That gives you clientside rendering with less load on both ends. I think.
_____________________
Needlessly complicating LSL since 2005.
White Platini
DNA Fusion
Join date: 12 Jan 2005
Posts: 51
01-19-2006 15:21
Well at that moment I had the particles quite busy with the XMAS snow we made ^^
_____________________
-Kaze to issho ni, Mew-