Difference between revisions of "AGENT FLYING"

From Second Life Wiki
Jump to navigation Jump to search
(fix paste typo)
m (Replaced <source> with <syntaxhighlight>)
 
(6 intermediate revisions by 4 users not shown)
Line 2: Line 2:
|name=AGENT_FLYING
|name=AGENT_FLYING
|type=integer
|type=integer
|value=0x0001
|value={{LSL Hex|0x0001}}
|desc=
|desc=Used with [[llGetAgentInfo]] to determine if the queried avatar is flying.
|pa=
|pa=
|text=
|text=
|pb=
|pb=
|examples
|examples=Count how many people are currently flying within this parcel
|constants=
<syntaxhighlight lang="lsl2">
<!--{{LSL ConstRow|CHANGED_SHAPE}}-->
// On touch, say how many avatars are currently flying within this parcel
default
{
    touch_start(integer total_number)
    {
        list AgentList = llGetAgentList(AGENT_LIST_PARCEL, [] );
        integer CountAll = (AgentList != [] );
        integer CountFlying;
        key AgentKey;
        while (CountAll)
        {
            AgentKey = llList2Key(AgentList, --CountAll);
            if (llGetAgentInfo(AgentKey) & AGENT_FLYING)      ++CountFlying;
        }
        llSay(0, (string) CountFlying + " avatars are currently flying within this parcel" );
    }
}
</syntaxhighlight>
|constants={{LSL Constants/llGetAgentInfo|no-wrapper=*}}
|functions=
|functions=
{{LSL DefineRow||[[llGetAgentInfo]]|}}
{{LSL DefineRow||[[llGetAgentInfo]]|}}
|events=
|events
<!--{{LSL DefineRow||[[changed]]|}}-->
|location
|location
|cat1
|cat1=Flying
|cat2
|cat2
|cat3
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 19:22, 13 October 2023

Description

Constant: integer AGENT_FLYING = 0x0001;

The integer constant AGENT_FLYING has the value 0x0001

Used with llGetAgentInfo to determine if the queried avatar is flying.

Caveats


Related Articles

Constants

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_AUTOMATED 0x4000 is marked as a scripted agent/bot
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)
AGENT_SCRIPTED 0x0004 has scripted attachments
AGENT_SITTING 0x0010 is sitting[1]
AGENT_TYPING 0x0200 is typing
AGENT_WALKING 0x0080 is walking, running or crouch walking

Functions

•  llGetAgentInfo

Examples

Count how many people are currently flying within this parcel

// On touch, say how many avatars are currently flying within this parcel
default
{
    touch_start(integer total_number)
    {
        list AgentList = llGetAgentList(AGENT_LIST_PARCEL, [] );
        integer CountAll = (AgentList != [] );
        integer CountFlying;
        key AgentKey;
        while (CountAll)
        {
            AgentKey = llList2Key(AgentList, --CountAll);
            if (llGetAgentInfo(AgentKey) & AGENT_FLYING)       ++CountFlying;
        }
        llSay(0, (string) CountFlying + " avatars are currently flying within this parcel" );
    }
}

Deep Notes

Search JIRA for related Issues

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

integer AGENT_FLYING = 0x0001;