How do I change the player speed after enough walking?

Hello, I would like to know how to change the player's speed after like 3 seconds of walking, and then resetting the speed of the player when they stop walking.
I'm not very familiar with 2k and 2k3, so I am not sure if this is possible.
You'd create a parallel common event. You can call it "playerDash" or something relevant like that.

Label: walk loop (we'll come back to this)
Set the player speed here.
Create a loop
We will craft the "standing around" conditions (player is not moving)
First, let's put a wait frame at the top.
Wait: 6 - 12 frames (You can decide what feels best - 12 is more efficient but may cause a delay in the timing of the event. 6 is still more than enough wait time)

There are (at least in more modern versions of RM) conditional checks for direction keys being pressed.
So set a conditional for each key:
"if up is pressed down:"
"if right is pressed down:"
[...]
Repeat for all 4 directions.

Rather than repeating the same functions for each direction, we can just use a jump command to jump to a section in the common event that we dedicate to executing this logic:
So your conditional for each direction will look like:
"if up is pressed down:
Jump to label: dashloop"
end loop

All of the above should be contained in the first loop.
Outside of the first loop, we'll create the next part of the logic by assigning where that jump to label command will go:

label: dashloop
wait 180 frames (180 frames = 3 seconds)
Loop
Create your 4 directional conditionals again, this time with an else branch.
"if up is pressed down:
(we are going to do nothing here)
else:
jump to label: walkloop"
[...]
change player speed (dash speed)
wait: 6 - 12 frames (same as above, pick a value that feels best)
end loop

There are some things that should be adjusted with this. Like it might not be ideal to make the event stop and wait a full 180 frames before continuing processing. You might want to make it so that 180 can be interrupted. But I have no idea if this can even work in the old makers, so rather than improve the logic here, let's start with that.
I'm not very familiar with 2k and 2k3, so I am not sure if this is possible.
You'd create a parallel common event. You can call it "playerDash" or something relevant like that.

Label: walk loop (we'll come back to this)
Set the player speed here.
Create a loop
We will craft the "standing around" conditions (player is not moving)
First, let's put a wait frame at the top.
Wait: 6 - 12 frames (You can decide what feels best - 12 is more efficient but may cause a delay in the timing of the event. 6 is still more than enough wait time)

There are (at least in more modern versions of RM) conditional checks for direction keys being pressed.
So set a conditional for each key:
"if up is pressed down:"
"if right is pressed down:"
[...]
Repeat for all 4 directions.

Rather than repeating the same functions for each direction, we can just use a jump command to jump to a section in the common event that we dedicate to executing this logic:
So your conditional for each direction will look like:
"if up is pressed down:
Jump to label: dashloop"
end loop

All of the above should be contained in the first loop.
Outside of the first loop, we'll create the next part of the logic by assigning where that jump to label command will go:

label: dashloop
wait 180 frames (180 frames = 3 seconds)
Loop
Create your 4 directional conditionals again, this time with an else branch.
"if up is pressed down:
(we are going to do nothing here)
else:
jump to label: walkloop"
[...]
change player speed (dash speed)
wait: 6 - 12 frames (same as above, pick a value that feels best)
end loop

There are some things that should be adjusted with this. Like it might not be ideal to make the event stop and wait a full 180 frames before continuing processing. You might want to make it so that 180 can be interrupted. But I have no idea if this can even work in the old makers, so rather than improve the logic here, let's start with that.
That doesn't work for 2K
Not sure about 2k, but 2k3 has a Key Input Processing command (page 3) that can be used to check for various inputs, including move directions.
Not sure about 2k, but 2k3 has a Key Input Processing command (page 3) that can be used to check for various inputs, including move directions.
resim_2024-03-08_134110018.png

Yeah, but it is a bit differenent. (Took this image randomly from google by the way)
That doesn't work for 2K
k, that doesn't help.
You can provide more information such as "Thanks for taking the time for your suggestion, but it seems 2k doesn't have the conditional for button input. Is there a way to make this work?"


Anyways, good luck. I hope someone can help you.
k, that doesn't help.
You can provide more information such as "Thanks for taking the time for your suggestion, but it seems 2k doesn't have the conditional for button input. Is there a way to make this work?"


Anyways, good luck. I hope someone can help you.
Alright thanks anyway
Not sure about 2k, but 2k3 has a Key Input Processing command (page 3) that can be used to check for various inputs, including move directions.
It does. RM2K3 also added the ability to check for shift, which rm2k didn't have too.

The issue here is that it only detects when the key is first pressed, so it being on a continual loop wouldn't pick up if someone was holding a directional key down.

What you'd need to do is check the players x/y co-ordinates on a loop in a parallel process event, determine if they've changed within a certain number of checks, and then increase his movement speed if they have. You also can't set movement rate to a set value easily, so you also need a switch to tell the common event what their move speed should be (ie walking/running) and then don't turn up or down their speed if the switch for their current movement mode is on, that way they don't start rocketing across the map after running for a few tiles, or slow down to a snails pace when standing still for multiple seconds.

You'd also want some sort of a wait command in the loop, because without one it'd be checking multiple times per second, and the co-ordinates wouldn't be able to change that fast, so running would never happen. It'd take some guesswork to get the correct value.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-change-the-player-speed-after-enough-walking.166494/