Difference between revisions of "LlGetAgentInfo"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{Issues/SVC-91}}{{Issues/SVC-3177}}{{LSL Function/avatar|id|sim=*}}{{LSL_Function
{{LSL_Function
|inject-2={{Issues/SVC-91}}{{Issues/SVC-3177}}{{LSL Function/avatar|id|sim=*}}
|func=llGetAgentInfo
|func=llGetAgentInfo
|sort=GetAgentInfo
|sort=GetAgentInfo
Line 6: Line 7:
|func_footnote
|func_footnote
|func_desc
|func_desc
|return_text=bitfield containing the agent information about '''id'''.
|return_text=bitfield containing the agent information about {{LSLP|id}}.
|spec
|spec
|caveats=*[[AGENT_BUSY]] indicates that the "busy" [[Internal Animations|internal animation]] is playing, even if the user is not truly in busy mode.
|caveats=*[[AGENT_BUSY]] indicates that the "busy" [[Internal Animations|internal animation]] is playing, even if the user is not truly in busy mode.
* '''On server 1.40 and below''', [[AGENT_TYPING]] indicated that the "type" internal animation is playing, it would not be set if the user disabled [[Debug Settings|PlayTypingAnim]]. '''On server 1.42 and up''', it reflects [[ChatFromViewer|typing start/stop messages]] from the client and does not depend on the  animation. If the old behavior is desired, use [[llGetAnimationList]] and look for c541c47f-e0c0-058b-ad1a-d6ae3a4584d9 <sup>{{Jira|SVC-787}}</sup>
* '''On server 1.40 and below''', [[AGENT_TYPING]] indicated that the "type" internal animation is playing, it would not be set if the user disabled [[Debug Settings|PlayTypingAnim]]. '''On server 1.42 and up''', it reflects [[ChatFromViewer|typing start/stop messages]] from the client and does not depend on the  animation. If the old behavior is desired, use [[llGetAnimationList]] and look for {{NoWrap|{{String|c541c47f-e0c0-058b-ad1a-d6ae3a4584d9}}}} &mdash; {{Jira|SVC-787}}
*[[AGENT_ALWAYS_RUN]]{{!}}[[AGENT_WALKING]] indicates that the user requested to run using standard viewer controls. Use [[llGetAnimation]] to also detect running caused by physics.
*<code>[[AGENT_ALWAYS_RUN]] {{!}} [[AGENT_WALKING]]</code> indicates that the user requested to run using standard viewer controls. Use [[llGetAnimation]] to also detect running caused by physics.
*This function does not return reliable information immediately after a border crossing. Use [[llGetAnimation]] instead, if you can. <sup>{{Jira|SVC-3177}}</sup>
*This function does not return reliable information immediately after a border crossing. Use [[llGetAnimation]] instead, if you can. &mdash; {{Jira|SVC-3177}}
|constants=
|constants=
{{{!}}class="wikitable sortable collapsible" {{Prettytable|style=margin-top:0;}}
{{{!}}class="wikitable sortable collapsible" {{Prettytable|style=margin-top:0;}}

Revision as of 09:19, 13 June 2012

Summary

Function: integer llGetAgentInfo( key id );

Returns an integer bitfield containing the agent information about id.

• key id avatar UUID that is in the same region

Constant Val Returned if agent...
AGENT_ALWAYS_RUN 0x1000 has running ("Always Run") enabled, or is using tap-tap-hold
AGENT_ATTACHMENTS 0x0002 has attachments
AGENT_AUTOPILOT 0x2000 is in "autopilot" mode
AGENT_AWAY 0x0040 is in "away" mode
AGENT_BUSY 0x0800 is in "busy" mode
AGENT_CROUCHING 0x0400 is crouching
AGENT_FLYING 0x0001 is flying or hovering
AGENT_IN_AIR 0x0100 is in the air (jumping, flying or falling)
AGENT_MOUSELOOK 0x0008 is in mouselook
AGENT_ON_OBJECT 0x0020 is sitting on an object (and linked to it)[1]
AGENT_SCRIPTED 0x0004 has scripted attachments
AGENT_SITTING 0x0010 is sitting
AGENT_TYPING 0x0200 is typing
AGENT_WALKING 0x0080 is walking, running or crouch walking

Caveats

Important Issues

~ All Issues ~ Search JIRA for related Bugs
   llGetAgentInfo() returns unreliable info after a sim border crossing

Examples

<lsl> default {

   touch_start(integer buf)
   {
       buf = llGetAgentInfo(llDetectedKey(0));
       string out;
       if(buf & AGENT_FLYING)
           out += "The agent is flying.\n";
       else
           out += "The agent is not flying.\n";
       
       if(buf & AGENT_ATTACHMENTS)
       {
           if(buf & AGENT_SCRIPTED)
               out += "The agent has scripted attachments.\n";
           else
               out += "The agent's attachments are unscripted.\n";
       }
       else
           out += "The agent does not have attachments.\n";
       
       if(buf & AGENT_MOUSELOOK)
           out += "the agent is in mouselook.";
       else
           out += "the agent is in normal camera mode.";
       llWhisper(0, out);
   }

}

</lsl>

Notes

This is not a good way of testing if an avatar is in the region, use llGetAgentSize instead.

See Also

Deep Notes

History

All Issues

~ Search JIRA for related Issues
   agent_info() event
   llGetAgentInfo() returns unreliable info after a sim border crossing

Tests

•  llGetAgentInfo_Test

Footnotes

  1. ^ "Sit down" on the avatar context menu allows ground sits anywhere: atop the terrain, on objects or even in the air, so it is possible to sit "on" an object without linking.

Signature

function integer llGetAgentInfo( key id );