LlGetAnimation/nl: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Gally Young (talk | contribs)
m add /nl to categories
San Diavolo (talk | contribs)
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{LSL Function/avatar|id|sim=*}}{{LSL_Function/nl
{{LSL_Function/nl
|inject-2={{LSL Function/avatar|id|sim=*}}
|func_id=162|func_sleep=0.0|func_energy=10.0
|func_id=162|func_sleep=0.0|func_energy=10.0
|func=llGetAnimation|return_type=string|p1_type=key|p1_name=id
|func=llGetAnimation|return_type=string|p1_type=key|p1_name=id|p1_desc=UUID van een avatar in dezelfde sim.
|func_footnote=[[llGetAgentInfo]] and [[llGetAnimationList]] provide more detailed information about the avatar state then this function does, it is recommended that you use them instead.
|func_footnote=[[llGetAgentInfo]] geeft informatie over sommige animatie-statussen (typen, afwezig, bezig), die niet door deze functie worden gedekt. [[llGetAnimationList]] geeft meer details over de lopende animaties, maar is niet zo precies als llGetAnimation over de status van de avatar.
|func_desc
|func_desc
|return_text=that is the name of the currently playing locomotion animation for avatar '''id'''. See the table below.
|return_text=met de naam van de huidige bewegingsanimatie van avatar {{LSLP|id}}. Zie de tabel hieronder.
|spec
|spec
|caveats
|caveats=*Deze functie kan een lege string opleveren als de avayar net aan het uitloggen is.
|constants={{{!}}
*Er kunnen nieuwe waarden worden toegevoegd, waardoor deze lijst niet langer compleet is. Scripts moeten er rekening mee houden, dat ze een onbekende waarde kunnen terugkrijgen.
|constants=
{{{!}} id="Constants"
{{!}}+ '''Complete lijst met mogelijke waarden op 15 Augustus 2011.'''{{Footnote|Bij het afsluiten van {{jira|SCR-26}}, is de complete lijst gepubliceerd, maar er is niet verteld welke er enkel bestaan en welke er ook daadwerkelijk gebruikt worden.|Bij het afsluiten van SCR-26, is de complete lijst gepubliceerd, maar er is niet verteld welke er enkel bestaan en welke er ook daadwerkelijk gebruikt worden.}}
{{!}}-valign="top"
{{!}}-valign="top"
{{!}}
{{!}}
{{{!}}{{Prettytable}}
{{LSL Animation States|title={{LSLGC|Animation/Override|Overschrijfbare}} animaties}}
{{!}}
{{{!}} class="sortable" {{Prettytable|style=margin-top:0;}}
{{!}}+Andere gebruikelijke animaties
{{!}}-{{Hl2}}
!Animatie
!Omschrijving
{{!}}-
{{!}}""
{{!}}Tijdens het uitloggen
{{!}}-
{{!}}"Init"
{{!}}Bij het inloggen en na een teleport
{{!}}}
{{!}}
{{{!}} class='sortable' {{Prettytable|style=margin-top:0;}}
{{!}}+Ongebruikelijke animaties
{{!}}-{{Hl2}}
{{!}}-{{Hl2}}
!Value
!Value
!Description
!Description
{{!}}-
{{!}}-
{{!}}"Crouching"
{{!}}"Crouch"
{{!}}
{{!}}-
{{!}}"Epsilon"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"CrouchWalking"
{{!}}"Fall Down Land"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Falling Down"
{{!}}"Finish Animation"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Flying"
{{!}}"Fly"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"FlyingSlow"
{{!}}"FlySlow"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Hovering"
{{!}}"Hard Land"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Hovering Down"
{{!}}"Hover Down"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Hovering Up"
{{!}}"Hover Up"
{{!}}
{{!}}
{{!}}}
{{!}}-
{{!}}"Hover"
{{!}}
{{!}}
{{{!}}{{Prettytable}}
{{!}}-{{Hl2}}
!Value
!Description
{{!}}-
{{!}}-
{{!}}"Init"
{{!}}"Medium Land"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Jumping"
{{!}}"PreFlying"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Landing"
{{!}}"PreJump"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"PreJumping"
{{!}}"Prep For Teleport"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Running"
{{!}}"Run"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Sitting"
{{!}}"Sit on Ground"
{{!}}Sitting on an object.
{{!}}
{{!}}-
{{!}}-
{{!}}"Sitting on Ground"
{{!}}"Sit"
{{!}}
{{!}}
{{!}}}
{{!}}-
{{!}}"Soft Land"
{{!}}
{{!}}
{{{!}}{{Prettytable}}
{{!}}-{{Hl2}}
!Value
!Description
{{!}}-
{{!}}-
{{!}}"Standing"
{{!}}"Stand"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Standing Up"
{{!}}"Stride"
{{!}}After falling a great distance.
{{!}}
{{!}}-
{{!}}-
{{!}}"Striding"
{{!}}"Take Off"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Soft Landing"
{{!}}"Turn Done"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Taking Off"
{{!}}"Turn Left"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Turning Left"
{{!}}"Turn Right"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Turning Right"
{{!}}"Uncrouch"
{{!}}
{{!}}
{{!}}-
{{!}}-
{{!}}"Walking"
{{!}}"Walk"
{{!}}
{{!}}
{{!}}-
{{!}}}
{{!}}}
{{!}}}
{{!}}}
|examples
|examples=
<source lang="lsl2">
// Een simpel voorbeeld van het overschrijven van een animatie
// Laat de avatar door de lucht rennen tijdens het springen
 
key eigenaar;    // de ID van de eigenaar
string vorige;  // vorige waarde van llGetAnimation
 
 
opstarten(key id) {
    if (id) {
        // wordt aangetrokken of gedragen tijdens reset
        llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);
        eigenaar = id;
    } else {
        llSetTimerEvent(0.0); // stop de timer
    }
}
 
 
default {
    state_entry() {
        // als het script wordt gereset tijdens het dragen
        if (llGetAttached()) {
            opstarten(llGetOwner());
        }
    }
 
    attach(key id) {
        opstarten(id);
    }
 
    run_time_permissions(integer perm) {
        if (perm & PERMISSION_TRIGGER_ANIMATION) {
            llSetTimerEvent(0.25); // start de timer
        }
    }
 
    timer() {
        string anim = llGetAnimation(gOwner);
 
        if (vorige != anim) {
            // alleen als de animatie is veranderd
            if (anim == "Jumping") {
 
                // Je kunt de ingebouwde animatie stoppen als je wilt, maar
                // dit kan een nadelig effect hebben: de avatar kan vast
                // komen te zitten en het resultaat van llGetAgentInfo kan
                // onbetrouwbaar worden. Test het altijd even.
 
                // llStopAnimation("jump");
                llStartAnimation("run");
            }
            else if (vorige == "Jumping")  { // net klaar met springen
                // "run" is een doorlopende animatie
                // We moeten hem dus handmatig stoppen
                llStopAnimation("run");
            }
           
            vorige = anim; // onthouden voor de volgende vergelijking
        }
    }
}
</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llGetAgentInfo]]|}}
|also_functions={{LSL DefineRow||[[llGetAgentInfo]]|}}
Line 106: Line 187:
|notes
|notes
|permission
|permission
|cat1=Avatar/nl
|cat1=Avatar
|cat2=Animation/nl
|cat2=Animation
|cat3
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 05:57, 25 August 2025

Functie: string llGetAnimation( key id );

Levert een a string op met de naam van de huidige bewegingsanimatie van avatar id. Zie de tabel hieronder.

• key id UUID van een avatar in dezelfde sim.


llGetAgentInfo geeft informatie over sommige animatie-statussen (typen, afwezig, bezig), die niet door deze functie worden gedekt. llGetAnimationList geeft meer details over de lopende animaties, maar is niet zo precies als llGetAnimation over de status van de avatar.

Complete lijst met mogelijke waarden op 15 Augustus 2011.[1]
Overschrijfbare animaties
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.[2] 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
Andere gebruikelijke animaties
Animatie Omschrijving
"" Tijdens het uitloggen
"Init" Bij het inloggen en na een teleport
Ongebruikelijke animaties
Value Description
"Crouch"
"Epsilon"
"Fall Down Land"
"Finish Animation"
"Fly"
"FlySlow"
"Hard Land"
"Hover Down"
"Hover Up"
"Hover"
"Medium Land"
"PreFlying"
"PreJump"
"Prep For Teleport"
"Run"
"Sit on Ground"
"Sit"
"Soft Land"
"Stand"
"Stride"
"Take Off"
"Turn Done"
"Turn Left"
"Turn Right"
"Uncrouch"
"Walk"

Kanttekeningen

  • Deze functie kan een lege string opleveren als de avayar net aan het uitloggen is.
  • Er kunnen nieuwe waarden worden toegevoegd, waardoor deze lijst niet langer compleet is. Scripts moeten er rekening mee houden, dat ze een onbekende waarde kunnen terugkrijgen.

Voorbeelden

// Een simpel voorbeeld van het overschrijven van een animatie
// Laat de avatar door de lucht rennen tijdens het springen

key eigenaar;    // de ID van de eigenaar
string vorige;   // vorige waarde van llGetAnimation


opstarten(key id) {
    if (id) {
        // wordt aangetrokken of gedragen tijdens reset
        llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);
        eigenaar = id;
    } else {
        llSetTimerEvent(0.0); // stop de timer
    }
}


default {
    state_entry() {
        // als het script wordt gereset tijdens het dragen
        if (llGetAttached()) {
            opstarten(llGetOwner());
        }
    }

    attach(key id) {
        opstarten(id);
    }

    run_time_permissions(integer perm) {
        if (perm & PERMISSION_TRIGGER_ANIMATION) {
            llSetTimerEvent(0.25); // start de timer
        }
    }

    timer() {
        string anim = llGetAnimation(gOwner);

        if (vorige != anim) { 
            // alleen als de animatie is veranderd
            if (anim == "Jumping") {

                // Je kunt de ingebouwde animatie stoppen als je wilt, maar
                // dit kan een nadelig effect hebben: de avatar kan vast 
                // komen te zitten en het resultaat van llGetAgentInfo kan
                // onbetrouwbaar worden. Test het altijd even.

                // llStopAnimation("jump");
                llStartAnimation("run");
            }
            else if (vorige == "Jumping")  { // net klaar met springen
                // "run" is een doorlopende animatie
                // We moeten hem dus handmatig stoppen
                llStopAnimation("run");
            }
            
            vorige = anim; // onthouden voor de volgende vergelijking
        }
    }
}

Zie ook

Functies

•  llGetAgentInfo
•  llGetAnimationList