Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Blinking light

Marianne McCann
Feted Inner Child
Join date: 23 Feb 2006
Posts: 7,145
07-12-2007 07:24
So I'm trying to work on what would be, essentially, a fire truck's light. As such, it needs to blink off an on, with the light feature going off and on, and/or the prim properties changing to and from full bright in a "blinking" form. It should also be touchable to turn this feature off and on (at least if it uses local light). Anyone seen anyting like dat?

Mari
_____________________


"There's nothing objectionable nor illegal in having a child-like avatar in itself and we must assume innocence until proof of the contrary." - Lewis PR Linden
"If you find children offensive, you're gonna have trouble in this world :)" - Prospero Linden
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-12-2007 07:49
Yeah, I made a Rudolph nose for Christmas that did that. ;) Just need llSetPrimitiveParams in a timer. And, I guess in this case, a touch_start handler to turn the timer on and off.
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
07-12-2007 09:34
From: Qie Niangao
Yeah, I made a Rudolph nose for Christmas that did that. ;) Just need llSetPrimitiveParams in a timer. And, I guess in this case, a touch_start handler to turn the timer on and off.


also, having a static particle effect of one particle that turns on and off gives it a nice little "flare" effect.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
07-12-2007 12:50
I wrote an aircraft warning beacon for a bridge I made, I think it will fit your needs. Send me an in world IM reminder, and I'll drop you a copy.
_____________________
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
07-12-2007 16:15
From: Qie Niangao
Yeah, I made a Rudolph nose for Christmas that did that. ;) Just need llSetPrimitiveParams in a timer. And, I guess in this case, a touch_start handler to turn the timer on and off.
No, no, please no! There's a much more efficient way to do it that doesn't require a scripted timer running every second for the next three years.

Use llSetTextureAnim() along with a texture designed to make a flashing light. I have such a light, and gave it to YadNi... so maybe it's at the junkyard somewhere.

A simple grayscale texture is all you need, a 4x4 grid of equal-sized boxes shaded progressively from white to dark gray, then back to white. With this setup, you can use a script to start the animation, then delete the script (unless you wish to start/stop the animation in which case, the start/stop script would still be far better than a constant timer script). You can even change the color of the light simply by changing the color of the prim. And the speed of the flash is adjusted by the framerate within llSetTextureAnim().

If you're curious what it looks like, head to the NW corner of Europa and check the light at the top of my tower. If I remember, I'll set one out so folks can grab a copy when I get into SL later tonight.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-12-2007 18:43
From: DoteDote Edison
No, no, please no! There's a much more efficient way to do it that doesn't require a scripted timer running every second for the next three years.
Well, but the OP requested that it change the local light feature of the prim, too, which texture animation couldn't do. But indeed, if full-bright is adequate, then either the texture animation or Senuka's suggested particle system approach (with PSYS_PART_EMISSIVE_MASK) would suffice.

[Edit: Haven't tried this, but: if rather than flashing, the light could spin like the cherry-tops on patrol cars, one might get a pretty compelling effect with llTargetOmega on the light, linked with a phantom, transparent child prim some meters from the origin, emitting red light. Thats all client-side, but the light assembly would have to be unlinked from the rest of the firetruck.]