Difference between revisions of "LlGetAnimationList/fr"

From Second Life Wiki
Jump to navigation Jump to search
m (fixe)
m (Big proofreading)
Line 8: Line 8:
|caveats=*Il n'existe aucune fonction ou mécanique interne pour obtenir le nom d'une animation jouée.
|caveats=*Il n'existe aucune fonction ou mécanique interne pour obtenir le nom d'une animation jouée.
|constants
|constants
|examples
|examples=
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 = [ old_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>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llGetAgentInfo/fr|llGetAgentInfo]]|Renvoie des informations sur l'avatar}}
|also_functions={{LSL DefineRow||[[llGetAgentInfo/fr|llGetAgentInfo]]|Renvoie des informations sur l'avatar}}
{{LSL DefineRow||[[llGetAnimation/fr|llGetAnimation]]|Renvoie une information sur l'animation de déplacement en cours}}
{{LSL DefineRow||[[llGetAnimation/fr|llGetAnimation]]|Renvoie une information simplifiée à outrance sur l'animation en cours}}
{{LSL DefineRow||[[llStartAnimation/fr|llStartAnimation]]|Lance une animation}}
{{LSL DefineRow||[[llStartAnimation/fr|llStartAnimation]]|Lance une animation}}
{{LSL DefineRow||[[llStopAnimation/fr|llStopAnimation]]|Stoppe une animation en cours}}
{{LSL DefineRow||[[llStopAnimation/fr|llStopAnimation]]|Stoppe une animation en cours}}

Revision as of 02:59, 13 June 2008

Description

Fonction: list llGetAnimationList( key id );

Renvoie un list de toutes les animations jouées (actuellement) par l'avatar identifié par la 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 = [ old_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.