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:
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!
[*]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.
[*]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.
[*]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:
While RPG Maker 2003's looks like this:
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!
本贴来自国际rpgmaker官方论坛作者:Topaz Light处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/one-and-done-run-button-tutorial-for-2000-and-2003.60912/
页:
[1]