llSetPos while Sitting?
|
|
FireEyes Fauna
Registered User
Join date: 26 Apr 2004
Posts: 138
|
02-08-2005 14:28
Is there a way to sit on a prim and then have the prim move, along with the avatar, to a desired location? I have it scripted right now where the avatar sits down, and the the prim moves to the correct location, but leaves the avatar sitting in the same spot. I have an llSitTarget in the state_entry section, which might be causing the problem, but that's required for detecting which avatar is sitting on the object. Any help is appreciated!  Thank You
|
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
02-08-2005 14:52
There is currently no way to "move" an avatar's sitting location along a prim while the avatar is sitting down. The best thing you can do here is to move the prim and have it "appear" as though the avatar has moved with relation to a second prim.
OR:
You should also make sure the avatar's sit target has been properly handed off to the prim in question. I'm sure folks here will tell you how to do that (as I forget).
_____________________
---
|
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
02-08-2005 17:58
Yes, this is a very simple procedure. I think Jeffrey misunderstood your request. Use llMoveToTarget() once the av sits. I did this just last night for something I'm working on. You don't even need a sit target, but it's helpful. Also, the prim should be phyical, so you have to set that status... it's best to set it back to non-physical after the move. vector newPos = <0,0,5>; vector oldPos = <0,0,0>; integer inUse = FALSE;
default { changed(integer change) { if(change & CHANGED_LINK && !inUse) { //you sat down inUse = TRUE; llSetStatus(STATUS_PHYSICS, TRUE); llMoveToTarget(newPos, 2, 2); llSleep(10); //allow time for the move to complete llSetStatus(STATUS_PHYSICS, FALSE); } else if(change & CHANGED_LINK && inUse) { //you stood up so move back inUse = FALSE; llSetStatus(STATUS_PHYSICS, TRUE); llMoveToTarget(oldPos, 2, 2); llSleep(10); //allow time for the move to complete llSetStatus(STATUS_PHYSICS, FALSE); } } }
|
|
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
|
02-09-2005 04:22
From: FireEyes Fauna I have it scripted right now where the avatar sits down, and the the prim moves to the correct location, but leaves the avatar sitting in the same spot. ... Now -that- is an effect I'd like to see.
_____________________
</sarcasm>
|
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
02-09-2005 10:57
ya that seems like a step tords updating sit pos, while sitting.
|
|
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
|
02-09-2005 11:40
im getting an error on this line: llMoveToTarget(newPos, 2, 2); -LW
|
|
FireEyes Fauna
Registered User
Join date: 26 Apr 2004
Posts: 138
|
02-09-2005 11:47
Thank you everyone for your help, and I've figured out what I was doing wrong. I failed to mention that I'm sitting on a child prim, not the parent, in a linked set. llSetPos works great on a single prim, and will move the avatar along with it. However, if the object is part of a linked set, the prim will move and leave the avatar behind  Guess I'll have to throw some link/unlink commands in to get it to work fine!
|
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
02-09-2005 13:46
From: FireEyes Fauna I failed to mention that I'm sitting on a child prim, not the parent, in a linked set. I figured. Hence why I suggested handing off the sit target. Speaking of which, how is that done, anyway? Seems I never took the time to figure out how multiple sit targets are done when agents request a sit on the root object (example: driver and passenger seat upon a sit request for a car). I'm sure it's something pretty rudimentary. 
_____________________
---
|
|
FireEyes Fauna
Registered User
Join date: 26 Apr 2004
Posts: 138
|
02-09-2005 14:17
Just add a llSitTarget to a script in each child prim. Unfortunately that won't work for what I'm trying to do. Basically here's the plan. Have a root prim at ground level. Then have a few prims around it linked to the root prim. When an avatar sits on a child prim, it make the avatar stand up, and move up to the correct height so the avatars feet are on the ground. llSetPos while linked moves just the prim, not the avatar with it. Unlinking the prim, moving, then relinking would work, except you can't unlink while sitting  I guess I'm left with how it works now. The avatar sits on the object, the prim moves, the avatar stands up and then sits down on the same prim, since it's now at the right height. How unfortuante! 
|
|
Racer Plisskin
Rezerator
Join date: 2 Jan 2005
Posts: 147
|
02-09-2005 19:31
Why do you need your 'seat linked to a base prim at all?
Couldn't you just have the seat prim figure out it's position and move on it's own? Then you wouldn't have to force the AV to play musical chairs to adjust position...
Just curious.
Racer P.
|
|
FireEyes Fauna
Registered User
Join date: 26 Apr 2004
Posts: 138
|
02-10-2005 10:47
While driving home from work I was thinking up ideas of how to do it without linking them. What I'm making is a circle of pose balls so that dancers are forced to line up and face the correct direction while using my Chimera. I was linking them so that you rez it and the 8 pose balls are around it in a circle. I'm gonna try learning how to use the rezobject command to rez the pose balls in the right spot after the root prim is rezzed. Will just have to use whispers and listens to get them to chat now  Would have just been so simple if llSetPos worked with an avatar sittin on a child prim 
|
|
Per Skookum
Registered User
Join date: 24 Jan 2007
Posts: 4
|
Bug report filed
03-23-2007 03:38
I've filed a bug report about child prims not moving (when llSetPos() is used) when an avatar is sitting on them. See it (and vote for it) at https://jira.secondlife.com/browse/MISC-53
|