Triggering jump and land animations.

imjustmike

  • Posts: 1
Hey guys,

I'm trying to create a smoother looking jump sequence for my actor. When the player jumps, I first want a quick animation to play, then once that has finished, trigger the jump. I also want to trigger a landing animation when the player lands. I'm using the platformer kit on the forge that has jump, walk, on ground etc behaviours built in along with the animation controller.

I've tried various different methods to force the jump to occur only once the animation has played, but can't seem to get it working. My latest effort involves playing the animation once, then on frame four changing an attribute. Once that attribute is changed, it should trigger the y movement, but this doesn't happen and instead the start jump animation just loops forever. I suspect this might be due to the animation controller - I assume you can only have one animation per behaviour and my rules sort of circumvent that.

The other issue I'm having is triggering the landing animation. I've tried modifying the on ground behaviour, adding animation attributes, linking it to the controller and triggering it when it lands, but this doesn't work either.

I'll attach the behaviours to the post, any help would be awesome.


NickamonPoppytail

  • *
  • Posts: 1111
Maybe, you could tell Stencyl to trigger the animation, then create an if statement and ask Stencyl if he anmation frame is equal to (whatever the number of the last animation frame is), and if this is true, trigger the jump.

Hope this helps.
Upcoming Projects
Poppytail 5 and Pixeltail: Fifth and sixth main instalments in Poppytail series. A Game About Trimming Hedges: Final Version: An updated version of the original AGATH. One Million: Last-one-standing style small project. The Poppytales: Platformer boss rush with character collecting. Skies n' Fall: Boss rush shooter prequel to Rise n' Brawl. Precious: Weird platformer. Christmas Time 2: Sequel to Christmas Time 1.

ICLHStudios

  • Posts: 88
Well, first thing I would say is to remember that a smoother feeling jump is better and more desirable than a smoother looking one at least 99% of the time, if not more. I highly caution against having a start up animation longer than a couple frames on a jump (unless you specifically want the game to feel sluggish and borderline unresponsive, which admittedly can work fine if it's the right kind of game). If the animation is fast enough, you can get away with starting the jump immediately and it should barely even be noticeable that the start-up lifts off the ground (animation works by the mind blurring the images together in the first place).

Now, I did my game without a kit, so I'm not familiar with how any built in animation behavior works in the platformer one.  But to solve your specific problem, try to make sure that any transitional animations don't loop (you can turn this on or off when making the animation), you can then check if the animation is done by using:
IF [current animation for 'actor'] = ["start jump" animation attribute]
AND IF <is animation playing for (actor)> = FALSE
To determine that the animation played and finished successfully and then start your jump behavior. Do basically the same thing for landing, and just move to the regular walking/idle animations only once the landing one is done.

One of the other main things that I did that might be helpful to you was to create a sort of hierarchy of animations (so that animations at the top could override and interrupt animations below them, but not the other way around, so getting hit would always animate no matter what you were doing, and any action like jumping or shooting would interrupt basic movement, which itself could only interrupt pretty much the idle animations). I used a combination of attributes, Actor values, and animation checks to determine what the state of the character was and adjust the animation accordingly.
Go here to begin reading my fantasy webcomic, updated every Thursday: http://fav.me/d674ji2

LIBERADO

  • *
  • Posts: 2716
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.