|
Felix Oxide
Registered User
Join date: 6 Oct 2006
Posts: 655
|
12-26-2007 18:37
Is it possible to have multiple animations with different sit target coordinates in a single sit script? I would like to add a number of animations to furniture without the use of pose balls and a dialogue with the list of animations, but some animations need different sit target settings. Is this possible to do?
|
|
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
|
12-26-2007 19:50
Not like you're thinking. You can move the sit target around via a script, but the seated avatar won't move around with it; they'd have to stand up and sit again for the new sit target to take effect.
You can however move a seated avatar like this (not my original idea):
llSetLinkPrimitiveParams( llGetNumberOfPrims(), [ PRIM_POSITION, Desired_Pos ] );
Hope that helps.
|
|
Felix Oxide
Registered User
Join date: 6 Oct 2006
Posts: 655
|
12-26-2007 20:36
Hmmm... okay thanks. I was hoping there would be a way to do it easily like some sort of dynamic sit target. I guess i could use an invisible prim that would move, but then I might as well use a pose ball.
|
|
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
|
12-26-2007 20:43
From: Felix Oxide Hmmm... okay thanks. I was hoping there would be a way to do it easily like some sort of dynamic sit target. I guess i could use an invisible prim that would move, but then I might as well use a pose ball. I probably wasn't clear - that snippet I posted above moves the avatar around, no invisible prims or balls required. It works because for this purpose LSL treats a seated avatar as a linked prim, and always the last in the set - so by specifying the link number of the piece you intend to move as llGetNumberOfPrims(), you're actually specifying the avatar itself.
|
|
BamBam Sachertorte
floral engineer
Join date: 12 Jul 2005
Posts: 228
|
12-26-2007 21:17
From: Felix Oxide Hmmm... okay thanks. I was hoping there would be a way to do it easily like some sort of dynamic sit target. I guess i could use an invisible prim that would move, but then I might as well use a pose ball. Moving the prim around will not move the avatar. After the avatar sits on the object its position with respect to the root prim is fixed, even if the prim with the sit target moves. Anti's code snippet is way to do this. You can also change the avatar's rotation if the new animation requires a different rotation: llSetLinkPrimitiveParams( llGetNumberOfPrims(), [ PRIM_POSITION, Desired_Pos, PRIM_ROTATION, Desired_Rot ] );
|
|
Felix Oxide
Registered User
Join date: 6 Oct 2006
Posts: 655
|
12-27-2007 04:39
Oh okay, i misunderstood. I will give this a try. Thanks for your suggestion. 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-27-2007 04:56
one small gotcha, the above code moves the LAST seated avatar... it's possible to have more than one, so setting a list of positions and then referencing that for each seated av above the number prims you have in your linkset might help more, tracking if there is an av at a given position might also help
_____________________
| | . "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... | - 
|