Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

can a script move a poseball and the avartar too?

Criss Garrigus
Registered User
Join date: 17 Mar 2009
Posts: 1
08-28-2009 08:30
Okay here is my problem... i have a piece of furniture with a drawer in it that moves. (all moving prims in the item have listen scripts in them.) there is a poseball in the drawer and it moves as well but..... If an avatar is sitting on the poseball the avatar doesn't move with the drawer.

why not?

can it be fixxed?

can it be done easyly ?

can an idiot like me do it?

thanks in advance

..an idiot..
Vance Adder
Registered User
Join date: 29 Jan 2009
Posts: 402
08-28-2009 09:52
Sit targets are relative to the object's position and rotation. I'm guessing that in your case the drawer and poseball are linked with everything else. Moving one link in the object will not change where you are sitting, you'd need to move the whole object.

I think you can get around that limitation though. I just haven't personally worked with sit targets much in my scripts, so I can't be of much help.

Have a look here: http://wiki.secondlife.com/wiki/LlSitTarget
There is some code in that link that may help. Look at UpdateSitTarget.
Cheree Bury
ChereeMotion Owner
Join date: 6 Jun 2007
Posts: 666
08-28-2009 09:54
You will have to move the avi yourself. When an avi sits on a prim, it becomes the last prim in the linkset.

This code:

//Move the avatar by the calculated amount
llSetLinkPrimitiveParams(llGetObjectPrimCount(llGe tKey()) + 1, [PRIM_POSITION, animation_offset] );


was extracted from this thread:

/54/e1/266914/1.html


Since I never completed that project, I make no guarantees about any of it. :)
_____________________
Visit ChereeMotion - Life's Best Pinup Poses
http://slurl.com/secondlife/Wild%20Rice/38/230/51
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
08-28-2009 10:13
I think the moving poseball needs to be a seperate object from the rest of the desk for this to work. And that might justify it having it's own listener.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
08-28-2009 11:17
if the drawer an poseball is made as a single object, AND the poseball is the root, the av will automatically move with it, other wise you have to move the avatar with a separate call to llSetLinkPrimitiveParams
_____________________
|
| . "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...
| -
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
08-30-2009 07:10
From: Void Singer
if the drawer an poseball is made as a single object, AND the poseball is the root, the av will automatically move with it, other wise you have to move the avatar with a separate call to llSetLinkPrimitiveParams
That's useful to know. How do you determine the link number of the av? Is it always going to the he higest number? And would that also apply to multiple avs sitting on a multi-prim linkset?
Vance Adder
Registered User
Join date: 29 Jan 2009
Posts: 402
08-30-2009 07:46
^ Yes, it's always the highest number. Not 100% sure with multiple avs. My gut tells me it'd just keep adding a link on the top of the list for each av.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
08-30-2009 15:36
From: EF Klaar
That's useful to know. How do you determine the link number of the av? Is it always going to the he higest number? And would that also apply to multiple avs sitting on a multi-prim linkset?

according to linking rules, sittings av's are tacked on the end, so for a single av sitting on a linkset... yes.

for multiple av's, the last seated av is the highest link number.

you can test which av is which among multiples with llGetLinkKey IIRC

and you can test how many av's are seated with
llGetNumberOfPrims() - llGetObjectPrimCount(llGetKey());
the first av will be link number
(llGetNumberOfPrims())
and the last av will be
(llGetObjectPrimCount(llGetKey() - 1)
assming there are any av's seated

it acts like a line, so if an av gets up, it loses it's place to the next av in line, and if that av re-sits, they go to the back of the line.
_____________________
|
| . "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...
| -