Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Light Script Question

Centaine Decatur
Mooncusser
Join date: 24 Oct 2006
Posts: 49
05-04-2007 09:58
I am looking for an On/Off light script that turns the "LIGHT FEATURE" on and off. All I can find are scripts that work wtih the color vector simply turning my gorgeous textures black. Can anyone lead me to a script that works with the Light Feature of the prim. Thank you in advance for your help. :-)
2fast4u Nabob
SL-ice.net
Join date: 28 Dec 2005
Posts: 542
05-04-2007 10:06
Search (/invalid_link.html) is your friend - but here is a quick answer....

Try my light script (click the link).


-2fast
Centaine Decatur
Mooncusser
Join date: 24 Oct 2006
Posts: 49
05-07-2007 10:05
Thank you very much for your reply. The script you gave still works off of the color vector and not the light feature. This does help with the black texture problem, but does not help increase or decrease the amount of light in the room. Let me rephrase my question. How do I make a transparent prim brighten a room on command and turn off on command when I want less light in the room?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
05-07-2007 10:48
CODE

integer LampState;

float intensity = 1.0;
float radius = 10.0;
float falloff = 0.75;

vector colour = <1.0,1.0,1.0>;

SetLamp()
{
llSetPrimitiveParams([
PRIM_FULLBRIGHT, ALL_SIDES, LampState,
PRIM_POINT_LIGHT, LampState, colour, intensity, radius, falloff,
PRIM_COLOR, ALL_SIDES, colour, 1.0
]);

}

default
{
state_entry()
{
LampState = false;
SetLamp();
}

on_rez(integer number) { llResetScript();}

touch_start(integer total_number)
{
LampState = ! LampState;
SetLamp();
}
}
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
05-07-2007 11:00
From: Centaine Decatur
Thank you very much for your reply. The script you gave still works off of the color vector and not the light feature. This does help with the black texture problem, but does not help increase or decrease the amount of light in the room. Let me rephrase my question. How do I make a transparent prim brighten a room on command and turn off on command when I want less light in the room?


also be aware that SL still on renders 8 (maybe it's 9) light sources at once, so if you have a lot of misc gadgets using these for effects, turning on the main light may or may not be visible within your client.
_____________________
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.
Centaine Decatur
Mooncusser
Join date: 24 Oct 2006
Posts: 49
05-08-2007 09:43
Thanks very much for your help! I knew it could be done! Special thanks to Max for in-game help.