05.01.2016, 20:33
I'm having a little problem with looping animations. Some of the monsters' animations are played in an endless loop. Let's take the die-animation for example. I need the enemy to just fall over once. But for some monsters (The wolf for example, pc_hero works fine I think) it will repeat the animation until I call endAnimation(). Of course I don't know exactly how long the animation is. For this example I assume I could use the animation where the enemy is already dead. Wouldn't look great, but at least it would work. But I have the same problem with the attack-animations of some monsters. The wolf for example works fine, he will only play the animation once, but the goblins on the other hand (And probably others as well) will just attack until I manually end the animation. In this case this is a pretty big deal unfortunately.
I know that at least the die-animations should be able to be played just once. I haven't tested it with GO just yet, but using the GMP this exact animation wouldn't loop when changing the instance of the player. I am getting the impressions that either I am doing something wrong, or it's something with the bot-module
Long story short: Is there a way to play any animation just once or get the length of an animation to be able to end it with endAnimation?
And some obligatory code of how to reproduce this behaviour:
I know that at least the die-animations should be able to be played just once. I haven't tested it with GO just yet, but using the GMP this exact animation wouldn't loop when changing the instance of the player. I am getting the impressions that either I am doing something wrong, or it's something with the bot-module

Long story short: Is there a way to play any animation just once or get the length of an animation to be able to end it with endAnimation?
And some obligatory code of how to reproduce this behaviour:
Code:
TestBot = createBot("TestBot");
TestBot.setInstance("WOLF");
TestBot.onDie = function(killerID)
{
playAnimation("T_DEAD");
}