Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Blinking light

Candy Lisle
No one special just...
Join date: 26 Feb 2007
Posts: 110
10-30-2009 06:21
Can someone show me an easy script to make a light blink?
_____________________

http://slurl.com/secondlife/Oasis%20Dreams/164/224/28
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
10-30-2009 06:54
here is one I use.
Note that it is a 'make believe blinking'
Point light is very annoying when blinking:)
The script is all free
CODE

// Studio Dora Flash Light script, Dora Gustafson d.2008-01-27

float toff_unit = 2.0;
float ton_unit = 1.0;

switch( integer lights_on )
{
llSetPrimitiveParams( [ PRIM_FULLBRIGHT, ALL_SIDES, lights_on ] );
}

default
{
state_entry()
{
llSetTimerEvent(toff_unit);
switch( FALSE );
}

timer() { state lightOn; }
}

state lightOn
{
state_entry()
{
llSetTimerEvent(ton_unit);
switch( TRUE );
}

timer() { state default; }
}

Use a dark colored prim and give it some glow, that looks fantastic:)
_____________________
From Studio Dora
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
10-30-2009 06:57
this should do the trick, in the timer event TF = !TF simply switches it between true and false for whether the prim should give off light or not. touching it turns it on and off. you may need to adjust the time for the effect you want

integer onoff;
integer TF;
float time = 0.5;//adjust to how fast/slow you want the light to blink

default
{
touch_start()
{
if(onoff){
llSetTimerEvent(time);}
else{llSetTimerEvent(0.0);}
}

timer()
{
llSetPrimitiveParams([PRIM_POINT_LIGHT,TF = !TF, <1, 1, 1>, 1.0, 10.0, 0.75]);
}
}
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
10-30-2009 07:01
and as dora said with glow, if you just want the prim to blink and not the actual light it gives off, you can also use a texture anim, i used glow combined with a texture anim to switch between black and white with the alpha at about 0.25 (75 in the edit window) the glow was still there even if the prim wasn't as visible, you could lay that over a wall and give the effect of light flickering on the wall without the lag of switching the light on and off with a timer
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Candy Lisle
No one special just...
Join date: 26 Feb 2007
Posts: 110
10-30-2009 09:49
Thank you both!!
_____________________

http://slurl.com/secondlife/Oasis%20Dreams/164/224/28