Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Link Object with inner movement

Wyatt Weatherwax
Registered User
Join date: 23 Oct 2007
Posts: 59
06-05-2009 10:36
I need some help getting started (as usual). I have a seed pod (mulitple prims) which rezzes a seed internally:

Question 1: after the seed is rezzed how do I link all parts together so is the pod is moved the seed remains inside?

Question 2: would it be possible (if the seed is linked) to impart some motion to the seed using, I guess, llSetPos

Thanks for the help
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-05-2009 16:46
if you make the seed physical and move the pod slowly it should stay inside (not really recommended it's a lot of physics processing), or you can use llCreateLink
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Wyatt Weatherwax
Registered User
Join date: 23 Oct 2007
Posts: 59
06-05-2009 16:59
Yes, I would like to avoid a physical object, I haven't used CreateLink but can the internal object be move once it is linked?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-05-2009 18:14
From: Wyatt Weatherwax
Yes, I would like to avoid a physical object, I haven't used CreateLink but can the internal object be move once it is linked?

yes, either with llSetLinkPos or llSetLinkPrimitiveParams, from the a main object, or the non-link versions from the linked in object... it's treated the same as any other child prim(s).

if you're curious as to what the link number(s) will be for the new object, the linked in object gets inserted into the chain right after the root.

eg
object X = ABC
object Y = def

object Z = (X creates a link with Y) AdefBC

links start at zero for the firs and go up from there.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Wyatt Weatherwax
Registered User
Join date: 23 Oct 2007
Posts: 59
06-06-2009 09:11
So far so good: I used the Wiki example for llCreateLink and it works well with single prim items. If the inserted object is made of multiple prims (linked) only the prim with the script moves. I used a simple rotation rotation to experiment with. Am I restricted to simple prims with this method? Below is the Wiki script:

// Create a new object and link it as a child prim.
string ObjectName = "Object Name Here";
// NOTE: must be a name of an object in this object's inventory.

default
{
touch_start(integer count)
{
// When the object is touched, make sure we can do this before trying.
llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS);
}
run_time_permissions(integer perm)
{
// Only bother rezzing the object if will be able to link it.
if (perm & PERMISSION_CHANGE_LINKS)
llRezObject(ObjectName, llGetPos() + <0,0,0.5>, ZERO_VECTOR, llGetRot(), 0);
else
llOwnerSay("Sorry, we can't link.";);
}
object_rez(key id)
{
// NOTE: under some conditions, this could fail to work.
// This is the parent object. Create a link to the newly-created child.
llCreateLink(id, TRUE);
}
}
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-06-2009 09:54
You have to move every prim separately, yes.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Wyatt Weatherwax
Registered User
Join date: 23 Oct 2007
Posts: 59
06-06-2009 12:14
Okay, thanks for the help. Seems that linking always messes up my creations when movement is concerned.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-06-2009 16:16
yes, the unfortunate side effect of linking means that all the newly linked in prims are now individual child prims. there is no hierarchical linking in SL (yet).
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
06-06-2009 16:24
From: Void Singer
yes, the unfortunate side effect of linking means that all the newly linked in prims are now individual child prims. there is no hierarchical linking in SL (yet).

Oh but there was... joints. They never worked LOL.
_____________________
http://slurl.com/secondlife/Together
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-06-2009 17:18
From: Escort DeFarge
Oh but there was... joints. They never worked LOL.

I remember... I even remember trying to make them work... it wasn't pretty.

but I don't count it as a was since it didn't work... same way I wouldn't count a bunch of springs under a car seat ans an ejection seat if it didn't work... it's just a bunch of wasted springs (like a few other thing in SL)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -