The integer constant AGENT_WALKING has the value 0x0080

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

Syntax

integer AGENT_WALKING = 0x0080;

Examples

Cause a sound to be played while the wearer of the hud or attachment is walking. Place this script in a Hud for the owner only to hear the sound, or in an attachment for others to hear your footsteps too. You'll need a sound file in the object too, with your choice of footstep sounds.

// Play a sound whenever the owner is walking
integer   gWasWalking;             // TRUE when wearer is already walking
string    gSound = "footsteps";    // name of soundfile in inventory
default
{
    state_entry()
    {
        // Start a timer to continuously check if the owner is walking
        llSetTimerEvent(0.25);
    }
    timer()
    {
        integer NowWalking = llGetAgentInfo(llGetOwner()) & AGENT_WALKING;
        if  (NowWalking != gWasWalking)        // walking has stopped or started
        {
            llStopSound();
            if (NowWalking)      llLoopSound(gSound, 1.0);
        }
        gWasWalking = NowWalking;
    }
}

See also

Constants

ConstantValReturned if agent...
AGENT_ALWAYS_RUN0x1000has running ("Always Run") enabled, or is using tap-tap-hold
AGENT_ATTACHMENTS0x0002has attachments
AGENT_AUTOMATED0x4000is marked as a scripted agent/bot
AGENT_AUTOPILOT0x2000is in "autopilot" mode
AGENT_AWAY0x0040is in "away" mode
AGENT_BUSY0x0800is in "busy" mode
AGENT_CROUCHING0x0400is crouching
AGENT_FLOATING_VIA_SCRIPTED_ATTACHMENT0x8000is floating or hovering because of a scripted attachment
AGENT_FLYING0x0001is flying or hovering
AGENT_IN_AIR0x0100is in the air (jumping, flying or falling)
AGENT_MOUSELOOK0x0008is in mouselook
AGENT_ON_OBJECT0x0020is sitting on an object (and linked to it)
AGENT_SCRIPTED0x0004has scripted attachments
AGENT_SITTING0x0010is sitting[1]
AGENT_TYPING0x0200is typing
AGENT_WALKING0x0080is walking, running or crouch walking

Functions

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.