Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Lighting color changer?

Tetrae Turner
Registered User
Join date: 14 Sep 2005
Posts: 36
12-15-2006 04:26
I'm loving the new 'Light' effect in the FEATURES tab and have been getting some nice color effects at my tiny dance floor. I was wondering though if anyones created a script that causes an object to alternate between different radiant light colors?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-15-2006 04:29
From: Tetrae Turner
I'm loving the new 'Light' effect in the FEATURES tab and have been getting some nice color effects at my tiny dance floor. I was wondering though if anyones created a script that causes an object to alternate between different radiant light colors?



Try this thread
Tetrae Turner
Registered User
Join date: 14 Sep 2005
Posts: 36
12-15-2006 05:48
Hi. I tried the scripts on that link, but couldn't really get them to do anything. :/

Basically I'm looking for something that'll radiate different colors without any input from me.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-15-2006 07:31
sorry thought you would be able to adapt the scripts quite easily.
for what you want just randomise the colour inside a timer

CODE

integer on = 0;

default
{
state_entry()
{
llSetTimerEvent(0);

touch_start(integer num_detected)
{
if(on)
{
llSetTimerEvent(0);
on = 0;
}
else
{
llSetTimerEvent(1);
on = 1;
}
}

timer()
{
llSetTimerEvent(30 + llFrand(30)); // random change timer 30-60 seconds
vector colour = < llFrand(1), llFrand(1), llFrand(1) >;
llSetPrimitiveParams([PRIM_POINT_LIGHT,TRUE,colour,1.0,1.0,0.5]);
}
}
Tetrae Turner
Registered User
Join date: 14 Sep 2005
Posts: 36
12-15-2006 17:28
Thanks, I'll give that a shot.
grumble Loudon
A Little bit a lion
Join date: 30 Nov 2005
Posts: 612
12-15-2006 22:45
Watch out how often you update the color as prim updates take priority over avatar updates and thus will cause your avatar motion to get jerky.

This is why it's a lot better to use a scrolling rainbow texture when you are making a prim that is changing color.

in your case, however there is no way to do that.

Also note that most users can only process 6 or so light sources.