The Daily Click ::. Forums ::. Klik Coding Help ::. why cant you check the state of an animation in MMF
 

Post Reply  Post Oekaki 
 

Posted By Message

MasterM



Registered
  02/01/2002
Points
  701

I am an April Fool
7th February, 2011 at 16:32:36 -

I have an active object with a Custom Animation - every other animation slot is EMPTY.

The animation has 2 frames and it does not loop.
Now I say : Current frame of active object = frame 2 - > end application

MMF won't end the application.

--------

I say "has an animation finished" - select my custom animation (its the only one there) - end application

This does not work either

 
Image

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
7th February, 2011 at 16:47:20 -

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?

 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
7th February, 2011 at 17:12:00 -

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.

 
n/a

MasterM



Registered
  02/01/2002
Points
  701

I am an April Fool
7th February, 2011 at 17:36:16 -

"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?

 
Image

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
7th February, 2011 at 17:57:46 -


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.

 
http://www.facebook.com/truediamondgame

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
7th February, 2011 at 17:59:32 -

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.

 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
7th February, 2011 at 18:07:17 -

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.

 
n/a

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
7th February, 2011 at 19:46:26 -


Originally Posted by SiLVERFIRE

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

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
8th February, 2011 at 12:39:37 -


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.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Mårten



Registered
  25/06/2002
Points
  769
8th February, 2011 at 12:51:22 -

maybe you need another animation to make the "on animation finished" event to work,

 
---
   

Post Reply



 



Advertisement

Worth A Click