LlGetAnimationList/fr

From Second Life Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Description

Fonction: list llGetAnimationList( key id );

Renvoie un list de toutes les animations jouées (actuellement) par l'avatar identifié par sa clé id.

• key id UUID d'avatar qui est dans la même region

Avertissements

  • Il n'existe aucune fonction ou mécanique interne pour obtenir le nom d'une animation jouée.

Exemples

Cet exemple est quelque peu complexe, mais il n'y a pas beaucoup d'applications simples de cette fonction. <lsl>// Remplacement simple de l'animation de marche (AO, Animation Overrider)

key vieille_anim = "6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"; string nouvelle_anim = "yoga_float"; integer etat; list verif; key proprio;

default {

   state_entry()
   {
       proprio = llGetOwner();
       llRequestPermissions(proprio, PERMISSION_TRIGGER_ANIMATION);
       verif = [ vieille_anim ];
   }
   
   run_time_permissions(integer p)
   {
       if (p & PERMISSION_TRIGGER_ANIMATION)
       {
           llSetTimerEvent(0.2);
       }
   }
   timer()
   {
       if (llGetAgentInfo(proprio) & AGENT_WALKING)
       {
           list anims = llGetAnimationList(proprio);
           if (~llListFindList(anims, verif))
           {
               etat = 1;
               llStartAnimation(nouvelle_anim);
               llStopAnimation(vieille_anim);
           }
       }
       else if (etat)
       {
           llStopAnimation(nouvelle_anim);
           etat = 0;
       }
   }
   on_rez(integer p)
   {
       llResetScript();
   }

}</lsl>

Voir également

Fonctions

•  llGetAgentInfo Renvoie des informations sur l'avatar
•  llGetAnimation Renvoie une information simplifiée à outrance sur l'animation en cours
•  llStartAnimation Lance une animation
•  llStopAnimation Stoppe une animation en cours
Vous cherchez encore des informations ? Peut-être cette page du LSLwiki pourra vous renseigner.