Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008634opensim[REGION] Script Functionspublic2019-12-08 07:562020-05-26 12:27
ReporterKayaker Magic 
Assigned To 
PlatformLinux MonoOSOpenSim 0.9.1OS Version0.9.1
Product Version0.9.1.0 
Target VersionFixed in Version 
Summary0008634: Request a method to set the position of an avatar when standing
DescriptionWhen an avatar "stands up" while sitting on an object, several undesirable things can happen. Depending on the physics engine the avatar can get tossed up in the air, stuck inside or on top of nearby objects. It is common to mark furniture as phantom to prevent this, but problems still occur.

There used to be an undocumented feature where an avatar moved back to the sit target position when standing up. A script could set the sit target behind the chair, for example, and then move the avatar to the sitting position while animating her. Then when the avatar stood up she would find herself behind the chair. This no longer works, and hasn't worked since OpenSim 0.7 or so.

Experimentation seems to indicate that now when an avatar stands up they are moved one meter forward from where they are currently located. In the case of an avatar sitting on a stool in front of a bar, when they stand up they find themselves inside the bar, standing on top of it, or getting shoved around by the physics engine.

It would be nice to have a way to control what happens to an avatar when they stand up.
1) One solution would be to put back in the undocumented feature of moving the avatar to the sit target on standing.
2) Another would be to add an OSSL function that allows setting the location to move the avatar to on standing. (osStandTarget(key,vector)?)
3) Another would be to add an event (perhaps in changed?) that warns the script that the avatar is about to stand up. Then the script could move the avatar like a child prim to the desired stand up position. The current changed event is called AFTER the avatar is already unlinked from the object and it is too late to move them.
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (1 Region per Sim)
Physics EngineubODE
Script EngineXEngine
EnvironmentMono / Linux64
Mono Version6.x
Attached Files

- Relationships
duplicate of 0008503new When Avi gets up after sitting he makes an unnatural air jump 

-  Notes
Data Rossini (reporter)
2019-12-11 01:56

I also had problems with "stand up" Avis from prims since 0.9.
After standig up, the Avis stuck at in the ceiling above it (at usual room height).
Since a patch to 0.8 solution, it works better.
However, I only use the BulletSim physics engine.

v0.9.x line: 3280: Vector3 adjustmentForSitPose = new Vector3(0.75f, 0, m_sitAvatarHeight + .3f) * standRotationZ;
v0.8: Vector3 adjustmentForSitPose = new Vector3(0.74f, 0f, 0f) * standRotation;

Also problematic are objects that lie in front of the seat, which I then either switch "phantom" or teleport the avi to a suitable position (in a confined environment) after standig up.

Example script snipplet after stand up:

   vector tppos = llGetPos();
   tppos.x = tppos.x + standup_offset.x;
   tppos.y = tppos.y + standup_offset.y;
   tppos.z = tppos.z + standup_offset.z;
   osTeleportAgent(user, tppos, <1,1,1>);

tampa (reporter)
2019-12-11 06:37

Just teleport them or make the object phantom for a bit after the avatar stands up.
Kayaker Magic (reporter)
2019-12-12 00:41

OH! Great idea! Use a function that has THREAT LEVEL SEVERE just to land an avatar a meter or two away. Well it sometimes works, but usually SPAMs everyone in the region with error messages. Too bad there is no way to find out first if you have permission to call osTeleportAgent. Oh wait! I wrote a patch to add that! (Mantis 8634) But Ubit refuses to consider adding this to Master because "BAH! You don't need to know that!"

Making the chair phantom for a bit after the avatar stands up is problematical. Most people make all their furniture phantom to try and fix this. Then if you are lucky you end up standing in the middle of your phantom furniture. And then if you make it non-phantom after "a bit" that just puts off the problem "for a bit".

Curiously, it looks like someone is adding a new function osLocalTeleportAgent that currently has threat level NONE! This may solve the problem.
tampa (reporter)
2019-12-12 02:19

I mean I was taught not to stand on furniture anyways because that's kind of rude and non-sensical so I don't understand why anyone would want those things to be solid in the first place. Nevermind that I have not actually seen or heard anyone complain about this, it seems to me an accepted fact that there are limitations to the engine and that there are ways to deal with them in a reasonable manner that seems to satisfy most people.

Things that are "nice to have" are just that, non-critical stuff that really does not need to be over-engineered like that with its own ossl function or whatnot. Besides, if you are talking chairs, just fire a changed and move the chair back, you know, like normal people do when they get up.
Ferd Frederix (reporter)
2020-01-04 13:56

I use llPushObject(llAvatarOnSitTarget,<0,0,100>, <0,0,100>, TRUE) and adjust the X and Y accordingly. Works in getting out of boats onto a dock, for one example I use. Can get fancier by adding in the rotation of the root prim.

Be nice if the Avi could be rotated, though. TP would be a good way to handle it - I wish I had thunk of it.
djphil (reporter)
2020-01-04 14:56

I also use push and teleport and I am not fully satisfied because the push lacks precision and the teleport reset the camera position when we get up.
Data Rossini (reporter)
2020-01-04 19:39

This problem has been noticed since the change from version 0.8 to 0.9.
I have recently been using a patch for version Snail Dev from 2019-10-28, which I am using to alleviate the problem.
Here I can set in OpenSim.ini whether I prefer the old - or the new method of "standig up" the avi from a seat.

Example solution for new section in OpenSim.ini:
;; Activate section and set Method to "old" if avis stand up moderate with old method.
;; If you deactivate section or set Method to "new" then avis standup with actual method
Method = "old"

--- ScenePresence.cs.ori 2019-12-11 16:26:19.261352408 +0100
+++ ScenePresence.cs 2019-12-11 16:26:19.261352408 +0100
@@ -3277,7 +3277,15 @@
                     standRotationZ.Z = 0f;
- Vector3 adjustmentForSitPose = new Vector3(0.75f, 0, m_sitAvatarHeight + .3f) * standRotationZ;
+ Vector3 adjustmentForSitPose = new Vector3(0.75f, 0, m_sitAvatarHeight + .3f) * standRotationZ;
+ IConfig sconfig = m_scene.Config.Configs["AviStandUp"];
+ if (sconfig != null)
+ {
+ string mtd = sconfig.GetString("Method", "new");
+ if (mtd == "old")
+ adjustmentForSitPose = new Vector3(0.74f, 0f, 0f) * standRotationZ;
+ }
                 Vector3 standPos = sitPartWorldPosition + adjustmentForSitPose;
                 m_pos = standPos;

But be careful! If you patch yourself, you have to know what you are doing and be aware that you may be able to destroy your OpenSim.

I also hope that the developers will offer a solution.

- Sorry for my bad english speaking
UbitUmarov (administrator)
2020-01-14 02:56

0.8 just used a offset identical to SL
but unlike current havok, our physics engines like so send you to the moon, if the avatar gets physical inside terrain or a prim.
since because of cameras, ceilings are usually very high, it is safer to set the position higher.
with current code, any value we use will have bad cases
adding a standing target could help, but scripter has no idea where the object will actually be placed.
on top of that we do have unscripted sits
UbitUmarov (administrator)
2020-01-20 08:23

did reduce the jump a bit. Let us know if avatar gets stuck or sent to moon using bullet
UbitUmarov (administrator)
2020-01-22 10:29
edited on: 2020-01-22 10:58

just did add
        osSetStandTarget(vector v);
        vector osGetStandTarget();

the vector is on prim local frame, and tells where to approximatly place the avatar feet.
<0, 0, 0 > disables it, and previus stand offset and logic is used.

also did add
        osSetSitActiveRange(float v);
        float osGetSitActiveRange();

if v < 0 requests to sit are silent ignored
if v == 0 region default is used
else requests from a avatar this is more than v meters away are ignored.

unscripted sits not done by physics still have the extra limit of 10m

note that on physics sits the stand position will be the same :(

this values are not saved, for now. They will be.
Please let us know any issues or what you think

djphil (reporter)
2020-01-22 10:29

Nice new feature, thank's a lot :)
Data Rossini (reporter)
2020-01-23 02:18
edited on: 2020-01-24 01:28

Thank you very much :-)

for new OSSL functions. Be sure to leave it inside as it is very useful.
The new functions work well and support sitting in an optimal way. Now we can define a relative position where the Avi is standing after stand up from seat.
I have test it with last version "opensim-" and BulletSim
with following script.

However, the set values of the functions did not survive the region restart.
Therefore the script must react to the event "CHANGED_REGION_START".
Look at the "changed()" function.

// Test for new OSSL functions:
// osSetSitActiveRange(float range(),
// osSetStandTarget(vector feetAproxPosition),
// osGetSitActiveRange()
// osGetStandTarget()
// Create atest seat with a prim cube 0.5m x 0.5m x0.5m and approximately 0.6m above ground
// It works with sitanimation too.

// position and rotation to sit
// setup sit position
float sit_posX = 0.3;
float sit_posY = 0.0;
float sit_posZ = 0.65;
// Setup sitrotation in degree
float sit_rotX = 0.0;
float sit_rotY = 0.0;
float sit_rotZ = 0.1;

// Sit prim hover text
string HOVERTEXT="sit";

// Pie Menu Sit Text
string SIT_TEXT="Be Seated";

string animation;
key sitter;
vector position;
rotation rotate;

        llSetClickAction( CLICK_ACTION_SIT );

//// Test for new OSSL functions osSetSitActiveRange(float range(), osSetStandTarget(vector feetAproxPosition)
        // You can only sit on the seat within this area
        osSetSitActiveRange(5); // You can only sit on the seat within this area
        //osSetSitActiveRange(-1); // Sitting is denied
        //osSetSitActiveRange(0); // Region default. Sitting possible from greater distances
        // After getting up from the seat, position the Avi over approximately position of avatar feeds.
        //osSetStandTarget(<0, 0, 0 >); // Region default. Standard behavior when standing up.
        position = < sit_posX, sit_posY, sit_posZ >;
        rotate = llEuler2Rot(< sit_rotX * DEG_TO_RAD, sit_rotY * DEG_TO_RAD, sit_rotZ * DEG_TO_RAD>);
        llSitTarget(position, rotate);
    changed(integer change)
        if (CHANGED_LINK & change)
            if (sitter != NULL_KEY)
                llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
                integer perm=llGetPermissions();
                if ((perm & PERMISSION_TRIGGER_ANIMATION) && llStringLength(animation)>0)
                llWhisper(0,"Thank you for taking a seat here.");
        // After restart of region the functions osSetSitActiveRange and osSetStandTarget must be queried again
        if (CHANGED_REGION_START & change)
    run_time_permissions(integer perm)

//// Test for new OSSL functions osGetSitActiveRange(), osGetStandTarget()
    touch_start(integer num_detected)
        llOwnerSay("osGetSitActiveRange: " + (string)osGetSitActiveRange());
        llOwnerSay("osGetStandTarget: "+ (string)osGetStandTarget());

UbitUmarov (administrator)
2020-01-25 05:55

added [^]
UbitUmarov (administrator)
2020-01-25 06:32 [^]
UbitUmarov (administrator)
2020-01-25 07:58

well just see [^]
aiaustin (developer)
2020-01-28 08:37
edited on: 2020-01-28 08:38

Note a (possibly related) issue reported on opensim-users mailing list by Luisillo Contepomi on Sun Jan 26 22:33:45 UTC 2020

>> A week ago OpenSim Yeti Dev current
>> scripts with multisits have stopped working

UbitUmarov (administrator)
2020-01-28 10:29

they seem working. There was a issue on a commit, was that it?
aiaustin (developer)
2020-01-29 03:50
edited on: 2020-01-29 07:26

Luisillo reports on 29-Jan-2020:
>> Scripts work in version yengine but not in actual (today) dev version.
>> Thank you for reporting it to Mantis

Test object "mesa 4 sillas 1 prim" sent to Ubit on OSGrid.

Luisillo_Contepomi (reporter)
2020-01-29 14:55

The scripts only fail when object is phantom.
UbitUmarov (administrator)
2020-01-29 14:56

yes those scripted sits on phantom should be fixed now
aiaustin (developer)
2020-05-26 01:42

Are there consequences for trying to use assets created on, and which therefore contain the "StandTarget" field in the data structures, back on the current stable release grids?

I am getting reports that this might be problematic. The Kitely market for example is flagging any object which contains StandTarget as an error, so they cannot be listed.
Kayaker Magic (reporter)
2020-05-26 11:37

Making any fixes or additions to OpenSim is an investment in the far distant future. Once a new function is added to the API you have to wait a few years for the next official release. Then you have to wait a few years for grids like Kitely or OSGrid to switch to the new release. Then you have to wait a few more years for a majority of the regions in OSGrid to switch to the new release. (There is a half life involved here, rumor has it some regions on OSGrid are still running 0.6.0). So in about 6 years you can start using StandTarget and expect it to be generally available.
UbitUmarov (administrator)
2020-05-26 11:48

This is not a issue. Those fields will be ignored by older regions
aiaustin (developer)
2020-05-26 12:27

Kayaker, this was not an issue about using any of the new functions which the StandingTarget field was introduced to support. Its an issue with the field being present in data structures which Kitely seems to baulk on. Ubit tells me its not an issue for 0.9.1 grids.. but is an issue with Kitely specific checking code only.

- Issue History
Date Modified Username Field Change
2019-12-08 07:56 Kayaker Magic New Issue
2019-12-11 01:56 Data Rossini Note Added: 0035963
2019-12-11 06:37 tampa Note Added: 0035967
2019-12-12 00:41 Kayaker Magic Note Added: 0035977
2019-12-12 02:19 tampa Note Added: 0035979
2019-12-12 02:59 Kayaker Magic Relationship added duplicate of 0008503
2020-01-04 13:56 Ferd Frederix Note Added: 0036027
2020-01-04 14:56 djphil Note Added: 0036028
2020-01-04 19:39 Data Rossini Note Added: 0036029
2020-01-14 02:56 UbitUmarov Note Added: 0036049
2020-01-20 08:23 UbitUmarov Note Added: 0036128
2020-01-22 10:29 UbitUmarov Note Added: 0036135
2020-01-22 10:29 djphil Note Added: 0036136
2020-01-22 10:39 UbitUmarov Note Edited: 0036135 View Revisions
2020-01-22 10:40 UbitUmarov Note Edited: 0036135 View Revisions
2020-01-22 10:40 UbitUmarov Note Edited: 0036135 View Revisions
2020-01-22 10:44 UbitUmarov Note Edited: 0036135 View Revisions
2020-01-22 10:58 UbitUmarov Note Edited: 0036135 View Revisions
2020-01-23 02:18 Data Rossini Note Added: 0036137
2020-01-23 02:18 Data Rossini Note Edited: 0036137 View Revisions
2020-01-23 02:22 Data Rossini Note Edited: 0036137 View Revisions
2020-01-23 02:22 Data Rossini Note Edited: 0036137 View Revisions
2020-01-23 02:25 Data Rossini Note Edited: 0036137 View Revisions
2020-01-24 00:10 Data Rossini Note Edited: 0036137 View Revisions
2020-01-24 00:21 Data Rossini Note Edited: 0036137 View Revisions
2020-01-24 00:22 Data Rossini Note Edited: 0036137 View Revisions
2020-01-24 01:28 Data Rossini Note Edited: 0036137 View Revisions
2020-01-25 05:55 UbitUmarov Note Added: 0036139
2020-01-25 06:32 UbitUmarov Note Added: 0036140
2020-01-25 07:58 UbitUmarov Note Added: 0036141
2020-01-28 08:37 aiaustin Note Added: 0036149
2020-01-28 08:37 aiaustin Note Edited: 0036149 View Revisions
2020-01-28 08:37 aiaustin Note Edited: 0036149 View Revisions
2020-01-28 08:38 aiaustin Note Edited: 0036149 View Revisions
2020-01-28 10:29 UbitUmarov Note Added: 0036150
2020-01-29 03:50 aiaustin Note Added: 0036151
2020-01-29 03:56 aiaustin Note Edited: 0036151 View Revisions
2020-01-29 03:57 aiaustin Note Edited: 0036151 View Revisions
2020-01-29 07:26 aiaustin Note Edited: 0036151 View Revisions
2020-01-29 14:55 Luisillo_Contepomi Note Added: 0036152
2020-01-29 14:56 UbitUmarov Note Added: 0036153
2020-05-26 01:42 aiaustin Note Added: 0036508
2020-05-26 11:37 Kayaker Magic Note Added: 0036513
2020-05-26 11:48 UbitUmarov Note Added: 0036514
2020-05-26 12:27 aiaustin Note Added: 0036515

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker