llUnSit unpredictable rotation

Creating scripts
Post Reply
User avatar
Leaf Illusion
Posts: 10
Joined: Sat Oct 25, 2014 5:03 pm
Has thanked: 8 times
Been thanked: 10 times

llUnSit unpredictable rotation

Post by Leaf Illusion »

I've noticed that llUnSit in Kitely / OpenSim does not work the same way it does in SecondLife. Was wondering if anyone knows if this is an intentional feature? In SecondLife if you sit an avatar and then rotate the seat the avatar stands in front of the seat and facing away from it. In OS the avatar stands in front of the seat (I understand only since v0.8) but rotates in what seems to be a random direction. (At least I can't seem to see a pattern to the direction the avatar faces.) The only way I know of to rotate an avatar with a script is to seat them on a prim and rotate the prim, so this random rotation breaks that "tool" in the scripter's toolbox. Anyone know if there is another way to rotate an avatar in Opensim?
User avatar
Kayaker Magic
Posts: 354
Joined: Sun Dec 01, 2013 8:40 am
Has thanked: 52 times
Been thanked: 393 times

Re: llUnSit unpredictable rotation

Post by Kayaker Magic »

I have also noticed that random rotation on standing up. My impression has been that when you stand up the "random direction" is an attempt to rotate the avatar to face the same direction the camera is facing. I have not found a way to work around this problem.

The avatar does not stand in front of the seat, instead the avatar returns to the location set by llSitTarget just before s/he finishes standing up! I have used this "bug" to good advantage: I set llSitTarget to a location a meter or so in front (or in back) of the chair. As soon as someone sits, I use llSetLinkPrimitiveParamsFast to move the avatar to the correct sit location. Then when they stand up, they return to the llSitTarget location, a safe distance away from the chair. This fixes an old, old bug in SL where avatars just stood up where they were sitting, resulting in them being stuck in the middle of the chair, or getting tossed up in the air by physics. Most people who make furniture in SL just give up and make all furniture phantom to avoid this problem. Of course, this return-to-llSitTarget behavior is undocumented and may be removed one day as other real bugs are fixed.

No, rotating the prim an avatar is seated on does not rotate the avatar, unless that prim is the root prim. The avatar becomes just another child prim in the object and is not effected by rotating or moving any of the other child prims. Even if the child prim contains the script that sat and animated the avatar. Of course all the child prims (and any seated avatars) are moved and rotated when the root prim moves.

However, there is a way to move or rotate a seated avatar: Since the avatar becomes just another child prim, it has a link number (initially the last link in the build) and you can use llSetLinkPrimitiveParamsFast to rotate and move the avatar as if it was another primitive.
These users thanked the author Kayaker Magic for the post (total 2):
Dot MatrixLeaf Illusion
User avatar
Leaf Illusion
Posts: 10
Joined: Sat Oct 25, 2014 5:03 pm
Has thanked: 8 times
Been thanked: 10 times

Re: llUnSit unpredictable rotation

Post by Leaf Illusion »

I've tried resetting rotation of the avatar using llSetLinkPrimitiveParamsFast. It changes the rotation of the avatar while on the seat, but the avatar still jumps back to original standing rotation when unseated. I had also thought the rotation might be impacted by the camera, so I tried using llSetCameraParams to reset the camera rotation. That didn't work either.

I did discover that, at least in my script, the randomness of the unsit rotation seems related to using ZERO_ROTATION in llSitTarget. When I switched to using a non zero value the rotation when standing was no longer random, it was always very close to the same as the avatar's rotation when they clicked to sit. That seems odd to me, but I can't see anything else I changed that would be the cause. I have been trying a lot of different code changes today playing with this, so maybe something else I changed caused the rotation to become consistent.

I think I would label this a bug. Hopefully someone connected with OpenSim development will report it as a bug. I was going to report it but the OpenSim bug website instructions seemed to indicate bug reports from non-team members are not particularly welcome and I don't want to ruffle feathers. It's pretty silly looking when an avatar stands facing the chair, which is what happens most of the time since they are facing it when they click to sit.
User avatar
Kayaker Magic
Posts: 354
Joined: Sun Dec 01, 2013 8:40 am
Has thanked: 52 times
Been thanked: 393 times

Re: llUnSit unpredictable rotation

Post by Kayaker Magic »

Leaf Illusion wrote:I was going to report it but the OpenSim bug website instructions seemed to indicate bug reports from non-team members are not particularly welcome and I don't want to ruffle feathers.
They welcome bug reports from anybody, and doing so is one way we can all help without becoming full-fledged developers. You must create an account, and fill in Byzantine forms to submit a bug to OpenSim. I find the developers pay more attention when you can supply a short script that demonstrates the problem. (Just saying "BLAH DOES NOT WORK! FIX IT!" without describing how to reliably reproduce it does not help.) I recommend that you make the effort to report this!

Oh, once you create an account on their Mantis system, you can search all the old bug reports. Yours may be an already reported one and you can add a note to the old one.
These users thanked the author Kayaker Magic for the post (total 2):
Constance PeregrineLeaf Illusion
User avatar
Leaf Illusion
Posts: 10
Joined: Sat Oct 25, 2014 5:03 pm
Has thanked: 8 times
Been thanked: 10 times

Re: llUnSit unpredictable rotation

Post by Leaf Illusion »

OK, I'll make a script to demonstrate the issue and try to figure out how to post the bug report on Mantis. Thanks for the encouragement Kayaker, I was a bit unsure if a report would be welcome from me as a non-programmer, I wouldn't have a clue how to code a patch for the llUnSit function. I have a hard enough time just hacking LSL. (My only training in programming was a adult-ed class in "Basic" way back in the '80's!) I understand why they would want to discourage help requests and gripes as opposed to bug reports. I would certainly try to give them useful info.
These users thanked the author Leaf Illusion for the post:
Dot Matrix
User avatar
Leaf Illusion
Posts: 10
Joined: Sat Oct 25, 2014 5:03 pm
Has thanked: 8 times
Been thanked: 10 times

Re: llUnSit unpredictable rotation

Post by Leaf Illusion »

Submitted to OpenSim mantis. Issue 0007394 "Unsit rotation direction."

http://opensimulator.org/mantis/view.php?id=7394
These users thanked the author Leaf Illusion for the post:
Constance Peregrine
Post Reply