Reply
Honored Resident
Tim Flynn
Posts: 50
0 Kudos

Linking Prims when a few have scripts in them.

Let's say I have a building.  And I start to link all the buildings prims together.  Some of those prims have scripts in them.  For example.  A few have a sliding glass door while another might have a one way phantom script.  Still a third might be an elevator.

I noticed when I link these prims together, they go haywire.  The roof or building might decide to act like a sliding glass door.  The elevator might stop working altogether and the phantom prim might now act like a solid wall.

Is there any way I can get these scripted prims to act independent instead of affecting the rest of the linked prims?

I know i've succeeded at this before, but I can't remember for the life of me how I did it.  It might have been on accident.

Thank you in advance.

Rolig Loon
Posts: 25,595
Registered: ‎10-05-2009

Re: Linking Prims when a few have scripts in them.

Reply to Tim Flynn - view message

It probably was by accident.  If you have more than one script with a touch* event in it in the same linkset, they will potentially interfere with each other.  To a degree, you can use llPassTouches to limit whether a script in the root prim responds to a touch on a child prim, subject to the caveats in the LSL wiki:

  • This has no effect when called on the root prim.
  • Touches are always passed to the parent when there is no touch event script in the child, even if this is set (TRUE or FALSE) within another event in a child's script.
    • If you want to block touches from a child , you must add a script with a touch event in the child. This creates a default no passes.

This of corse means that you will have to modify several of the scripts in your build.

Not as dumb as I look
Honored Resident
Tim Flynn
Posts: 50
0 Kudos

Re: Linking Prims when a few have scripts in them.

Reply to Rolig Loon - view message

Ah. Okay.  So it's another SL Limitation we have to work around.  

In any case, I'm trying to create a Rez Box out of this massive structure.  I guess the best course of action here is to either make copies of the prims and put them in the rez box individually or just leave them out and put them back in during the final build.

A bit of a hassle, but I suppose it's the best way.

Thanks for the quick response.

Rolig Loon
Posts: 25,595
Registered: ‎10-05-2009
0 Kudos

Re: Linking Prims when a few have scripts in them.

Reply to Tim Flynn - view message

Well, I suppose you could call it a limitation.  Really, though, most people would want a set of linked prims to respond the same way to a touch, regardless of what part of the linkset you touch.  That's exactly what does happen if there's only one script with a touch event in the linkset, and if it's in the root prim.  If you want a script to respond only to touches in a specific prim, then you have three routes:

1. Put the script in a child prim.  Then it will only respond to touches on that child prim.  That's the easiest way.  If you don't put any script with a touch* event in the root prim, there's no conflict, and you're home Scot free.

2. Put the script in the root prim and include a test in its touch* event that checks

        if (llDetectedLinkNumber(0) == 12)   //for example

    and then responds only to a touch on that specific prim.

3. Put the script in the root prim, and then put a script in each of the child prims that (a) has a llPassTouches (FALSE) statement in it and (b) has at keast a dummy a touch* event in it.

It's less a limitation than a way to prevent the ambiguity of having a script in the root prim confused about which touch to obey.

Not as dumb as I look
Nova Convair
Posts: 556
Registered: ‎08-28-2010
0 Kudos

Re: Linking Prims when a few have scripts in them.

Reply to Tim Flynn - view message

There are many different door scripts out there.

Some initialize on rez or only once and not on link changed. Some require to stay unlinked. Some move relative to the root, so changing the root will break the door or require a reconfiguration. Phantom on a linked prim isn't possible - well not for old scripts and for new ones under certain circumstances only.

So linking different scripted doors will most probably not be very successful.

"I hate surprises. But I love adrenaline rushes. Go figure."