|
AnnMarie Otoole
Addicted scripter
Join date: 6 Jan 2007
Posts: 162
|
04-03-2007 22:07
Avatar pushes a floor button in the elvator. Since they have to sit down or get left behind when the elevator moves, I have them sit on a nice leather seat by using an llSitTarget(<0.4,-0.5,0.25>ZERO_ROTATION);
The sit works fine and a "changed" state, checked with llAvatarOnSitTarget() processes elevator stuff.
Subsequently at the destination (and sometimes with no movement) I have an llUnSit(llAvatarOnSitTarget());
But she stands up about 1 meter off the floor and is very reluctant to get back down on the floor. After walking around for 20 or 30 seconds she will pop back down.
Its bad enough to put her dirty feet on the cushion but how can I convince her to get back down on the floor after she steps off.
The elevator has about 20 primitives. The parent prim is about 1.5 meters above the floor and the seat is close by, about 1 meter lower and 0.5 meter off the floor.
Any suggestions?
I do have another situation where this exact same process works very well however the object on which she sits is a single prim, not a linked set. I'm sure my problem has something to do with this.
|
|
AnnMarie Otoole
Addicted scripter
Join date: 6 Jan 2007
Posts: 162
|
04-04-2007 01:34
Never mind, I think I've figured it out. I have to make the floor of the elevator the parent prim. The avatar is trying to walk on the level of a prim above the floor when standing up in the linked set.
|
|
AnnMarie Otoole
Addicted scripter
Join date: 6 Jan 2007
Posts: 162
|
04-05-2007 19:40
Well that helped considerably but she still tries to walk in air when I "UnSit" her.
The parent prim is in the bottom of the elevator - lowest point. The elevator motion controls are also in the parent prim. But the UnSit command comes from one of the elevator button child prims, about half way up the elevator. Is that the problem? Do I need to have the push button ask the motion control to do the sitting and unsitting from down in the floor? When being un-sat, does the Avatar attempt to find a ground level at the elevation of the object (prim) issuing the unsit command?
I guess I could momentarily re-position the push button prim to floor level, issue the UnSit, and then put it back where it belongs.
Which brings up another question:-
Since the sit command was given by the elevator button and the llSitTartet() was defined in that button script, can another script unseat her? Surely the Target "belongs" to the script that created it and sat her on it and only that script can do the unsatting.
Any wisdom here or am I in for hours of experimenting?
|
|
AnnMarie Otoole
Addicted scripter
Join date: 6 Jan 2007
Posts: 162
|
04-05-2007 19:52
I'M MISSING SOMETHING BASIC HERE.
Even when I unsit her manually, she still wants to climb in the air for a few seconds so it is probably nothing to do with the UnSit() command.
Do the Lindens have an Avatar drug recovery ward? She's "high" on something.
Is it because she is sitting "inside" a linked set and despite having the parent in the floor she is looking for the center of mass?
|
|
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
|
04-05-2007 20:05
From: AnnMarie Otoole I'M MISSING SOMETHING BASIC HERE. Even when I unsit her manually, she still wants to climb in the air for a few seconds so it is probably nothing to do with the UnSit() command. Do the Lindens have an Avatar drug recovery ward? She's "high" on something. Is it because she is sitting "inside" a linked set and despite having the parent in the floor she is looking for the center of mass? Recently, I had my avatar not just walk after standing (which is common), but actually fly around in circles over about a quarter of a sim, then Second Life crashed to desktop. Just because I stood up :[
|
|
AnnMarie Otoole
Addicted scripter
Join date: 6 Jan 2007
Posts: 162
|
04-06-2007 10:15
Well I don't know if anyone is interested but I've managed to get things working. I did the following. 1. I put a stool with the sit-upon at the center of the linked set. By moving the llSitTarget() to this spot, standing up is no longer a traumatic experience.
2. For some reason the floor of the elevator linked set would go phantom on me. Even though you could edit it separately and it showed no phantom characteristics, it would consistentlly act phantom. It seems like a bug to me.
Workaround:- I created an extra floor prim immediately above the floor. It doesn't touch or intersect anything and I made it transparent. This seems to work 100% so far.
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
04-07-2007 10:58
When you stand up from sitting on an object, your avatar goes almost immediately from the sitting position to the standing position. The SL viewer does quite a bit of computation over placing the avatar and its legs in a "natural" position in relation to any objects/ground intersecting the avatar. As a result, it will often move the avatar to stand on top of the object recently sat upon, or even launch the avatar away from the object, if the avatar is seriously intersecting the bounding volume of the object.
In general, the best practice is to place the sit target in the specific piece of the object being sat upon (chair seat, sit-ball, etc), and potentially use a gentle llPushObject (if possible) on the avatar to push them slightly away from the object so the avatar doesn't end up standing on it. Outside of that, experimenting with the specific build you have should lead to the best combination of tactics to resolve the problem. Just remember that it is a well-known and oft-lamented problem and, in some extreme cases, there just may not be a "best way" to accomplish it outside of redesigning the build.
|