[RM2k(3)] - Moving hero 'step by step' with events.

Started by fataXX, February 20, 2015, 08:36:29 am

Previous topic - Next topic


At first - sorry for my english!

I know this is forum mainly for RMXP/VX, but i have problem in RM2k(3), so i have a problem to solve only using events.
How can i move hero only by one step with only once key pressed?
What i need: When i press ONLY ONCE "right key" on keyboard, hero will move ONLY ONE step to right. When i need two steps to right, i need press key twice. When i press and hold key pressed, hero must move only once and wait for next pressing key.

I'm fighting with "Key Input Processing" and still dont work :/

Please, give some hints. Thank you and once again - sorry for my english ;)


I can't exactly remember what the interface looked like. But I did a quick Google search and it seems like there are a number of solutions. One is to use an Event as your player object and turn your player object invisible and placed somewhere it can't move (surrounded by impassible tiles). Another was something about using a Move Event and putting in a 'Wait' to prevent moving until another button is triggered. And something else about using an auto-start event, though I'm not sure what they meant.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!


February 21, 2015, 06:32:14 am #2 Last Edit: February 21, 2015, 06:47:44 am by Ranquil
Make an event with Auto-Start, set any other conditions you want and put it somewhere on the map. Then, do something like this:

<>Label: 1 (We want this to go on a loop, so let's set a label here)
<>KeyInputProc: [GetKeyPress] (Set some variable to get only the arrow keys, also set to Wait Until Key Pressed)
<>Branch if Var [GetKeyPress] is 1 (Meaning down key pressed)
   <>Move Event: Hero, Move Down
   <>Variable Oper: [GetKeyPress] Set, 0 (This way the game thinks the key isn't pressed anymore and you have to press it again)
: End
<>Branch if Var [GetKeyPress] is 2 (Meaning left key pressed)
   <>Move Event: Hero, Move Left
   <>Variable Oper: [GetKeyPress] Set, 0
: End
<>Branch if Var [GetKeyPress] is 3 (Meaning right key pressed)
   <>Move Event: Hero, Move Right
   <>Variable Oper: [GetKeyPress] Set, 0
: End
<>Branch if Var [GetKeyPress] is 4 (Meaning up key pressed)
   <>Move Event: Hero, Move Up
   <>Variable Oper: [GetKeyPress] Set, 0
: End
<>Jump to Label: 1 (When we jump to the label, we go back to the beginning and button checking start again)

And there you go!
Just remember that this pretty much fucks everything else up because you can't check other events with Enter/Spacebar/Z or use Esc/Backspace/X/C/V/B/N to go to the menu during this because it's an Auto-Start event. That is, unless you use Paraller Process events to check stuff.

I hope this helped!
Quote from: Some guy on FacebookLife is like a penis. It's short but it feels so long when it gets hard.

Quote from: Steven WinterburnBefore you diagnose yourself with depression or low self-esteem, first make sure that you are not, in fact, just surrounded by assholes.