Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007129opensim[REGION] Specific OpenSim Modulepublic2014-04-23 18:252021-11-13 18:20
ReporterGwyneth Llewelyn 
Assigned ToGwyneth Llewelyn 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformPCOperating SystemUbuntuOperating System Version14.04 LTS
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0007129: osNpcSit on prim does not immediately sit the avatar
DescriptionA year ago, this was reported by Rameshsharma Ramloll on the opensim-users mailing list: [^]

I just tested it under 0.8.0 Dev (latest git). When giving a osNpcMoveToTarget command towards a prim, followed by a osNpcSit command on that very same prim, the NPC will just stand beneath it. Once the NPC is not moving any longer, then osNpcSit works immediately.

Apparently sitting will only work if the NPC is not moving.
Steps To ReproduceI'm using a slightly modified version of the NPC manipulator adapted by justincc 0.0.3 released 20121025 ( [^]) just to do some tests.
Additional InformationA possible workaround is to check if the avatar is not moving before emitting the osNpcSit command. I do that by attaching an object to the NPC (which tracks more information anyway) and looking to see if the current velocity is zero, and waiting if it's not. This is a bit tricky and results might differ between ODE and BulletSim (i.e. velocity might not be _exactly_ zero when the NPC _seems_ stationary).
TagsNPC, osNpcSit, sit
Git Revision or version numberOpenSim 0.8.0 Dev 722f030 (interface version 7)
Run Mode Grid (Multiple Regions per Sim)
Physics EngineODE
Script Engine
EnvironmentMono / Linux64
Mono Version6.x
Attached Files

- Relationships

-  Notes
dz (reporter)
2014-12-11 06:24

I have experienced a similar problem. In my case the NPC walks toward a bench to sit on it. The NPC would "sit" (triggering the proper animation), however its motion would not stop... so it would appear to drift off into space slowly.

The simple solution was to include a stopMoveTo command before having the NPC sit.
This seems to be extremely reliable and does not require any velocity detections or delay between the stop and sit commands.

        osNpcStopMoveToTarget( npc );
        osNpcSit(npc, theBench, OS_NPC_SIT_NOW);
Gwyneth Llewelyn (reporter)
2021-11-13 18:20

I'll accept this as 'fixed', or, rather, assume that the workaround proposed by @dz is the correct, idiomatic way of dealing with the issue. In a weird sort of way, it even makes sense: iRL, if you're still moving around, attempting to jump in the air to land on a bench sitting down (without falling over...) is no mean feat — very likely you'll land on the ground instead. So why should OpenSimulator be different? After all, that's exactly what seems to happen — the NPC's avatar fails to sit on the bench while moving, and either remains standing or sits on the ground next to the bench. So, it's much more rational to expect that NPCs have to stop moving first before attempting to sit down, then to automatically assume that there is something inherently wrong in the OpenSimulator code...

- Issue History
Date Modified Username Field Change
2014-04-23 18:25 Gwyneth Llewelyn New Issue
2014-04-23 18:26 Gwyneth Llewelyn Tag Attached: NPC
2014-04-23 18:26 Gwyneth Llewelyn Tag Attached: sit
2014-04-23 18:26 Gwyneth Llewelyn Tag Attached: osNpcSit
2014-12-11 06:24 dz Note Added: 0027086
2021-11-13 18:20 Gwyneth Llewelyn Mono Version 3.2 => 6.x
2021-11-13 18:20 Gwyneth Llewelyn Note Added: 0038225
2021-11-13 18:20 Gwyneth Llewelyn Status new => resolved
2021-11-13 18:20 Gwyneth Llewelyn Resolution open => fixed
2021-11-13 18:20 Gwyneth Llewelyn Assigned To => Gwyneth Llewelyn

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker