Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Retaining values?

Echo Dragonfly
Surely You Jest
Join date: 22 Aug 2004
Posts: 325
04-21-2007 14:11
Hello, I am working on a simple light, dialog controlled, with multiple choices for light color, intensity(dimmer), ect. My question is, how to get the light to retain the color vector selected while also selecting an intensity setting.
Is there a way for the script to check what color is being used, and dim or brighten it as well?

I might be in over my head, but enjoy the challenge, please point me in the right direction so to speak.
_____________________
Creativity represents a miraculous coming together of the uninhibited energy of the child with its apparent opposite and enemy, the sense of order imposed on the disciplined adult intelligence.
Norman Podhoretz
......................
If quizzes are quizzical, what are tests? :eek:
............................
Do illiterate people get the full effect of Alphabet Soup? :rolleyes:
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-21-2007 15:54
Global Variables?
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
04-21-2007 16:12
If you're looking to fade a color from very colorful to very pale...you would also need to shift color as you shift intensity. You would do so by shifting all relevant vector values by a set amount.

BUt yes...global variables will hold a value throughout a script if that's all you're looking for.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Jeff Kelley
Registered User
Join date: 8 Nov 2006
Posts: 223
04-21-2007 20:12
Are you speaking of point ("real" or GL) lights ? If so:

CODE


// PointLight Params : [ON_OFF, color, intensity, radius, falloff]

setLightOn (integer on) {
list lightParams;
lightParams = llGetPrimitiveParams([PRIM_POINT_LIGHT]);
lightParams = llListReplaceList(lightParams, [on], 0,0);
llSetPrimitiveParams([PRIM_POINT_LIGHT] + lightParams);
}

setLightColor (vector color) {
list lightParams;
lightParams = llGetPrimitiveParams([PRIM_POINT_LIGHT]);
lightParams = llListReplaceList(lightParams, [color], 1,1);
llSetPrimitiveParams([PRIM_POINT_LIGHT] + lightParams);
}

setLightLevel (float level) {
list lightParams;
lightParams = llGetPrimitiveParams([PRIM_POINT_LIGHT]);
lightParams = llListReplaceList(lightParams, [level], 2,2);
llSetPrimitiveParams([PRIM_POINT_LIGHT] + lightParams);
}
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-22-2007 06:26
From: Jeff Kelley
Are you speaking of point ("real" or GL) lights ? If so:


I think the orignal question was pertaining to selecting the data from the user dialogs and retaining the first selection while awaiting the second.