llSetAnimationOverride/ru

From Second Life Wiki
< LlSetAnimationOverride
Revision as of 23:37, 7 June 2013 by Fashion Atlas (talk | contribs) (Первопроходец)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Summary

Function: llSetAnimationOverride( string anim_state, string anim );

Устанавливается анимация (anim) переопределения, что будет проигрываться для данного переопределяемого состояния анимации (anim_state).

• string anim_state переопределяемое состояние анимации
• string anim an animation in the inventory of the prim this script is inанимация в инвентаре прима или имя встроенной анимации built-in animation

To run this function the script must request the PERMISSION_OVERRIDE_ANIMATIONS permission with llRequestPermissions. Примечание: Все анимации переопределения продолжат существовать, кроме случая relog.

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.
  • If anim is missing from the prim's inventory or it is not an animation then an error is shouted on DEBUG_CHANNEL.
  • Анимация переопределения продолжит существовать при сбросе (reset) скрипта , удалении скрипта, удалении атачмента, проникновении в другой регион и телепортации, но не при relog.
  • Состояние "Sit on Ground"("сидеть на почве") сыграет анимацию 'по-умолчанию' в дополнение к любой установке переопределения. Это необходимо для правильного поведения в СЛ-клиенте.
  • Некоторые состояния являются переходными и имеют неопределенное поведение, если установлено непрерывный цикл анимации. Это состояния "PreJumping", "Landing", "Soft Landing" и "Standing Up".

Examples

<lsl>// Переопределение анимации 'Sit', 'Stand' и 'Walk' // 1. поместите этот скрипт и анимации в прим // 2. редактируйте названия анимации в скрипте, согласно ваших имен анимации // 3. прикрепите прим к вашему аватару

string gMySit = "chop_sit"; string gMyStand = "FStand _02"; string gMyWalk = "Kort gang F v4.1";

default {

   attach(key id)
   {
       if ( id ) llRequestPermissions(id , PERMISSION_OVERRIDE_ANIMATIONS);
       else if ( llGetPermissions() & PERMISSION_OVERRIDE_ANIMATIONS ) llResetAnimationOverride("ALL");
   }
   run_time_permissions(integer perms)
   {
       if ( perms & PERMISSION_OVERRIDE_ANIMATIONS )
       {
           llSetAnimationOverride( "Sitting", gMySit);
           llSetAnimationOverride( "Standing", gMyStand);
           llSetAnimationOverride( "Walking", gMyWalk);
       }
   }
}</lsl>

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
•  llGetAnimationOverride
•  llResetAnimationOverride

Articles

•  Script permissions
•  Internal_Animations lists internal Animations always available

Deep Notes

Footnotes

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

Signature

function void llSetAnimationOverride( string anim_state, string anim );