Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008865opensim[REGION] Script Functionspublic2021-02-11 16:382021-02-16 05:02
Reportermaurizio55 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusnewResolutionopen 
PlatformOperating SystemOperating System Version
Product Version 
Target VersionFixed in Version 
Summary0008865: add osNpcLookAt() function to make NPC movement more realistic
DescriptionIt would be nice adding a function like osNpcLookAt to NPC funtionality. Having the possibility to have a NPC look at a different direction, just rotating the head, without changing rotation would make it way ore realistic, bot while moving and in static position.
Steps To ReproduceFunction could be something like osNpcLookAt(npc, rot), with rot being the head rotation. Rotation will be relative to npc, being <0, 0, 0, 1> looking straight ahead.
TagsNo tags attached.
Git Revision or version number
Run ModeStandalone (1 Region)
Physics EngineBulletSim
Script EngineXEngine
EnvironmentUnknown
Mono VersionNone
Viewer
Attached Files

- Relationships

-  Notes
(0037560)
Total Sorbet (reporter)
2021-02-12 02:49

This is probably better addressed using osNpcPlayAnimation() & osNpcSetRot()
(0037561)
Luisillo_Contepomi (reporter)
2021-02-12 03:44

"..., just rotating the head,..."

I think is a very good idea!. Focused over talking nearby avatar as viewer do.

By other hand, osNpcPlayAnimation() & osNpcSetRot() would not be normal human behavior.

As the viewer behavior would be perfect.
(0037574)
maurizio55 (reporter)
2021-02-15 16:04
edited on: 2021-02-15 16:05

Yes of course that can be accomplished with ad-hoc animations, but what I am thinking is a head rotation happening while playing another animation, like somebody walking, crossing from left to right while looking at you, the same thing that happen with avatars moving the pointer.

(0037575)
UbitUmarov (administrator)
2021-02-15 19:24

added experimental
integer osNpcLookAt(key npckey, integer type, key targetkey, vector offset)

-npckey the key of the npc.

-type the type of the lookat a integer < 11, for now, not that clear how viewers do handle them
- targetkey a object or avatar target
- offset a offset relative to that target.
or if target is nullkey a GLOBAL position.

to set "normal" look fw osNpcLookAtosNpcLookAt(npckey,1, npckey, <2.5,0,0>); ( target is the npc, offset = positive x)

as i said this is experimental and not all that clear to me, what viewers do with all those 10 types
(0037576)
UbitUmarov (administrator)
2021-02-16 04:26

added constants to the lookat type:

NPCLOOKAT_NONE = 0;
NPCLOOKAT_IDLE = 1;
NPCLOOKAT_LISTEN = 2;
NPCLOOKAT_FREELOOK = 3;
NPCLOOKAT_RESPOND = 4;
NPCLOOKAT_HOVER = 5;
NPCLOOKAT_CONVERSATION = 6;
NPCLOOKAT_SELECT = 7;
NPCLOOKAT_FOCUS = 8;
NPCLOOKAT_MOUSELOOK = 9;
NPCLOOKAT_CLEAR = 10;

this should cause different reactions on viewers..
(0037578)
Luisillo_Contepomi (reporter)
2021-02-16 05:02
edited on: 2021-02-16 13:34

work with a timer with 1s or a sensor
      timer()
    {
        if (llGetAgentInfo(target) & AGENT_TYPING)
        {
             osNpcLookAt(bot,8,target , <0.1,0,0>);
            
        } else { osNpcLookAt(bot,10, bot , <2.5,0,0>); }
    }


- Issue History
Date Modified Username Field Change
2021-02-11 16:38 maurizio55 New Issue
2021-02-12 02:49 Total Sorbet Note Added: 0037560
2021-02-12 03:44 Luisillo_Contepomi Note Added: 0037561
2021-02-15 16:04 maurizio55 Note Added: 0037574
2021-02-15 16:05 maurizio55 Note Edited: 0037574 View Revisions
2021-02-15 19:24 UbitUmarov Note Added: 0037575
2021-02-16 04:26 UbitUmarov Note Added: 0037576
2021-02-16 04:58 Luisillo_Contepomi Note Added: 0037577
2021-02-16 04:59 Luisillo_Contepomi Note Edited: 0037577 View Revisions
2021-02-16 04:59 Luisillo_Contepomi Note Deleted: 0037577
2021-02-16 05:02 Luisillo_Contepomi Note Added: 0037578
2021-02-16 05:55 Luisillo_Contepomi Note Edited: 0037578 View Revisions
2021-02-16 05:56 Luisillo_Contepomi Note Edited: 0037578 View Revisions
2021-02-16 08:21 Luisillo_Contepomi Note Edited: 0037578 View Revisions
2021-02-16 13:34 Luisillo_Contepomi Note Edited: 0037578 View Revisions


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker