One-and-Done Run Button Tutorial for 2000 and 2003!


Good news, everyone!
​




I've created a short, sweet, and simple run button setup that operates entirely via common events; all you need to do is set these common events up once, and you're good to go! This script has been tested in RPG Maker 2000 and RPG Maker 2003, and it works in both engines.


Additionally, I've observed in other run button scripts (at least, ones that I've created or used) that the player's speed kinda jumps back and forth between the "running" and "not running" speeds; I'm proud to say that this script has little to none of that!


On to the point of how to actually make this run button script...


First and foremost, you will need...

  • 3 Common Events
    (My names for these common events are "Detect Run Button", "Not Running", and "Running")
  • 1 Variable
    (My name for this variable is "Run Button")
  • 4 Switches
    (My names for these switches are "Not Running", "Running", "Only Accelerate Once", and "Only Decelerate Once")

Under each of these, I've listed my names for each Common Event, Variable, and Switch, but for your own projects, feel free to call them whatever works best for you! I'd definitely advise you to give them names that make it easy to tell at a glance what they're for, though.


Oh, and try to keep the Common Events and Switches adjacent to each other in their respective sections, as well! Don't want to have to go trekking all over the place to make any adjustments, modifications, or fixes you might want to implement, should the need arise.


Once you've got your Common Events, Variable, and Switches named, it's time to get started actually setting things up!


So that you won't have to translate a bunch of text instructions into RPG Maker 2000/2003's scripting system, I've actually taken the liberty of taking some screenshots of my own setup to share with you all:


RPG Maker 2000-2003 Run Button Part 1.png


RPG Maker 2000-2003 Run Button Part 2.png


RPG Maker 2000-2003 Run Button Part 3.png


My version uses the Shift Key as the run button, which corresponds to a value of "7" for RPG Maker 2000/2003's Key Input Processing setup. You can substitute any button you'd like, if you'd rather use a different one, but be sure to adjust the variable value the event checks for accordingly! The numbers corresponding to each key are all listed in the Key Input Processing command window, so I won't be listing them here.


Oh, and, this probably stands to reason, but I'd strongly recommend against using the "Confirm" or "Cancel" keys for your run button. You could probably make "Cancel" work as your run button if you really wanted to for some reason, but that would require you to set up some other things to prevent the party menu from being opened by the "Cancel" keys as it usually is, and then of course you'd probably want to remap the party menu to another key or set of keys so that it's still accessible, and that just opens up a whole other can of worms I don't really wanna get into here, so don't use "Cancel" as your run button unless you're ready to do a bit of extra work.


Also, it's important to remember that the "Wait for Key Input" box should not be checked when implementing the "Key Input Processing" command.


The default movement speed of the player character is 3, so you only need to put in three "Speed Down" commands to reset the speed before setting it to its new value, but be sure to set that for both the "Running" and "Not Running" events.


After this, make sure the number of "Speed Up" commands for the "Not Running" event is 2...


and that the number of "Speed Up" commands for the "Running" event is 3.


Setting things up this way will get you the version I've made here, where the player's normal movement speed is one speed slower than the engine's default, while the engine's default player movement speed is instead used as the running speed.


If you don't like this speed setup, though, don't worry; it's actually very easy to customize the speeds involved!

  1. Make sure the number of "Speed Ups" for the "Not Running" event matches the speed value you want to assign as the player's normal movement speed.
  2. Make sure the number of "Speed Ups" for the "Running" event matches the speed value you want to assign as the player's running movement speed.
  3. Make sure the number of "Speed Downs" for the both events is equal to or greater than the number of "Speed Ups" for the "Running" event.
  • Of course, make sure all "Speed Downs" are listed before any of the "Speed Ups" in both events! Otherwise, you'll end up with some very slow player movement, and you don't want that, do you?

Essentially, you want the number of "Speed Downs" in the common events to completely reset to player's speed from the highest value you're going to be setting it to. Having more "Speed Down" commands (like I do here in the second image) is perfectly alright, so long as they're all listed before the "Speed Up" commands, but having too few will completely mess up the speed adjustment and cause both speeds to gradually increase by one tick until the running speed is all the way up at 8, with the normal movement speed being however many ticks behind you originally set it to be. So, be mindful of that and make sure you have enough "Speed Down" commands in each event!


Additionally, because this tripped me up just a tiny bit when I was getting ready to test the script in RPG Maker 2000, I feel it's important to note that RPG Maker 2000 and RPG Maker 2003 have slightly different "Key Input Processing" command windows!


RPG Maker 2000's looks like this:


RPG Maker 2000-2003 Run Button Addendum 2.png


While RPG Maker 2003's looks like this:


RPG Maker 2000-2003 Run Button Addendum 1.png


So, while for the most part, you can just copy the Common Events from one engine and paste them in the other, you will need to go and look over the "Key Input Processing" command and make sure it's set up correctly if you do so. Also, unless you did this beforehand, you'll also probably need to go in and make sure the Variable and all the Switches being referenced are correct for the event, and fix those up as necessary.


!! IMPORTANT !!
​


There are two significant issues with this script that have been covered in the following posts. For the sake of convenience, completeness, and general professionalism, I will cover them here in the tutorial as well.
​

  • The first issue, called to my attention by SweetieAshe, is that Player Touch events will not trigger if the player presses or releases the selected Run Button key while moving onto the event's tile. I've found a solution to the issue, however, and it is quite simple:


    • Change the event's Priority to "Same as Characters".
    • Before any other commands in the event, place a command to set the switch enabling the Run Button to "Off". This is to prevent button input from screwing with what comes next.
    • You'll want to set two Set Move Route commands here; firstly, set a move route for the event itself consisting of a single "Through ON" command. Secondly, set a move route for the player consisting of a single "1 Step Forward" command. Make sure they're listed in that order!
    • If you want the event to be able to be activated again afterwards, follow this up with a "Through OFF" move route for the event after all other move routes passing through its tile have been concluded.
    • Finally, place a command setting the switch enabling the Run Button back to "On"... after any and all Set Move Routes you might want to use have concluded, of course!
    Voilà! You now have a fully-functioning Player Touch event that, as far as all but the most perceptive and RPG Maker-savvy of players are concerned, is set beneath (or above) the player character
  • The second issue, which I discovered on my own, is that the Run Button event can still be called when other events are underway, and it will abort any currently-ongoing "Set Move Route" sequences immediately when called, which could potentially result in very wonky positioning errors, especially in games that make use of very intricate cutscenes. There is a fully-functional fix for this one, though; apply a Condition Switch to the "Detect Run Button" event, and make sure to flip that switch "On" as soon as you want running to become available to the player. At the beginning of every event that uses any "Set Move Route" commands, set the switch to "Off", and don't reactivate it again until the event is over. This method has been tested and fixes the issue just fine, although it could become bothersome as it's something you have to remember to do for every single event that uses "Set Move Route" commands. You may also want to set up an event command template to reset the player character's movement to the normal speed, if that's something that's important to you or the event in question. I'm still in the process of investigating having that handled by calling a Common Event, but it seems to cause issues, so for the moment I wouldn't advise doing it that way.
    Incidentally, the Condition Switch for the Detect Run Button event can also be used in conjunction with the "reset movement speed" event commands to dictate the player's ability to run based on... pretty much any conditions you can work out how to program, which is pretty cool!



...And, there you go! This is the first tutorial I've ever really made, so I apologize if it's a bit of a mess, but I hope it's intelligible enough for people to be able to make use of it! Run buttons are such a common feature even in games contemporary with RPG Maker 2000/2003's development cycles that it's honestly a wonder to me that they didn't include a run button as part of the base controls in either engine, but hopefully, this tutorial will help game developers working with RPG Maker 2000/2003 include this much-loved control feature in their own games, with minimal effort!


If anybody has any comments, questions, or suggestions, about either the script itself or the tutorial, fire away! I'm happy to help however I can!
As a bit of an addendum to this tutorial (which is great btw!), there's a weird quirk of this particular style of player running that I've run into with my own coding of something like this. I guess I should explain what I mean...


There's two different ways you can go about getting the player to move faster or slower using a key - Toggle and Press. When a system is based on Toggle, the player hits the button once and the character accelerates. They hit the button again and they decelerate (or vice versa depending on the character's default starting speed). In this way, the player HAS to hit a button once to run and once to walk instead of holding down the button. You would need a Press style system in order to make it so the player needs to hold down the button in order to run and let go of it in order to walk.


Toggle systems, though clunky, allow for immediate acceleration and deceleration of the character. Press systems give a short but gradual increase and decrease of speed to the character. And this difference leads to a little trouble with events in RM2k3.


Through a little bit of testing, I've found that Press systems (like this one) will ignore Touched by Hero events that are on the bottom layer if, and only if, the player is accelerating or decelerating into the event. This means that the character needs to be going at a steady speed in order for a bottom layer touch event to actually trigger. When the player is just running or walking through an entire area, everything is fine, but if they press or let go of the button at a time when the character is crossing between tiles (one without the event into one with the event), then the Set Move Route seems to take precedence over the bottom layer event.


I'm still trying to figure out a good way to deal with this, as it makes it seem to an end user that there is no event there and therefore the game is "broken" in some way, but I haven't quite come up with anything. Press run systems are still great and a welcome addition to any 2k3 game. It's just dealing with this quirk that makes it a little unruly.
Thanks for the heads-up!


There's also another issue with this script that I've noticed, and that is that the button can still interfere with events that move the player character; if it's toggled while the movement is underway, the current movement command chain will be aborted starting from when the button is pressed, although the other parts of the event will proceed as normal as far as I can tell.


However! There is a way to prevent this from happening! Set a condition switch for the "Detect Run Button" Common Event, and obviously switch that to "on" starting when you want running to become available to the player. However, make sure to begin every event that will involve moving events around by setting that switch to "off" to deactivate the run button event and prevent it from interfering in the movement command chains while the event is underway. From there, it's easy enough to just set turning the switch back on as the final command of the event, and everything's hunky dory! You can obviously use this same switch to dictate when the player will and won't be able to run in gameplay, too; sort of like how the Generation III Pokémon games disallowed running indoors.
Yeah I had noticed that when I was fooling around with using ladders and such. It was "easily" fixable by just tapping the Shift key a few times, but it still made for some hilarious results including super speed and the player locking into one direction. Hadn't thought about using the "Can Run" switch to keep that from happening though, thanks! I ended up just disabling it but now I can re-enable it. Just gotta edit my ladder and jumping events probably!

!! BREAKING NEWS !!
​


I've found a solution to the issue of "Player Touch" events set either below or above the player being cancelable by pressing/releasing the run button as the player steps onto them!


The solution, in fact, is quite simple:

  1. Change the event's Priority to "Same as Characters".
  2. Before any other commands in the event, place a command to set the switch enabling the Run Button to "Off". This is to prevent button input from screwing with what comes next.
  3. You'll want to set two Set Move Route commands here; firstly, set a move route for the event itself consisting of a single "Through ON" command. Secondly, set a move route for the player consisting of a single "1 Step Forward" command. Make sure they're listed in that order!
  4. If you want the event to be able to be activated again afterwards, follow this up with a "Through OFF" move route for the event after all other move routes passing through its tile have concluded.
  5. Finally, place a command setting the switch enabling the Run Button back to "On"... after any and all Set Move Routes you might want to use have concluded, of course!

Voilà! You now have a fully-functioning Player Touch event that, as far as all but the most perceptive and RPG Maker-savvy of players are concerned, is set beneath (or above) the player character!
I know this was a while ago, but thanks so much for this.
(I literally made an account just to see the pictures and to thank you.)
Great Stuff!
I know this is a REALLY old post, but I found a much more efficient way to get a run key working. Just needs 1 common event, 1 switch and 1 variable.

Run in RPG Maker 2003.PNG



Code:
Key Input Processing: [0001:Run]
Conditional Branch: Variable [0001:Run] == 7
    Conditional Branch: Switch [0004:RUNNING] is ON
        
        Else
        Set Move Route: Player, Speed Up, Speed Up, Speed Up, Speed Up, Speed Up, Speed Down, Speed Down
        Control Switches: [0004RUNNING] = ON
    Branch End
    Else
    Conditional Branch: Switch [0004:RUNNING] is ON
        Set Move Route: Player, Speed Down, Speed Down, Speed Down, Speed Down, Speed Down, Speed Up, Speed Up
        Control Switches: [0004:RUNNING] = OFF
        
    Else
    
    Branch End
    
Branch End


The reason I have it increase the speed all the way then decrease it some for running is so that it will always go to the correct speed I want. So if you want to run faster, don't decrease the speed so much after increasing it. Or if you want the walking speed different, either don't add as many speed increases, or add more. Hopefully someone will find this helpful! (I found this thread but it seemed like too many steps and I knew there had to be a more efficient way).
this threads probaly dead but im interested in doing this event but have a faster walk speed but with a slow down button. having issues though.
this threads probaly dead but im interested in doing this event but have a faster walk speed but with a slow down button. having issues though.

Sorry for the year late response oops

You should be able to make that work by just setting up a Run Button the way I or KevinFrost outlined, then just swapping the Set Move Route commands. The reduction of speed all the way to zero has a purpose, and it's to make sure the speed is fully reset before adding to get it where you want it.

RPG Maker 2003 sadly doesn't have a "set equal" command for movement speed, so this is the closest there is unless you want to be meticulously keeping track of every single time in the game you change the player's movement speed and accounting for what it might be in conditional branches every time that comes up.

Best of luck! ...Assuming you haven't solved it already.

Original thread: https://forums.rpgmakerweb.com/threads/one-and-done-run-button-tutorial-for-2000-and-2003.60912/