A super simple, super short, tutorial on making a common event that will let the player hold a button down to run.

Setting up your game's controls.

The first thing to do, is open your project and go to debug mode (AKA playtest mode/ the green play button)
Once the title screen loads, press F1 to open a menu. Go to the keyboard tab.
You should see this:

 

Set each key to whatever you want it to do.
This is what each control does in a brand new project:
A = Nothing
B = Back, cancel, pause
C = Confirm, interact with events, etc.
X = Nothing
Y = Nothing
Z = Nothing
L/R = scroll through characters when in equipment or stats screen

 

Just set shift or something to one of the buttons that doesn't do anything, press OK, and close the game.


Making a switch triggered common event.

Next, go to the common events tab in the database and make a common event called run or something, set the trigger to parallel, and condition switch to the switch you want to use to enable running.

 

IMPORTANT: MAKE SURE TO TURN OFF THE SWITCH BEFORE USING AN EVENT TO MOVE THE PLAYER! THIS WILL CAUSE THE PROGRAM TO BE STUPID AND SKIP THE MOVE ROUTE ENTIRELY!


The conditional branch

Now go to the event commands, open the conditional branch menu, go to the 4th tab, click on the "button" check circle thing, and select the control/command thing you set shift or something to. (the button that makes the player run)


Changing the player's speed

Finally, set 2 move routes that will increase the player's speed to 1 higher than the default speed, and 1 that will decrease the player's speed to the default speed. This is why RMXP freaks out when you use a move route command on the player while this common event is active. The program is already processing a move route for the player. Many complications can be avoided by scripting this, but I have yet to figure out how to do that.

 

The final product:

Share


About the Author

Comments

4,468 Posts
2,484 Points

Polraudio  said 17th November 2013

very simple indeed. I usually have mine scripted to wait for user input.

1,923 Posts
2,504 Points

Bob423  said 17th November 2013

If I figure out how to script it, I may release a script for it and also start a part 2 of my scripting tutorial. Should be pretty easy actually.

Guest_rayday said 18th August 2016

I need help :/
I tried your tutorial, but I'm not getting it right somehow. I used the A button for shift and then went into common events. Then I made the event parallel triggered and made the condition switch. (I just named the switch I didn't add anything extra to it or was I supposed to?) Next I put in the condition branch and went straight to the buttons and chose A. I then went into the first bracket and entered my player speed to be set at 5, and I put 4 speed in the "else" bracket.
I tested it and it didn't work for some reason. What am I missing?

1,923 Posts
2,504 Points

Bob423  said 18th August 2016

Can you post a screenshot of your common events? If it looks exactly like it does in my screenshot, it could be a script you have. Regardless, I suggest looking through here http://www.gdunlimit...-to-rgss-part-2 It has a better version of this, but requires some simple scripting. You'll only need to follow the directions of the first section.

Quick Reply

Guest

Enter a username

Security check: What is 8 plus 2?