OsNpcLookAt
From OpenSimulator
(Difference between revisions)
(3 intermediate revisions by one user not shown) | |||
Line 10: | Line 10: | ||
* type : the type of the lookat | * type : the type of the lookat | ||
* targetkey : a object or avatar target | * targetkey : a object or avatar target | ||
− | * offset : a offset relative to that target in target local coordinates, or if target is nullkey a GLOBAL position. | + | * offset : a offset relative to that target in that target local coordinates, or if target is nullkey a GLOBAL position. |
− | This sends a viewer lookat effect relative to that npc to all avatars in region. | + | This sends a viewer lookat effect relative to that npc to all avatars in region.<br> |
− | This will make those viewers | + | This will make those viewers turn the npc head and eyes to the target position plus offset, if the current head animation priority is lower than the viewers defined head movement priority, usually 1. |
type defines what kind of event or attention. They have viewer defined priorities relative to each other | type defines what kind of event or attention. They have viewer defined priorities relative to each other | ||
Line 32: | Line 32: | ||
* NPCLOOKAT_CLEAR = 10; should clear current one ? | * NPCLOOKAT_CLEAR = 10; should clear current one ? | ||
− | What does happen to the npc is viewer dependent | + | What does happen to the npc is viewer dependent and also may also depend on the npc gender. |
+ | |||
+ | For example to set normal look forward like idle mouse | ||
+ | osNpcLookAt(npckey, NPCLOOKAT_IDLE, npckey, <2.5, 0.0, 0.0>); // (looks to npc position plus 2.5m on x that is its front direction) | ||
+ | |||
+ | function will return a integer < 0 on error | ||
+ | -1 invalid type | ||
+ | -2 could not parse npckey | ||
+ | -3 npc not found on region | ||
+ | -4 could not parse targetkey | ||
+ | -5 target key is not null key, or there is no agent or object with that key in region | ||
+ | |||
− | |||
|threat_level=ignored | |threat_level=ignored |
Latest revision as of 01:17, 17 February 2021
integer osNpcLookAt(key npckey, integer type, key targetkey, vector offset)
| |
Caution ! still experimental, subject to changes
This sends a viewer lookat effect relative to that npc to all avatars in region. type defines what kind of event or attention. They have viewer defined priorities relative to each other Only the one with higher priority will play. type constants:
What does happen to the npc is viewer dependent and also may also depend on the npc gender. For example to set normal look forward like idle mouse osNpcLookAt(npckey, NPCLOOKAT_IDLE, npckey, <2.5, 0.0, 0.0>); // (looks to npc position plus 2.5m on x that is its front direction) function will return a integer < 0 on error -1 invalid type -2 could not parse npckey -3 npc not found on region -4 could not parse targetkey -5 target key is not null key, or there is no agent or object with that key in region | |
Threat Level | This function does not do a threat level check |
Permissions | Use of this function is always allowed by default |
Extra Delay | 0 seconds |
Notes | |
This function was added in 0.9.2.0 |