Difference between revisions of "LlGetAnimationList"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
(typo) |
(you should use llGetAgentInfo to detect if a user is typing) |
||
Line 4: | Line 4: | ||
|func_footnote | |func_footnote | ||
|func_desc | |func_desc | ||
|return_text=of all playing animations for avatar '''id''' | |return_text=of all playing animations for avatar described by the key '''id'''. | ||
|spec | |spec | ||
|caveats=*There is no internal mechanism to get the name of the animations playing. | |caveats=*There is no internal mechanism to get the name of the animations playing. | ||
|constants | |constants | ||
|examples= | |examples= | ||
<lsl>// | This example is a bit involved but there aren't many applications for this function. | ||
<lsl>//Simple Animation Override for Walk | |||
key old_anim = "6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"; | |||
string new_anim="yoga_float"; | |||
integer status; | |||
list check; | |||
key owner; | |||
key | |||
default | default | ||
Line 23: | Line 21: | ||
state_entry() | state_entry() | ||
{ | { | ||
owner = llGetOwner(); | |||
llRequestPermissions(owner, PERMISSION_TRIGGER_ANIMATION); | |||
check = [old_anim]; | |||
} | } | ||
run_time_permissions(integer p) | |||
{ | |||
if(p & PERMISSION_TRIGGER_ANIMATION) | |||
{ | |||
llSetTimerEvent(0.2); | |||
} | |||
} | |||
timer() | timer() | ||
{ | { | ||
if(llGetAgentInfo(owner) & AGENT_WALK) | |||
if( | |||
{ | { | ||
list anims = llGetAnimationList(owner); | |||
if(~llListFindList(anims, check)) | |||
{ | |||
status = 1; | |||
llStartAnimation(new_anim); | |||
llStopAnimation(old_anim); | |||
} | |||
} | } | ||
else | else if(status) | ||
{ | { | ||
llStopAnimation(new_anim); | |||
status = 0; | |||
} | } | ||
} | |||
on_rez(integer p) | |||
{ | |||
llResetScript(); | |||
} | } | ||
}</lsl> | }</lsl> |
Revision as of 21:45, 7 April 2008
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: list llGetAnimationList( key id );266 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns a list of all playing animations for avatar described by the key id.
• key | id | – | avatar UUID that is in the same region |
Caveats
- There is no internal mechanism to get the name of the animations playing.
Examples
This example is a bit involved but there aren't many applications for this function. <lsl>//Simple Animation Override for Walk key old_anim = "6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"; string new_anim="yoga_float"; integer status; list check; key owner;
default {
state_entry() { owner = llGetOwner(); llRequestPermissions(owner, PERMISSION_TRIGGER_ANIMATION); check = [old_anim]; } run_time_permissions(integer p) { if(p & PERMISSION_TRIGGER_ANIMATION) { llSetTimerEvent(0.2); } }
timer() { if(llGetAgentInfo(owner) & AGENT_WALK) { list anims = llGetAnimationList(owner); if(~llListFindList(anims, check)) { status = 1; llStartAnimation(new_anim); llStopAnimation(old_anim); } } else if(status) { llStopAnimation(new_anim); status = 0; } }
on_rez(integer p) { llResetScript(); }}</lsl>
See Also
Functions
• | llGetAgentInfo | – | Gets the avatar info | |
• | llGetAnimation | – | Get an over simplified avatar info string | |
• | llStartAnimation | – | Start an animation on an avatar | |
• | llStopAnimation | – | Stop an animation playing on an avatar |