By default, the game only allows you to move in the four orthogonal directions: up, left, down, right.
This script provides support for eight-directional movement in your game, adding support for diagonal movement. To move diagonally, hold down two direction keys simultaneously.
This script also adds support for eight-directional character sprites, allowing you to face the appropriate direction when you are moving diagonally.
Followers can use 8-dir sprites
Events can use 8-dir sprites. And of course, you can trigger events diagonally. If you have 8-directional vehicles, they are also supported.
Do you have large sprites? No problem, it supports large sprites as well.
If you just want to be able to move diagonally, you do not need diagonal sprites to use this script. They will simply walk diagonally using one of the orthogonal sprites.
Script: download here
Interested in how it is written? Read the dev log for this script!
- Part 1 – Introducing Diagonal Movement into RPG Maker
- Part 2 – Diagonal Movement and Character Interaction
- Part 3 – Diagonal Movement and Movement Speed
- Part 4 – Diagonal Movement and Large Sprites
In the script editor, place this script below Materials and above Main
In the configuration, you can choose whether you want to use diagonal sprites or not by setting the
Use_8Dir_Sprites option to true or false. If it’s true, then diagonal sprites will be used. If it’s false, they will not be used.
If you don’t use diagonal sprites, then you can still walk around diagonally, but the sprites will be facing one of the orthogonal directions.
Diagonal sprites require you to follow a specific sprite-sheet format. It assumes you are using the default 3×4 character format on a 12×8 character sheet. This means that if each sprite was 32×32 in size, then your image will be 384×256 in dimensions.
Adding Diagonal Sprites
A full character sheet for one character consists of the orthogonal directions as well as the diagonal directions. You will first place your orthogonal sprites onto the sheet, and then right beside it, place your diagonal sprites.
The sprite directions should be as follows (the index is for reference only assuming it is the first character on the sheet)
This means that you can have up to 4 characters per sheet, though I would recommend reserving one sheet per character set. Note that this example does not reflect how the full image appears; I have cropped it for clarity.
If you are using sprites that are larger than 32×32 (or smaller), those are also supported. As usual, you need to follow the same specifications. For example, if each sprite was 64×32, then you would have a 192×192 sheet for one set of animations, and then you need to expand that to a 768×256 sheet to meet the specifications.
If you’re having trouble with your sprites, read part 4 of the dev log to see how it works.
In the configuration, you can choose a specific switch to use to determine whether 8-dir movement is enabled. When the switch is ON, 8-dir movement is enabled. If the switch if OFF, then 8-dir movement is disabled.