Jump to content
Sign in to follow this  
MSTRPLN

Need help with a lamp script that triggers one face number

Recommended Posts

Hello, i'm cofused about this one.

I'm making a wall lamp which i would want to be ablle to turn on/off when clicked (anywhere) but since this is one mesh/prim with 3 textures i want it to only change the "glow" settings of one face, and additionally the light toggle which i think would only be able to emmit on the whole mesh.

Ingame mesh:



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Inside 3ds max:



i know that the face off the glass that i want to change is 2 and i know of the "PRIM_GLOW" existence but i dont know how exactly to change "ALL_SIDES" to just one side, any help would be really appreciated.

Sincerely

Share this post


Link to post
Share on other sites

Thank you! Somehow i kne wit was going to be this simple, i've tried "face 2" "face2" and "face_2" but didn't know you only need to place the number

Share this post


Link to post
Share on other sites

Yes, it's really simple.  Just give the number of the face you want to change.

I think what people find confusing is that  that they don't realise ALL_SIDES is, in this context, simply a more meaningful way of writing -1, which is the integer you use to tell LSL to change all the faces at once.

 

 

Share this post


Link to post
Share on other sites

It's even a bit easier than stated above.

 

llSetPrimitiveParams([PRIM_GLOW, 2, intensity]);

... will work if the script is in the object with the target face.  Also if you need to know what face it is edit the object, select the face you want to know, then hold <SHIFT><CONTROL><ALT> + T and the face number will be displayed in chat.

 

Share this post


Link to post
Share on other sites

The reason I use llSetLinkPrimitiveParamsFast(LINK_THIS,[....]) rather than llSetPrimitiveParams is that llSetLinkPPFast doesn't carry the 0.2 second delay that llSetPP does.

Admittedly that's probably not an issue in this example, but I now always use llSetLinkPPFast unless I actually intend to sleep the script for 0.2 seconds (which, in this case, I don't).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...