Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Two scripts in an object.

Steve Memotech
Registered User
Join date: 27 Mar 2007
Posts: 20
03-28-2007 08:17
I have a furniture with two drawers then these drawers have scripts respectively. I want this two scripts will work as I touched the whole object, I mean the whole furniture. How will I do that?
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
03-28-2007 09:29
Depends on the structure of the furniture.

If your whole piece is 1 'object' then you can set a communication between scripts via link-message (llMessageLinked() function and link_message event) that will tell each script to open when the object is touched.

If, on the other hand, your piece is comprised of multiple objects, you will need a communication by private-channel listen.

I would look up the following in the Wiki:

llMessageLinked()
llWhisper()

link_message
listen
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
03-28-2007 10:00
From: Steve Memotech
I have a furniture with two drawers then these drawers have scripts respectively. I want this two scripts will work as I touched the whole object, I mean the whole furniture. How will I do that?


Ok...i'm trying to make sure I understand what you're wanting. Do you want it so that no matter where they click on the object, both of the drawers will open? or do you want the drawers to activate something in the primary script whenever they are opened separately? Perhaps a combination of both?

If you just want it to open all the drawers on one click, you could always just leave the extra scripts out of the drawers and use llSetLinkPrimitiveParams to move both drawers from the main script. The only problem with that would be the delay (0.2), but that would have a nice effect for them to open in sequence.

If you want to have the drawer you clicked activate some menu option in the main script, then you could use the PassTouches setting so that all touches on the child prim will be passed to the main, or link messages if you prefer.