Jump to content

two scripts on one piece of furniture


Bornforyourass
 Share

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

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

Recommended Posts

Hello everyone, I've been writing the scripts for my furniture for a while now.
 
I recently saw a couch at a vendor that had two separate scripts.
one was installed on the right armrest for the adult part and the other on the left one for the cuddle part.

Do you have an idea of how to install two scripts on the same piece of furniture?

Thank you in advance for your answers 

Link to comment
Share on other sites

1. One possible answer:

There is an LSL function "llPassTouches()" which determines if the "touch()" event is passed to the Root prim in a linkset:

https://wiki.secondlife.com/wiki/LlPassTouches

The wiki says "Default: Touches are always passed to the root."

If that function "llPassTouches()" is used with the appropriate parameter, each Prim in the Linkset can have a separate script with its own touch() handler.

One of my Forum scripting peers will probably have a different solution.

2. Another possible answer, but using 1 script:

One script can handle each prim differently when touched, by calling "llDetectedLinkNumber()" in the "touch()" event:

https://wiki.secondlife.com/wiki/LlDetectedLinkNumber

p.s. Great Name!

Edited by Love Zhaoying
Link to comment
Share on other sites

7 hours ago, Bornforyourass said:

I recently saw a couch at a vendor that had two separate scripts.
one was installed on the right armrest for the adult part and the other on the left one for the cuddle part.

Do you have an idea of how to install two scripts on the same piece of furniture?

"Installing" is a simple as dragging and dropping into the object's inventory. By default everything will go into the root object's inventory. You can specify a non-root one by going into the build tool and checking the "Edit linked" checkbox. This will allow you to select individual links in the linkset. Select the desired child link, open the content tab of the Built tool, and then drag the content into it.

Edited by Fenix Eldritch
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 576 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...