These forums are CLOSED. Please visit the new forums HERE
Turning On A Bunch Of Lightsources At Once |
|
|
Pleasure Ashbourne
Registered User
Join date: 24 Dec 2007
Posts: 60
|
01-14-2008 21:24
I have a bunch of lightsources made, and I need a script to turn them all on together, can anyone help? Just need a main script which is like the control, and then the "slave" scripts that adhere to the main script.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-14-2008 23:55
I have a bunch of lightsources made, and I need a script to turn them all on together, can anyone help? Just need a main script which is like the control, and then the "slave" scripts that adhere to the main script. Generally your main script will communicate to the others through link messages or chat of some sort (llSay(), llShout(), llRegionSay(), etc.). They will respond to such an event by turning off whatever features you use for "lighting", whether it be particles (llParticleSystem()), actual local lighting, full bright (llSetPrimitiveParams()), etc. |
|
James Melson
Registered User
Join date: 28 Oct 2007
Posts: 11
|
01-15-2008 06:02
Note this is very simple script I made:
default { state_entry() { llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, <1.0,1.0,1.0>,1.0, 5.0, 0.0]); llListen(60, "", "", "" ;} listen(integer channel, string name, key id, string message) { if (message == "light_on" ![]() { state on; } } } state on { state_entry() { llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1.0,1.0,1.0>,1.0, 5.0, 0.0]); llListen(60, "", "", "" ;} listen(integer channel, string name, key id, string message) { if (message == "light_off" ![]() { state default; } } } Put this in every lightsource. In llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1.0,1.0,1.0>,1.0, 5.0, 0.0]); You can change them as: TRUE/FALSE, vector color, float intensity, float radius, float falloff First it starts in off state, then when it receives the message light_on on the 60 channel (/60 light_on) they will turn on. Pretty simple and basic. All you need to do, if you want, is get a prim saying that when touched. I have made myself a turn on and turn off dialog. Tell me if you need that script. This is one way you can do it. Also keep in mind what Hewee Zetkin said. llSay has the normal chat range. You can choose from different types of range using the functions mentioned by him. |
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
01-15-2008 06:41
If the sources happen to be linked, you could use llSetLinkPrimitiveParams() in a single script, although there's a 0.2sec delay built-in to that function, so... it would be a bit like fluorescent lights flickering on in sequence.
Note that only the six nearest light sources will be used in the client (and possibly fewer with WindLight First Look, depending on the release version, graphics card, phase of moon, etc.). With more light sources in a scene, moving around can cause much blinkin'. |
|
James Melson
Registered User
Join date: 28 Oct 2007
Posts: 11
|
01-15-2008 06:43
Note that only the six nearest light sources will be used in the client (and possibly fewer with WindLight First Look, depending on the release version, graphics card, phase of moon, etc.). With more light sources in a scene, moving around can cause much blinkin'. Thanks, I learned from that too. |
|
Pleasure Ashbourne
Registered User
Join date: 24 Dec 2007
Posts: 60
|
01-15-2008 14:25
Note this is very simple script I made: default { state_entry() { llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, <1.0,1.0,1.0>,1.0, 5.0, 0.0]); llListen(60, "", "", "" ;} listen(integer channel, string name, key id, string message) { if (message == "light_on" ![]() { state on; } } } state on { state_entry() { llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1.0,1.0,1.0>,1.0, 5.0, 0.0]); llListen(60, "", "", "" ;} listen(integer channel, string name, key id, string message) { if (message == "light_off" ![]() { state default; } } } Put this in every lightsource. In llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1.0,1.0,1.0>,1.0, 5.0, 0.0]); You can change them as: TRUE/FALSE, vector color, float intensity, float radius, float falloff First it starts in off state, then when it receives the message light_on on the 60 channel (/60 light_on) they will turn on. Pretty simple and basic. All you need to do, if you want, is get a prim saying that when touched. I have made myself a turn on and turn off dialog. Tell me if you need that script. This is one way you can do it. Also keep in mind what Hewee Zetkin said. llSay has the normal chat range. You can choose from different types of range using the functions mentioned by him. I would like the script, thank you so much XD |
|
Pleasure Ashbourne
Registered User
Join date: 24 Dec 2007
Posts: 60
|
01-15-2008 14:27
If the sources happen to be linked, you could use llSetLinkPrimitiveParams() in a single script, although there's a 0.2sec delay built-in to that function, so... it would be a bit like fluorescent lights flickering on in sequence. Note that only the six nearest light sources will be used in the client (and possibly fewer with WindLight First Look, depending on the release version, graphics card, phase of moon, etc.). With more light sources in a scene, moving around can cause much blinkin'. OK, this is for a dark room I have, so 6 should be fine. |
|
Pleasure Ashbourne
Registered User
Join date: 24 Dec 2007
Posts: 60
|
01-15-2008 22:24
Note this is very simple script I made: default { state_entry() { llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, <1.0,1.0,1.0>,1.0, 5.0, 0.0]); llListen(60, "", "", "" ;} listen(integer channel, string name, key id, string message) { if (message == "light_on" ![]() { state on; } } } state on { state_entry() { llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1.0,1.0,1.0>,1.0, 5.0, 0.0]); llListen(60, "", "", "" ;} listen(integer channel, string name, key id, string message) { if (message == "light_off" ![]() { state default; } } } Put this in every lightsource. In llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1.0,1.0,1.0>,1.0, 5.0, 0.0]); You can change them as: TRUE/FALSE, vector color, float intensity, float radius, float falloff First it starts in off state, then when it receives the message light_on on the 60 channel (/60 light_on) they will turn on. Pretty simple and basic. All you need to do, if you want, is get a prim saying that when touched. I have made myself a turn on and turn off dialog. Tell me if you need that script. This is one way you can do it. Also keep in mind what Hewee Zetkin said. llSay has the normal chat range. You can choose from different types of range using the functions mentioned by him. I'm really confused on the llSetPrimitiveParams values are...it's confusing on how it was written. Can you explain each value? |
|
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
|
01-16-2008 07:08
This site explains it all and more.
http://lslwiki.net/ |