Difference between revisions of "LlGetAnimationOverride"

From Second Life Wiki
Jump to navigation Jump to search
(Add state names to the output)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-1=
|inject-2=
|inject-2=
{{LSL_Function/permission|PERMISSION_OVERRIDE_ANIMATIONS|PERMISSION_TRIGGER_ANIMATION}}
{{LSL_Function/permission|PERMISSION_OVERRIDE_ANIMATIONS|PERMISSION_TRIGGER_ANIMATION}}
Line 10: Line 11:
|spec
|spec
|caveats
|caveats
|constants
|constants={{LSL Animation States}}
|examples
|examples=
<source lang="lsl2">
//    llGetAnimationOverride Example
//    A Script to check the animation Stats on
//  all available overridable animations.
//    By Kanashio Koroshi and Pedro Oval
 
 
default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(),
            PERMISSION_OVERRIDE_ANIMATIONS);
    }
 
    run_time_permissions(integer permissions)
    {
        if (permissions & PERMISSION_OVERRIDE_ANIMATIONS)
        {
            llOwnerSay("Listing Overridden Animations");
            llOwnerSay("Crouching: " + llGetAnimationOverride("Crouching"));
            llOwnerSay("CrouchWalking: " + llGetAnimationOverride("CrouchWalking"));
            llOwnerSay("Falling Down: " + llGetAnimationOverride("Falling Down"));
            llOwnerSay("Flying: " + llGetAnimationOverride("Flying"));
            llOwnerSay("FlyingSlow: " + llGetAnimationOverride("FlyingSlow"));
            llOwnerSay("Hovering: " + llGetAnimationOverride("Hovering"));
            llOwnerSay("Hovering Down: " + llGetAnimationOverride("Hovering Down"));
            llOwnerSay("Hovering Up: " + llGetAnimationOverride("Hovering Up"));
            llOwnerSay("Jumping: " + llGetAnimationOverride("Jumping"));
            llOwnerSay("Landing: " + llGetAnimationOverride("Landing"));
            llOwnerSay("PreJumping: " + llGetAnimationOverride("PreJumping"));
            llOwnerSay("Running: " + llGetAnimationOverride("Running"));
            llOwnerSay("Sitting: " + llGetAnimationOverride("Sitting"));
            llOwnerSay("Sitting on Ground: " + llGetAnimationOverride("Sitting on Ground"));
            llOwnerSay("Standing: " + llGetAnimationOverride("Standing"));
            llOwnerSay("Standing Up: " + llGetAnimationOverride("Standing Up"));
            llOwnerSay("Striding: " + llGetAnimationOverride("Striding"));
            llOwnerSay("Soft Landing: " + llGetAnimationOverride("Soft Landing"));
            llOwnerSay("Taking Off: " + llGetAnimationOverride("Taking Off"));
            llOwnerSay("Turning Left: " + llGetAnimationOverride("Turning Left"));
            llOwnerSay("Turning Right: " + llGetAnimationOverride("Turning Right"));
            llOwnerSay("Walking: " + llGetAnimationOverride("Walking"));
        }
    }
}
</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llSetAnimationOverride]]|}}
|also_functions={{LSL DefineRow||[[llSetAnimationOverride]]|}}
Line 23: Line 70:
|cat3
|cat3
|cat4
|cat4
|history = Date of Release  [[ Release_Notes/Second_Life_Server/13#13.04.12.273874 | 12/04/2013 ]]
}}
}}

Latest revision as of 07:15, 15 July 2015

Summary

Function: string llGetAnimationOverride( string anim_state );

Returns a string that is the name of the animation that is being used for the specified animation state (anim_state).

• string anim_state animation state

To run this function the script must request the PERMISSION_OVERRIDE_ANIMATIONS or PERMISSION_TRIGGER_ANIMATION permission with llRequestPermissions.

Value Type Description Default
"Crouching" State crouch
"CrouchWalking" State crouchwalk
"Falling Down" State falldown
"Flying" State fly
"FlyingSlow" State Transition between hovering and forward flight. flyslow
"Hovering" State hover
"Hovering Down" State hover_down
"Hovering Up" State hover_up
"Jumping" State While still in the air during a jump. jump
"Landing" Transition When landing from a jump. land
"PreJumping" Transition At the beginning of a jump. prejump
"Running" State run
"Sitting" State Sitting on an object (and linked to it). sit
"Sitting on Ground" State Sitting, but not linked to an object.[1] sit_ground_constrained
"Standing" State stand
"Standing Up" Transition After falling a great distance. Sometimes referred to as Hard Landing. standup
"Striding" State When the avatar is stuck on the edge of an object or on top of another avatar. stride
"Soft Landing" Transition After falling a small distance. soft_land
"Taking Off" State hover_up
"Turning Left" State turnleft
"Turning Right" State turnright
"Walking" State walk

Caveats

Permissions
  • Once the PERMISSION_OVERRIDE_ANIMATIONS permission is granted there may be no way to revoke it except from inside the script (for example, with a new llRequestPermissions call) or if the script is reset. Furthermore even if the script loses the permission (or is derezzed), it will not reset/revert the overridable animations.
    • For Viewer 3.6.7 and up: If the object is not attached to the permission granter but is in the same region, then Me>Movement>Stop Animating Me will revoke both PERMISSION_TRIGGER_ANIMATION and PERMISSION_OVERRIDE_ANIMATIONS (other permissions will remain). In this case, overrides are reset.
  • Once the PERMISSION_TRIGGER_ANIMATION permission is granted there may be no way to revoke it except from inside the script (for example, with a new llRequestPermissions call) or if the script is reset.

Examples

//    llGetAnimationOverride Example
//    A Script to check the animation Stats on
//  all available overridable animations.
//    By Kanashio Koroshi and Pedro Oval


default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(),
            PERMISSION_OVERRIDE_ANIMATIONS);
    }

    run_time_permissions(integer permissions)
    {
        if (permissions & PERMISSION_OVERRIDE_ANIMATIONS)
        {
            llOwnerSay("Listing Overridden Animations");
            llOwnerSay("Crouching: " + llGetAnimationOverride("Crouching"));
            llOwnerSay("CrouchWalking: " + llGetAnimationOverride("CrouchWalking"));
            llOwnerSay("Falling Down: " + llGetAnimationOverride("Falling Down"));
            llOwnerSay("Flying: " + llGetAnimationOverride("Flying"));
            llOwnerSay("FlyingSlow: " + llGetAnimationOverride("FlyingSlow"));
            llOwnerSay("Hovering: " + llGetAnimationOverride("Hovering"));
            llOwnerSay("Hovering Down: " + llGetAnimationOverride("Hovering Down"));
            llOwnerSay("Hovering Up: " + llGetAnimationOverride("Hovering Up"));
            llOwnerSay("Jumping: " + llGetAnimationOverride("Jumping"));
            llOwnerSay("Landing: " + llGetAnimationOverride("Landing"));
            llOwnerSay("PreJumping: " + llGetAnimationOverride("PreJumping"));
            llOwnerSay("Running: " + llGetAnimationOverride("Running"));
            llOwnerSay("Sitting: " + llGetAnimationOverride("Sitting"));
            llOwnerSay("Sitting on Ground: " + llGetAnimationOverride("Sitting on Ground"));
            llOwnerSay("Standing: " + llGetAnimationOverride("Standing"));
            llOwnerSay("Standing Up: " + llGetAnimationOverride("Standing Up"));
            llOwnerSay("Striding: " + llGetAnimationOverride("Striding"));
            llOwnerSay("Soft Landing: " + llGetAnimationOverride("Soft Landing"));
            llOwnerSay("Taking Off: " + llGetAnimationOverride("Taking Off"));
            llOwnerSay("Turning Left: " + llGetAnimationOverride("Turning Left"));
            llOwnerSay("Turning Right: " + llGetAnimationOverride("Turning Right"));
            llOwnerSay("Walking: " + llGetAnimationOverride("Walking"));
        }
    }
}

See Also

Events

•  run_time_permissions Permission receiving event

Functions

•  llGetPermissions Get the permissions granted
•  llGetPermissionsKey Get the agent who granted permissions
•  llRequestPermissions Request permissions
•  llSetAnimationOverride
•  llResetAnimationOverride

Articles

•  Script permissions
•  Internal_Animations lists internal Animations always available

Deep Notes

History

Date of Release 12/04/2013

Footnotes

  1. ^ "Sit down" on the avatar context menu allows ground sits anywhere: atop the terrain, objects or even in the air.

Signature

function string llGetAnimationOverride( string anim_state );