Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Parent child linking question.

Weird Duport
Registered User
Join date: 4 Oct 2005
Posts: 1
03-10-2006 16:56
First time posting in here, so here goes. I’ve been trying to learn LSL though some self-help sites, such as the LSL wiki, and relearning the coding style from C++. I recently came across a snag with it came to parent-child linking. I’m currently at the point of getting the child primitive to move in relation to the parent prim. My main question is there any sites that deal with getting two prims to move in unison? In particular, ones with sample code to learn from?
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
03-10-2006 17:11
From: Weird Duport
First time posting in here, so here goes. I’ve been trying to learn LSL though some self-help sites, such as the LSL wiki, and relearning the coding style from C++. I recently came across a snag with it came to parent-child linking. I’m currently at the point of getting the child primitive to move in relation to the parent prim. My main question is there any sites that deal with getting two prims to move in unison? In particular, ones with sample code to learn from?


I have no idea. However if you have learned a bit of lsl then this should make sense: It's not possible in all cases and not ever gauranteed to be synced. The best you can do is send one link message that triggers a script in each prim you want to move and have a script in the prims set to move that moves them when they get the message.
_____________________
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
03-11-2006 07:56
I have done something of this sort. Have a main script in parent prim, have it (whenever movement is needed) send an llMessageLinked to all child prims (or the particular ones that need to move). Then, have each appropriate child prim listen for that linked message (with link_message event) and move accordingly. Use llGetLocalPos to find position relative to parent, then llSetPos to reposition.

If you want, I'll try to extract pertinent code and post later.

Baron
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
03-16-2006 02:49
drop a vote or two on prop 607 for heirarchical linking, so that you can move multi-prim subsets of objects as though they were single prims.