light in v1.10
|
|
Robin Peel
Registered User
Join date: 8 Feb 2005
Posts: 163
|
05-24-2006 15:38
Good Day, I've logged in SL today, played around with the new tools and found that the scripts that I used to turn a prim into light don't quite cut it any more and I'm not sure how to make the prim behave like light in the new system. when I use
llSetPrimitiveParams([PRIM_MATERIAL, PRIM_MATERIAL_LIGHT]);
it makes it light, but I want to control the light like you do in the Features tab. I've looked but I think that I may have missed something (can't find anything). Can somebody enlighten me on this?
Thank you all so very much. Hugggssss
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
05-24-2006 16:29
It's PRIM_POINT_LIGHT, it's not a 'material' setting any more. It's in the Wiki. http://secondlife.com/badgeo/wakka.php?wakka=llSetPrimitiveParamsThe 8th line in the table.
|
|
Robin Peel
Registered User
Join date: 8 Feb 2005
Posts: 163
|
05-24-2006 16:53
Thank you very much. I feel so silly. *blushes*
|
|
Androclese Antonelli
Org. B-Day: 05/11/04
Join date: 25 Apr 2006
Posts: 96
|
05-24-2006 16:54
From: Robin Peel Good Day, I've logged in SL today, played around with the new tools and found that the scripts that I used to turn a prim into light don't quite cut it any more and I'm not sure how to make the prim behave like light in the new system. when I use llSetPrimitiveParams([PRIM_MATERIAL, PRIM_MATERIAL_LIGHT]); it makes it light, but I want to control the light like you do in the Features tab. I've looked but I think that I may have missed something (can't find anything). Can somebody enlighten me on this? Thank you all so very much. Hugggssss // Emit a Yellow Light llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1, 1, 0>, 1.0, 10.0, 0.75]); // Emit No Light. llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <0, 0, 0>, 0, 0, 0]);
I'm sure there is a better way to turn the light off, but that's how I've done it.
_____________________
The Sculpted Garden Originally Born 5/11/2004 - New AV, Old Player. If you leave the game, don't delete your account, just make it 'free'. You'll lose your inventory like I did. *sniff*
|
|
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
|
05-24-2006 17:20
From: Androclese Antonelli // Emit a Yellow Light llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1, 1, 0>, 1.0, 10.0, 0.75]); // Emit No Light. llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <0, 0, 0>, 0, 0, 0]);
I'm sure there is a better way to turn the light off, but that's how I've done it. You'll find that the boolean (TRUE/FALSE) is the switch on/off for the PRIM_POINT_LIGHT, similar to the checkbox in the features tab of the edit window. This way you don't need to empty the settings to turn off the light. // Emit a Yellow Light llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1, 1, 0>, 1.0, 10.0, 0.75]); // Emit No Light. llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, <1, 1, 0>, 1.0, 10.0, 0.75]);
nnSetLight(integer on_off) { llSetPrimitiveParams([PRIM_POINT_LIGHT, on_off, <1, 1, 0>, 1.0, 10.0, 0.75]); }
|
|
Androclese Antonelli
Org. B-Day: 05/11/04
Join date: 25 Apr 2006
Posts: 96
|
05-24-2006 19:53
Ummm. yeah.. I knew that.. uhh I was just.. uh.. testing you...yeah, yeah, I was TESTING you, yeah, that's the ticket!
_____________________
The Sculpted Garden Originally Born 5/11/2004 - New AV, Old Player. If you leave the game, don't delete your account, just make it 'free'. You'll lose your inventory like I did. *sniff*
|
|
Aleister Leonov
AL Designs
Join date: 11 Jan 2006
Posts: 68
|
05-26-2006 03:19
Don't suppose someone could post a complete example of getting point lighte to switch on and off at 'touch'. I am only just starting to decypher LSL and this is the first thing I want to achieve but I don't understand how to get the boolean on_off thing to work, i.e. how to get the boolean switch to change value at next touch and change the light to it's opposite condition. Pretty please... 
_____________________
-- Al AL Designs
|
|
Bitzer Balderdash
Dazed and Confused
Join date: 21 Dec 2005
Posts: 246
|
05-26-2006 03:32
untested - I'm not in game at the moment, but it should be something like... integer on_off;
set_light() { llSetPrimitiveParams([PRIM_POINT_LIGHT, on_off, <1, 1, 0>, 1.0, 10.0, 0.75]); }
default { state_entry() { on_off = 0; set_light(); } touch_start(integer num_detected) { on_off = 1 - on_off; set_light(); } }
|
|
Aleister Leonov
AL Designs
Join date: 11 Jan 2006
Posts: 68
|
05-26-2006 03:51
Excellent... thanks... I'll try it tonight when I go in-game. Seeing an essentially simple example like that helps explain the syntax and how certain functions operate... thanks again.. 
_____________________
-- Al AL Designs
|