Gw Temp

Menu

Tutorial - 'Simple diagonal movement for your RPG' by Piggy

An item about RPGMaker 2000 posted on

Blurb

A nice tutorial that covers eight-direction movement and how to implement it.

Body

here's a tutorial for you newbies out there who want to put something cool in your game, even if you're experienced this still adds a nice kick to your game. What this is all about is showing you how to make your hero move in 8 directions instead of 4. BTW, this only works with rm2k3. here we go:

First go to common events.

Do a key input proccessing (do not wait unil key pressed, check number keys)

Conditional branch/Fork (variable X equal to 11 [or whatever key you want, 12 for the 2 key, 13 for the 3 key, and so on.] add Execute custom.. whatever it says/else handler)

Inside the branch/fork do Move Event (hero, Frequency-8, move up/left, do not repeat pattern, ignore if cant be moved)

COMPLICATED: copy the entire branch/fork, then paste it into the Else Handler of the original fork. Then paste into the Else Handler of the new fork, then again into the newer fork.


by now the script should look something like this:

<>Key Input Proc: [0000: whatever variable your heart desires]
<>Branch if Var [0000: whatever variable your heart desires] is 11
__<>Move Event: Hero, Move Up/Left
__<>
__Else Handler
__<>Key Input Proc: [0000: whatever variable your heart desires]
__<>Branch if Var [0000: whatever variable your heart desires] is 11
____<>Move Event: Hero, Move Up/Left
____<>
____Else Handler
____<>Key Input Proc: [0000: whatever variable your heart desires]
____<>Branch if Var [0000: whatever variable your heart desires] is 11
______<>Move Event: Hero, Move Up/Left
______<>
______Else Handler
______<>Key Input Proc: [0000: whatever variable your heart desires]
______<>Branch if Var [0000: whatever variable your heart desires] is 11
________<>Move Event: Hero, Move Up/Left
________<>
________Else Handler
________<>
________End
______<>
______End
____<>
____End
__<>
__End

ok, so now we see a whole bunch of forks that all look the same, but that's a bad thing. Therefore the next thing you have to do is:

Go to the second 11 and change it to 12 (if you changed the keys change it to the next higher up)
Go to the third 11 and change it to 13
Go to the fourth 11 and change it to 14

Then you have to change all the directions, because you dont want to go in the same direction all the time, unless your a sick freak

Go to the second Move Up/Left and change it to Up/Right
Go to the third Move Up/Left and change it to Down/Left
Go to the fourth Move Up/Left and change it to Down/Right

Now your event should look like this:

<>Key Input Proc: [0000: whatever variable your heart desires]
<>Branch if Var [0000: whatever variable your heart desires] is 11
__<>Move Event: Hero, Move Up/Left
__<>
__Else Handler
__<>Key Input Proc: [0000: whatever variable your heart desires]
__<>Branch if Var [0000: whatever variable your heart desires] is 12
____<>Move Event: Hero, Move Up/Right
____<>
____Else Handler
____<>Key Input Proc: [0000: whatever variable your heart desires]
____<>Branch if Var [0000: whatever variable your heart desires] is 13
______<>Move Event: Hero, Move Down/Left
______<>
______Else Handler
______<>Key Input Proc: [0000: whatever variable your heart desires]
______<>Branch if Var [0000: whatever variable your heart desires] is 14
________<>Move Event: Hero, Move Down/Right
________<>
________Else Handler
________<>
________End
______<>
______End
____<>
____End
__<>
__End

Ok, now the script is done. But you may be thinking to yourself, "Piggy! You stupid asshole! These keys are set up all retarded style!" Well you'de be right. But I have a solution, actually two. 1: if you have a game pad for the computer like i do set your diagonal stick to something like:

1 ! 2
------
3 ! 4

2: if you use the keyboard (loser!) set the keys in the script like this:

up left--17
up right--19
down left--11
down right--13

I never tried solution 2, but hopefully it works. And that ladies and gentlemen is my very first tutorial.