Dashing System like Mother 3 Problems

I found the scripts in the js files.

To check which direction the player is facing, use
Code:
$gamePlayer.direction() === DIRECTION
where 2 = down, 4 = left, 6 = right, 8 = up (like the numbers on the keypad).

For button presses, it's
Code:
Input.isPressed(KEY)
where KEY can be e.g. "down", "left", "right", "up".

Now the event commands can be shortened like this:
Spoiler: Event Commands with Script conditions
◆If:Button [Shift] is pressed down
◆Control Switches:#0001 Sprinting = ON
◆
:End
◆If:Sprinting is ON
◆If:Script:$gamePlayer.direction === 2 || Input.isPressed("down")
◆Set Movement Route:Player (Repeat, Skip)
:Set Movement Route:◇Move Down
◆
:End
◆If:Script:$gamePlayer.direction === 4 || Input.isPressed("left")
◆Set Movement Route:Player (Repeat, Skip)
:Set Movement Route:◇Move Left
◆
:End
◆If:Script:$gamePlayer.direction === 6 || Input.isPressed("right")
◆Set Movement Route:Player (Repeat, Skip)
:Set Movement Route:◇Move Right
◆
:End
◆If:Script:$gamePlayer.direction === 8 || Input.isPressed("up")
◆Set Movement Route:Player (Repeat, Skip)
:Set Movement Route:◇Move Up
◆
:End
◆Wait:3 frames
◆If:Script:!$gamePlayer.isMoving()
◆Control Switches:#0001 Sprinting = OFF
◆Set Movement Route:Player (Skip)
◆
:End
◆
:End
@LadyBaskerville Hey thanks for your response and looking it up! But sadly the $gamePlayer.direction === * doesnt seem to be doing anything for me for some reason. I tried making a new project to retry it, but it still doesnt do anything for me. And i basically duplicated your whole event. Does it work for you?
Oops, I forget the parentheses in the event - it should be
◆If:Script:$gamePlayer.direction() === 2 || Input.isPressed("down")
etc. like in the code snippets above.
@LadyBaskerville Aye now he registers the direction the player is facing! but it seems that the keys dont respond to another input anymore once you start walking... except for up. And left and right, if youre running downwards.
Do you perhaps have any solutions for that? Ive actually stumbled upon this problem in previous situations, and dont know how to deal with it.
Huh, I thought it was working when I tested it. I'll look into it again tomorrow to see what's going wrong there.

EDIT: Can't test it now, but maybe the check for the direction the player is facing interferes with the button presses - let's assume the player is facing up and dashing, then you press the left key: The game will set the move route to Move Left at the second script condition, but by the time it reaches the fourth (for up), the character is still facing upwards, so it sets the Move Route to Move Up again. Sorry if my wording is a bit confusing, it's quite late for me 🙂
A solution might be to separate the Direction and Button conditions again so that it checks for direction first, button presses second (the last Set Move Route command will always override the previous ones), or maybe something else I can't think of right now.
@LadyBaskerville I think i get it - youre saying that before the game has time to turn the player to left; the next check to see if the player is looking up is already passing again, which destroys the move left check. I tried putting a wait time on it, but that butchers the stop check again. I guess ill just stick to having turn and move on different conditional branches, which works flawlessly btw! but i just figured that i could learn a little bit extra on top.
Anyway i dont think its necessary for you to put any more of your precious time in for this - its doing exactly what i wanted after all. I appreciate all youve done, and ive learned alot of stuff aswell. Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/dashing-system-like-mother-3-problems.77667/