Jump to content

Linked objects inhereting scripts?


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

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

Recommended Posts

I am working on my own house and am adding doors.

When I link the door the entire house moves.  Is there a way to link the door and not get the whole house to move?

I may have missed it and have been looking for a solution.

Link to comment
Share on other sites

That all depends on how the script was written.  In general, a script with a touch event will only respond to touches on the prim that it was placed in, unless it was placed in the root prim -- in which case, touching anywhere in the link set generally activates it.  The same is also generally true in reverse.  That is, a simple door script that is in a child prim typically moves ONLY that prim, but one that is placed in the root of a link set moves everything.  HOWEVER, any particular script could be written to move another prim (or all prims) regardless of where the script is placed. The simplest door script I can imagine off the top of my head would be one that looks like this...

 

float gAngle = 90.0; //Put your own opening angle here, negative if necessaryrotation gTurn;default{    state_entry()    {        gTurn = llEuler2Rot(<0.0,0.0,gAngle*DEG_TO_RAD>) ;    }    touch_end (integer num)    {        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROT_LOCAL, (gTurn = (ZERO_ROTATION/gTurn))*llGetLocalRot()]);    }}

 That script, in the door prim itself, ought to open and close it on touch without affecting anything else.

Edit :  Fixed typo .. Missing parenthesis.

ETA:  Oh, I should have said .... That will rotate the prim from its center, so you'll have to cut the door in half with PathCut B and E to put the hinge at its edge.  This is essentially Void Springer's well-known hinge script.

 

Link to comment
Share on other sites

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