Jump to content

Lighting script help


ZenriaCo
 Share

You are about to reply to a thread that has been inactive for 3921 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello there, 

I am in need of turning this script in to a listening script instead of a touch, plus make it so it only lights up two sides. Help would be much appreciated :)

default
{
state_entry()
{
}
touch_start(integer total_number)
{
llOwnerSay("active");
llSetPrimitiveParams([
PRIM_FULLBRIGHT, ALL_SIDES, TRUE, 
PRIM_GLOW, ALL_SIDES, 0.05, 
PRIM_POINT_LIGHT, TRUE, <1, 1, 1>, 1.0, 5.0, 0.75
]);
state open;
}
}
state open
{
touch_start(integer tnum)
{
llOwnerSay("inactive");
llSetPrimitiveParams([
PRIM_FULLBRIGHT, ALL_SIDES, FALSE, 
PRIM_GLOW, ALL_SIDES, 0.01, 
PRIM_POINT_LIGHT, FALSE, <0, 0, 0>, 0.0, 5.0, 0.75
]);
state default;
}
}

 thank you for reading :)

Link to comment
Share on other sites

Easy stuff first:

If you want PRIM_FULLBRIGHT and PRIM_GLOW to light up on two sides instead of ALL_SIDES, all you have to do is identify the two sides by face number.  In the context of llSetPrimitiveParams, that actually merans that you'll have to repeat the PRIM_FULLBRIGHT and PRIM_GLOW blocks twice (one time for each face).

Now, to change from a touch activated version to a listen activated one, you'll need to

1.  Create a listen channel and open it.  See http://wiki.secondlife.com/wiki/LlListen

2.  Change each of the  touch_start events (in state default and state open)  to a listen event.  See http://wiki.secondlife.com/wiki/Listen

3.  Test any message that is received in the listen event to see whether it is the trigger that will turn your light on or off.  See http://wiki.secondlife.com/wiki/If

You may want to practice with a tutoial if you are unfamiliar with LSL scripting .   See http://wiki.secondlife.com/wiki/LSL_Tutorial

Link to comment
Share on other sites

Hello Rolig

Thank you for the help but the problem is more I am unable to script at all, currently I am on a time limit to finish this build off for a friend and not enough time to learn scripting. Thank you for the help and will look in to it when I can after the build has finished :) teach a man to fish and all that :)

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3921 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...