Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

light swtich script

Porky Gorky
Temperamentalalistical
Join date: 25 May 2004
Posts: 1,414
06-14-2007 06:15
Hello,

I need a light switch script.

Image a light fitting with a tappered cylinder textured with an alpha white gradient to give the effect of a beam of light.

I want to be able to touch the light in order to enable local lighting in addition to turning on the beam of light, touch it again and local lighting turns off and the beam disapears. With the beam of light I either need to alternate between gradient texture and a 100% clear texture when turning the light on or off. Alternatively I would need to change the transparency level of the beam, so 0% transparency when the light is on and 100% when off to get the desired effect. I would also like the light to be verbally activated on a pre-determined channel.

This seems like a simple requirment, is anyone aware of free full perm script that will allow me to do this?

Thanks.
_____________________
Dytska Vieria
+/- .00004™
Join date: 13 Dec 2006
Posts: 768
06-14-2007 07:54
integer on;
vector color = <223,243,237>;
float intensity_on = .500;
float intensity_off = 0.0;
float radius = 10.000;
float falloff = 0.750;

default
{
state_entry()
{
on = TRUE;
llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, color, intensity_off, radius, falloff]);
}

touch_start(integer total_number)
{
if(on)
{
on = FALSE;
llSetPrimitiveParams([PRIM_FULLBRIGHT, ALL_SIDES, TRUE]);
llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, color, intensity_on, radius, falloff]);
}
else
{
on = TRUE;
llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, color, intensity_off, radius, falloff]);
llSetPrimitiveParams([PRIM_FULLBRIGHT, ALL_SIDES, FALSE]);
}
}
}
_____________________
+/- 0.00004
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
06-14-2007 09:12
IM me in world. I have a lighthouse light that does just that (beam and primpoint light) and it uses a remote switch to control it along with controling the rotation of the light (if you need that).
Its in Pachylia, I don't know the grid coordinates, it's the only lighthouse there.