Active Animation Framecount

  • #1, by sebastianSaturday, 22. August 2015, 18:38 5 years ago
    Hey Boys'n'Gurls,

    i want to count the frames of an active animation, but i get "nil" as a value .
    local framecount = getObject("ActiveAnimations["..game:getLink(VGameUsedItem):getName().."]"):getInt(VAnimationFrameCount)
    print(framecount)
    1
    2
    3


    Animation of the object has 2 Frames. I expected that i get this in return, but all i get is a "nil" when printing the int.

    Any ideas?

    EDIT:

    Meh... i know whats wrong. The AnimationFrameCount Value counts frames which are already passed. Not the total framecount. I'll do it otherwise then.... *_*

    thanks anyway

    ~Sebastian

    Thread Captain

    2331 Posts


  • #2, by constantinSaturday, 07. April 2018, 19:47 2 years ago
    how did you count the total amount of animation frames? 

    Forum Fan

    167 Posts

  • #3, by sebastianSaturday, 07. April 2018, 19:55 2 years ago
    Not sure anymore for what i wanted to use it here, but the "AnimationLastFrame" field should contain the  number of frames of the animation by default (unless you changed it via lua):

    VS5: framecount = ActiveAnimations["nameofanimation"].LastFrame
    1

    Thread Captain

    2331 Posts

  • #4, by constantinSaturday, 07. April 2018, 19:58 2 years ago
    okay thank you.

    Forum Fan

    167 Posts

Write post