[RM2K3] RUNNING ANIMATIONS STUCK

Posts

Pages: 1
I hate to post this here because I thought I could figure it out and I'm certain it's an easy fix (because I got the idea for this from Helen's Secret Castle and it's done properly in that game!) but I'm having an 'issue' with the running mechanic. I used one of the tutorials here (I forget which exactly it's been a while), but really I'm just hoping someone will see this problem and just know how to stop the issue from happening..

ANYWAY.. I have it so that when the player is holding the shift key and presses a direction they 'run' in that direction, so they move faster, but the animation also changes to a running animation.. the problem is that if the player lets go of the directional key (or runs into wall) the animation stays in the 'running' sprite instead of reverting back to the original 'walk' sprite.. and what I mean by this is that they are stuck in the 'middle' animation (which is hunched over in a funny way).

I have wasted long hours trying to fix this every now and again but I just can't seem to find a way to rectify this issue.

Backwards_Cowboy
owned a Vita and WiiU. I know failure
1737
What does your event look like? Parallel process with a conditional branch to check whether or not the key is being pressed comes to mind when I think of how I would approach it.
Yes, parallel process with a conditional branch.

I will collect screens and post if I must but it's such a pain lol... was hoping someone could simply figure why the animation refused to change back even if the directional button stops being pressed (which is a requirement for the animation to change to begin with).


That kinda looks like a mess tbh, at a glance the running key detection seems fine, but what are you using to check for movement? I would just have a separate keyinput process that checks all 4 keys and reset it to walk/stand if they're not being pressed. Then separately check for the shift key. You're kind of in a spaghetti bowl of conditional branches atm, there might be something out of the way that's interfering.

Since you're using cherry's RM2K3 you can actually copy paste everything into text that you could post in a code snippet here

Here's what I did:

@> Key Input Processing: [0001:CheckMove]
@> Key Input Processing: [0002:CheckShift]
@> Comment: Set up the switches
@> Conditional Branch: Variable [0001:CheckMove] > 0
@> Control Switches: [0001:Moving] = ON
@>
: Else
@> Control Switches: [0001:Moving] = OFF
@>
: Branch End
@> Conditional Branch: Variable [0002:CheckShift] == 7
@> Control Switches: [0002:Sprint] = ON
@>
: Else
@> Control Switches: [0002:Sprint] = OFF
@>
: Branch End
@> Comment: Check the switches together
@> Conditional Branch: Switch [0001:Moving] is ON
@> Conditional Branch: Switch [0002:Sprint] is ON
@> Set Move Route: Player, Change Graphic... (Running Sprite)
@>
: Else
@> Set Move Route: Player, Change Graphic... (Walking Sprite)
@>
: Branch End
@>
: Else
@> Set Move Route: Player, Change Graphic... (Walking Sprite)
@>
: Branch End

image since the colors make it easier to see.

I place the key inputs to turn on/off switches, then check to see if they're both on/off at the same time: turn it into the running sprite. If you're not pressing the run key but still moving, turn into the walking sprite, if you're not pressing either, turn into the walking sprite.

Edit: this won't solve the wall problem, that might require additional fixing. But standing still seems to be the main thing to worry about.

Edit2: fuck it, decided to solve it anyway. Here's the event I came up with (warning a bit spaghetti branched): image here

in this example the dog appears if I'm pressing any of the 4 movement keys, the cat appears if moving is being detected (the important one) and the chicken is the sprint key. I turn into Alex when I'm sprinting, Zack when walking to illustrate what's going on.


So the basic thing is to set 2 main variables to the player's x and y coordinates, run some event to check if 2 "duplicate" variables aren't equal to it, then set the duplicate variables to the main xy variables after.

This way you can check in-between movement. Problem is RM2K3 is a little too good about checking x and y values of the player, it will "flicker" because it's checking almost every frame moving between tiles will count as the x and y values not changing (when you move you are instantly on the next tile). I decided to simply add delay, where if you're moving it will count up a delay variable to turn off the movement switch, it just sets a timer to run out if you're no longer actually moving rather than detecting being completely still. Hope that isn't too convoluted.
My spaghetti coding is coming back to haunt me.. while your method did work (the first one, I haven't tried the second one yet), now it seems that the player cannot activate events that are BELOW HERO, and ON PLAYER TOUCH.

Any ideas on what that might be?

I'm not sure why but when I switch from my old spaghetti version to yours that changes the sprite properly I'm unable to interact with things below the hero.
Oh, when the player is constantly in a Move Route it's probably disallowing certain things (even a change sprite). You can probably just use the 'Change Actor Graphic' command (1st page 2nd column) instead of the move event. But if you need a move event to change speeds you'll have to trigger/toggle it once at a time and not constantly. Usually something like:

If switch A is off
>Do move event stuff
>Then turn switch A on

Switch A would then have to be turned off elsewhere but if you need an example specific to this problem let me know.
Darn, I may have to can this fix.. it's just too dangerous and I'd hate to break something else and only notice later... If only I had been more organized lol..
I appreciate the help though Darken.
Try creating a side event that checks if the player has moved to a new tile. Set vars with coordinates, wait, set different vars with coordinates, compare them with conditional branches to see if they are equal. If yes, the player hasn't moved.

If x time goes by and the player hasn't moved, you can change sprite to normal. Something like that.
Pages: 1