Controlling the Standing animation with LUA

  • #1, by F_KalThursday, 16. March 2017, 21:07 7 years ago
    I've been trying via LUA to manipulate (start, stop and reverse) the standing animations of a NPC Character's default outfit, but it seems I cannot achieve this; I can easily get other Character Animations to work just fine though - but it seems as if standing animations in particular don't respond to startAnimation, stopAnimation - is this so indeed? or am I doing something wrong?

    Thank you!


    Forum Fan

    107 Posts


  • #2, by afrlmeThursday, 16. March 2017, 21:14 7 years ago
    I've been trying via LUA to manipulate (start, stop and reverse) the standing animations of a NPC Character's default outfit, but it seems I cannot achieve this; I can easily get other Character Animations to work just fine though - but it seems as if standing animations in particular don't respond to startAnimation, stopAnimation - is this so indeed? or am I doing something wrong?

    Thank you!


    Idle, walk, talk & random character animations are controlled by the engine. The only character animations you can start/stop are the manually started "character animations".

    Imperator

    7278 Posts

  • #3, by F_KalThursday, 16. March 2017, 21:34 7 years ago
    aha, thought so!
    Glad to hear that! 
    Thanks again AFRLme

    Forum Fan

    107 Posts

  • #4, by afrlmeThursday, 16. March 2017, 23:03 7 years ago
    aha, thought so!
    Glad to hear that! 
    Thanks again AFRLme
    No problem mate. That's not to say you can't force which frames should be played or if they should be played forward or backwards. It's possible to control that with Lua script.

    Anyway, yeah. Just thought I'd point out that it's Lua & not LUA. Basically means "moon" in Portuguese. That's another thing you can count towards whatever else you've learned the day. wink

    P.S: Pendulum_Animation_(h2) -- might find this useful as well.

    Imperator

    7278 Posts

  • #5, by F_KalFriday, 17. March 2017, 03:54 7 years ago
    yesss, the pendulum tutorial! It's turned into a permanent-resident-tab on my mac these days!

    PS. mind.push("Lua, not LUA");

    Forum Fan

    107 Posts

  • #6, by darren-beckettFriday, 17. March 2017, 10:55 7 years ago
    Once the standing animations are active, you can manipulate the start/finish frames of the animation like this:
    local fAnim = getObject("ActiveAnimations[Standing01]")
    
    fAnim.AnimationFirstFrame = 10
    fAnim.AnimationLastFrame = 30
    I have certain frames within my standing animations that call a function to decide on what the next sequence of frames should be, this allows for the charcater to have random idle animations.


    Great Poster

    384 Posts

  • #7, by afrlmeFriday, 17. March 2017, 12:21 7 years ago
    @ darren-beckett: thanks for reminding me. I also controlled the animation frames in idle animations to add dynamic blinking to the idle animations. Here's a tutorial I created for it a while back based on what I did for ALLD demo.

    Imperator

    7278 Posts