Animation frames are 0-indexed, so having two frames and asking for frame=2 wouldn't work, because frame=2 will check the third frame.
The second one I don't know about, because I got that to work, with a custom animation of two frames being the only animation available and the object being set to that animation only once at the beginning of the frame. Are you starting the animation multiple times, or do you have it set to repeat or loop?
For me when I "set frame to" in the event editor it sets the frame properly, but you can't change the frame at all after that. It gets stuck on that one frame and you can't change it, start the animation, restore the animation, etc.
"Animation frames are 0-indexed, so having two frames and asking for frame=2 wouldn't work, because frame=2 will check the third frame. "
oh OF COURSE d'oh
thanks a lot this works!
----
I have no idea why the DESTROY if animation is finished does NOT work.
I use TGF Newgrounds Edition because this seems to be clickteams most up to date build.
Delete if animation has stopped is the only event in this application so I assume the "custom animation" slot is broken. I have tried it again with a new application and it works (without custom animation).
------
What I have also been wondering for ages:
Use calculation - Retrieve date from an object - Animation - Current animation value
WHAT IS CURRENT ANIMATION VALUE?
is it the current animation that is playing ie stop, walk- how can i calucate anything with this?
Originally Posted by GamesterXIII For me when I "set frame to" in the event editor it sets the frame properly, but you can't change the frame at all after that. It gets stuck on that one frame and you can't change it, start the animation, restore the animation, etc.
What gives.
You can change the frames of animations, but you can't continue the frame animation naturally until you restore it again. This has been an issue in TGF/MMF for as long as I can remember.
You can however keep changing the frame of the animation and it will keep updating. So if you use a looping alterable value and tie it to always setting the frame of the animation - well, now you have a really flexible animation engine at the tip of your finger tips, allowing both forward and reverse animation, very flexible speed controls, etc.
This is how I do the rotation of the diamonds in True Diamond, so that they all have differing animation speeds, and each randomly start at a different frame.
I'm sure theres other ways to do this, but I've never experienced any lag issues with this method and if you use behaviors to loop individual object values and label their alterable values, it can be quite clean and very efficient.
Current animation value is a value, which i believe is also 0-indexed. When you make a custom animation, the default name is the animation value. The default animations always take up the values i think, so your custom animations will always start at the same value.
Current Value of Animation Frame: It might be referring to the number of the animation frame (such as 0, 1, 2, 3 as described above).
I don't know for certain; and I've never attempted to use a calculation based on this, but here's how I imagine it might work.
Say for example you've created an animated action game; a fighter swings a sword to attack monsters. There's an animation that shows the fighter drawing the sword from their scabbard, swinging it in an arc through the air, then putting it back in their scabbard. You only want the fighter to attack whenever the sword is swinging in an arc, and not when it's in the scabbard or being inserted or withdrawn from the scabbard.
The animation is 10 frames long. The first three are the fighter drawing the sword, the next five are swinging the sword, and the final two are putting the sword away. Here's an example of code that may work for this.
///
IF (Group.Enemies) collides with (Fighter)
+ (Fighter) Animation greater than 2
+ (Fighter) Animation less than 8
THEN Destroy (Group.Enemies)
///
You would have to code separately for when the enemies collide with the fighter, and the animation value is different from that shown above (both less than 3 and more than 7).
This is just off the top of my head; I'm at the office so I'm unable to test out the possibility. But that may be how it works.
Personally, I can imagine other ways of doing this, but perhaps the Animation Value can be useful for this or other purposes.
Originally Posted by GamesterXIII For me when I "set frame to" in the event editor it sets the frame properly, but you can't change the frame at all after that. It gets stuck on that one frame and you can't change it, start the animation, restore the animation, etc.
What gives.
You can change the frames of animations, but you can't continue the frame animation naturally until you restore it again. This has been an issue in TGF/MMF for as long as I can remember.
You can however keep changing the frame of the animation and it will keep updating. So if you use a looping alterable value and tie it to always setting the frame of the animation - well, now you have a really flexible animation engine at the tip of your finger tips, allowing both forward and reverse animation, very flexible speed controls, etc.
This is how I do the rotation of the diamonds in True Diamond, so that they all have differing animation speeds, and each randomly start at a different frame.
I'm sure theres other ways to do this, but I've never experienced any lag issues with this method and if you use behaviors to loop individual object values and label their alterable values, it can be quite clean and very efficient.
The thing is that it doesn't work even after I restore it. I just solve it by not using that even at all aha. Theres always other methods
Originally Posted by Jon Lambert Current animation value is a value, which i believe is also 0-indexed. When you make a custom animation, the default name is the animation value. The default animations always take up the values i think, so your custom animations will always start at the same value.
Yup, all "regular" animations each have a set value starting from 0, following the same order as they appear in the animation editor, i.e "stopped" being 0, "walking" 1 etc, all the way to "stand up" as 11. Your custom animations are numbered from 12 (the thirteenth animation) and upward. They keep the same value they get assigned when created, even if you delete the animation.