Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Small, pulsating light?

Aaron Levy
Medicated Lately?
Join date: 3 Jun 2004
Posts: 2,147
12-22-2004 18:11
I need a small, pulsating light, like a hard drive light... I've been messing with it for about an hour and just thought I'd ask. I don't use particles much, don't really want to learn just for this one tiny, tiny thing.

Basicllay I just need a script that will make a very tiny (.05mx.05m) blinking light, seemingly random. I will be changing it from red to green, I just need help with the small, blinking part.

Thanks
Ardith Mifflin
Mecha Fiend
Join date: 5 Jun 2004
Posts: 1,416
12-22-2004 18:27
Is this a prim-light design, or could you just use a dimpled sphere which changes color from green to red? If you're conserving prims, then I guess you'll have to wait for a particle guru to help ya.
Sam Portocarrero
Jesus Of Suburbia
Join date: 23 May 2004
Posts: 316
12-22-2004 18:29
From: Aaron Levy
I need a small, pulsating light, like a hard drive light... I've been messing with it for about an hour and just thought I'd ask. I don't use particles much, don't really want to learn just for this one tiny, tiny thing.

Basicllay I just need a script that will make a very tiny (.05mx.05m) blinking light, seemingly random. I will be changing it from red to green, I just need help with the small, blinking part.

Thanks


A basic "flasher" script should work, IM im ingame and I'll send you one. As for a particle light it will still have to be based on a prim, so it's really up to your detail.
_____________________
Alpha Zaius
llLol()
Join date: 13 Mar 2004
Posts: 1,187
12-23-2004 10:20
I havent tested this code... so please try to fix if there is a missing semicolon... Ill try my best :)

CODE

integer i;
default {

state_entry() {

llSetTimerEvent(1); //change the 1 if you want to the number of seconds between each color change
}

timer() {

if(i) {
llSetColor(<1,1,1>); //this is the on color (this is a white)
}
else {
llSetColor(<0.8,0.8,0.8>); //this is the off color (this is a light grey)
}

i = !i;
}
}




hope that help!
_____________________
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
12-23-2004 10:58
Ack, don't use a timer! That will add to server-side lag.

Use a very small, animated texture instead.
_____________________
Champie Jack
Registered User
Join date: 6 Dec 2003
Posts: 1,156
12-23-2004 12:13
Would a random sleep between color changes work?

Or, better yet, use llSleep(x) to trigger texture offet.

Does texture offset require an update like a color change does?

Champie
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
12-23-2004 12:19
Dang Hank, you beat me to it :)

To expand a bit, create a tiny, like 32x32 texture with an 8x8 grid of red and green squares, randomly on or off.
Then drop this script in:
CODE

default
{
state_entry()
{
llSetTextureAnim(ANIM_ON|LOOP|PING_PONG,ALL_SIDES,8,8,0,63,10);
llRemoveInventory(llGetScriptName());
}
}


no server side load at all once the object is rezzed.

Lots of animation and particle scripts need to do this.
*Any* script in an item even if it's not doing anything does take a small slice of server time. I believe LL has worked fairly hard at making it a very minimal slice but using the permanent attributes of a prim and removing the script is much much more efficient.


L8r,
UU

P.S. this is a very small and badly compressed jpg I meant to save as bmp but dont have time at lunch to recreate it (stupid mspaint)
Champie Jack
Registered User
Join date: 6 Dec 2003
Posts: 1,156
12-23-2004 12:31
that's fantastic Upshaw!

thanks for explaining that.

Champie