Jump to content
Dane Restout

Linking moving and stationary prims

Recommended Posts

I created a prim and put a script for movement in the contents tab.   I linked another prim to it that has no scripts in it.  Those 2 linked prims move together as I want them too.   I want to link those 2 to another stationery prim.  When I do the entire 3 either move together or stop entirely, depending on which I link last.  Is there a way to make the stationery prim not move with the others linked to it?

I really have very little knowledge of scripting other than buying one to use in a build.  I much appreciate any help you can give!

Share this post


Link to post
Share on other sites

Yes, your script will need to address the specific child prims that are supposed to move, using

llSetLinkPrimitiveParamsFast(link_number,[ PRIM_POS_LOCAL,your_movement_vector_goes_here]);

If you have done it properly, and if the script is in the root prim, you should be able to touch anywhere in the linkset and watch the correct child prims move.  Notice that I have said "child prims."  You cannot move the root prim independently in this way.  When you do, the entire linkset will move.  If that's a concern, you can beat it in either of two ways: (1) by relinking things to make some other prim the root or (2) by moving the entire linkset with your script and then quickly moving everything but the root prim back where they were.  That second option is more work (and clumsier) than the first.

Share this post


Link to post
Share on other sites

Thank you Rolig.  I've read a lot about scripting (here), and tried my hand recently at simple scripts, along with changing some that work for me, but I really don't have enough knowledge (yet) to even know where to add that string to the existing script I'm using.  Sorry for my ignorance but I'm trying to learn as I go. I appreciate your info.  I'll keep reading and trying to figure this out.  Once again, thanks.

Share this post


Link to post
Share on other sites

Oh boy I really need help here.  I've been reading and trying to get this to work but am having no luck at all.  I really have no idea where this line "llSetLinkPrimitiveParamsFast(link_number,[ PRIM_POS_LOCAL,your_movement_vector_goes_here]);" goes within the script and also where I get this part "your_movement_vector_goes_here".  Please excuse my ignorance and help a guy out.  I'm becoming very frustrated. 

Share this post


Link to post
Share on other sites

In terms of overall logic, it will need to go wherever you currently have code to set a prim's position.  In terms of syntax, you will have to restructure the script to identify each child prim properly, get its current position, and then be prepared to move it.  This will require setting up some commands in loops.  And if you will not always be moving the same child prims, it will mean setting up a dialog menu to control the right ones.  Not a trivial job but not a simple one for a non-scripter.

Share this post


Link to post
Share on other sites

Way too difficult for this non-scripting beginner I'd guess.  Regretably, I'm going to have to leave this idea be and move on to something simpler.  Thanks for your reply, it's appreciated.

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.


×
×
  • Create New...