Original Source
- Original title: Making a Legend of Zelda / Final Fantasy Style Hybrid.
- Original author: GBJackson
- Original date: February 21, 2020
- Source thread: https://forums.rpgmakerweb.com/threads/making-a-legend-of-zelda-final-fantasy-style-hybrid.118448/
- Source forum path: Game Development Engines > RPG Maker Tutorials > RMMV Tutorials
Summary
If you wish to view this tutorial series offline, I am also making it available as a PDF..This file will be updated as new chapters are posted, so the newest revision will always be available. Images in this post are contained in spoilers due to overall length A shout-out to MushroomCake28 for advice on improving post quality. IntroductionTwo of the games that I remember most from my childhood are the original Legend of Zelda for the NES, and Final Fantasy II for the SNES. And while the latter has been...
Archived First Post
Images in this post are contained in spoilers due to overall length
A shout-out to MushroomCake28 for advice on improving post quality.
Introduction
The Navigation System
The First thing you want to do, obviously, is create a new RPG Maker Project.
Name it whatever you want.
Go to a fine restaurant and have a three-course meal while the files copy.
When you get back, you should be ready to begin.
The navigation system will use one single parallel event to manage player transfers between maps that are meant to be adjacent to each other. This will be achieved through the use of region Ids. I use regions 2, 3, 4 and 5 to represent North, West, East and South, respectively. Select the R tab under the tileset and paint in these regions like so:
This map now has what is needed to handle the player transfers. Now all we have to do is set up the Parallel event that will manage the process. In Event Mode, double-click on the top left tile to create a new event, and name it NavSys.
Make sure that Priority is set to Below Characters, and that Trigger is set to Parallel.
For those new to Event design, This means that the event will be below the characters in the game and so will not block player movement, and that this event will run constantly as long as the player is in the same map with it. This allows it to do its thing behind the scenes and the player won't even be aware of its existence.
A word of advice when setting up Parallel events. While they allow some pretty powerful stuff to be done, you do not want to have a whole bunch of them running at any given time, as when added to the global events that run constantly game-wide, and interactive events, they could cause the game to run slow. All active events run once every frame. By default there are 60 frames per second. Too many parallel events running could push the frame rate down, so just be mindful of that.
One other thing you need to know about events: The order they are processed is based on their ID value, from lowest to highest:
For this project, it is very important that NavSys is the first parallel event that is placed on a map. The reason being that some of the data it will generate may need to be called by other parallel event at the moment the player enters the map. If those events were to be processed first, they would not be getting the most updated information and their process could break. So even if all of the coding for all events is 100% correct, especially for parallel events, not having them run in the right order could cause undesirable issues. Knowing this little tidbit early on may save you a lot of debugging later on. I learned it the hard way. So when it comes to event processing, commit this concept to memory: First Placed, First Priority.
Now, let's get to the fun part.
Before we can make this event send a player to another map, it needs to know what maps are meant to be adjacent to the current one. We need to go ahead and set those up.
Right-click on the project root and then click New to create a new map.
Under General Settings, change the name of the map to “0 -1”
Really, you can name it whatever you want, but since we are going to be dealing with maps that will be the same size and will be occupying specific locations on an overall world map, it is useful to adopt a naming convention based on the individual map's X and Y coordinates. The maps themselves can be renamed later, if desired.
Like events, Maps have an ID number. It stays the same, no matter how many times you rename the map.
This is very important. The ID number can also be found at the very bottom of the RPG Maker MV program window. I advise making a note of map names and IDs for easy reference.
Now, Create three more maps, naming them -1 0, 1 0 and 0 1 respectively. While you are at it, Right-click on MAP001 and then click edit so you can go ahead and change its name to 0 0, for the sake of consistency.
So now you should have a total of five maps, all with a consistent naming convention.
Now let's edit their layout. You can make them look however you want, as long as they only have one exit as follows:
-1 0 East
1 0 West
0 1 North
I'm going the very simple route:
0 -1
-1 0:
1 0:
0 1:
I also went ahead and added the region IDs to only the borders that have exists, using the values we established for the first map. North border = 2, West border = 3, East Border = 4 and South Border = 5.
Also, go ahead and modify 0 0 to look like this:
In Event mode, Double-click on the NavSys event. We're ready to move forward with it.
The first thing we need to do is define the maps the exits link to. This is where the map IDs come into play. Double-click on the first line under Contents, or right-click on it and select New, to bring up the Event Commands window. Under Game Progression, click Control Variables...
This will bring up the Control Variables window.
We have not yet created any variables to control, so we will go ahead and do that now. Under Variable, make sure that Single is selected, and then click the button to the right, currently labeled 0001 with no name after it. This will bring up the Variable Selector window:
Selecting a variable and then entering a name will define the variable, so you can know what it is used for. One thing you need to know about this is that you can rename the variable all you want. The name itself doesn't matter. It is the ID number that all event scripting references when working with variables. I say this because if you plan to do a sequel to your game and you want to just copy and paste events, If you have already defined variables those events reference, then it is going to reference THOSE variables. This will require you to make sure that your new project has the variables defined and then you will have to go through your event script and select the correct variables. I ran into this issue when I copied the NavSys event from my experimentation project and pasted it into the actual work project. I just wanted to warn you about it in advance in case you do the same. An ounce of prevention is worth a pound of cure.
What you need to do now is define the first nine variables as follows:
Yes... there's a lot of stuff to set up. But once it is all in place, the completed NavSys event will just simply WORK. It can be copied and pasted onto any map in the same project, and the only thing you will need to change is the map ID numbers, for the maps that the exists will lead to.
Now that the above variables are defined, we can go ahead and do the event scripting.
Select nmap and click OK You will see that it is now showing up under Variable in the Control Variables window.
Under Operation, make sure that Set is selected.
This is for the adjacent map to the north, which we named 0 -1. This is why I advised making a note of the map names and their ID numbers. Under Operand, make sure that Constant is selected. In your notes, find the ID# for map 0 -1. If you've been following along exactly, it will be 002. Set that as the Constant value and click OK.
Now repeat the process for the other three maps. Once done, this should be what you have in the event script:
At this point, NavSys knows the ID numbers of the maps to reference when transferring the player. But it does not know how to reference them and when, and it also does not know how to determine if the player needs to be transferred. The next step is to make NavSys keep track of the player's position on the map, and the region ID at that location.
You will thank me for this later. The next line of code would do well to be a comment with dashes in it to serve as a script segment divider. You can put some descriptive text in if you want to. The important thing is being able to visually chop up the script so it is easy to identify the different segments. It is not mandatory, but I find it useful, and you may as well. So get to the Event Commands window, and under Flow Control, click Comment.
Now enter 80 dashes. Your script should now look like this:
Add another Control Variable command, and select pxpos as the Single Variable. With a Set Operation. But this time, instead of Constant, we are going to select Game Data as the Operand.
Map ID is the default. That information will be of use in a later chapter, but it is not what we are looking for at the moment. Click on it and select Character. There are two buttons next to this selection. The first needs to be Player, and the second needs to be Map X. Once these options are selected, click OK.
Operand should now look like this.
Click OK, and repeat the above step for the pypos variable, but select Map Y as the Player Game Data. The event script segment we are working on should now look like this:
Now we just need to get the Region ID info for the player's position.
Add a new Event Command. On Page 3, under Map, Click the Get Location Info button.
This brings up the Get Location Info window.
Variable is where the location information will be stored. Info type is the type of information to be obtained. Location can either be direct designation, or designation with varriables. The former will let you select a position on the current map, and the latter will use variables to designate the X and Y coordinate on the current map.
Set Variable to regid.Set Info Type to Region ID. Under Location, select Designation with variables. For X, select pxpos and for Y select pypos and then click OK.
Here is how the event script segment should look now:
At this point, NavSys knows the Map ID numbers the current map's exits will reference, and it knows how to get the player's current X and Y coordinates and the Region ID at those coordinates. But it still doesn't know what to do with this information. That's about to change. But first it's time for a little more explanation.
To approximate, Legend of Zelda's style, we make it so that the player moves around the gmeworld one screen at a time. By default, an RPG Maker MV map is 17x13 tiles in size. I have decided to stick with this size, as if played in full screen on a standard monitor, that size map fills the screen and will not scroll. To understand how the next part of this tutorial works, it is important to understand how the game defines X and Y coordinates on a map. For a 17x13 tile map, the left-most column of tiles is X=0. The top-most row of tiles is Y=0. The right-most column of tiles is X=16 and the bottom-most row of tiles is Y=12. So the Y value is greater towards the bottom and lesser towards the top, and the X value is greater towards the right and lesser towards the left. Keeping this information in mind will prove useful as we move forward.
Put a dividing line after the Get Location Info command. This will mark the start of the current segment, which will process player transfers to the designated map ID in the nmap vriable. When the player loads into nmap, the character will be at the bottom of the screen, 1 tile up, but in the same column they were in when leaving the first screen.
This can be achieved with just regular transfer player events, but you would need one for every tile along the edges of the map, each one pointing to a relative position along the edge of the opposite side of the screen in the new map. By using NavSys, we eliminate the need for so many events, and you only need to copy NavSys onto every new map and change the values for the nmap, wmap,emap and smap variables to the Map ID values of the maps that need to be loaded. So when we are done with this lesson, only 4 numbers need to be changed, and the rest of the process handles itself.
You won't need to place region IDs on map borders that will not lead anywhere else. And you don't have to place them on tiles that you know the player will not be able to enter. Furthermore, you can omit lines in NavSys for designating a map ID if you know that border of the map cannot go anywhere else, and the following segments can be omitted for the same reason. It all depends on how clean you want your script to be. Leaving these elements in, even if not needed, is not going to hurt anything.
So now you know about how a map's X and Y coordinates are processed, and what we are aiming to accomplish in the next step. And I've given you some idea of what you can do without when working with this system.
Now, let's make the system work.
First, we need to check to see if the player is at the north border of the map. So we need to add a new Event Command. On Page 1, under Flow Control, click Conditional Branch...
A conditional branch is RPG Maker MV's way of saying “If something is this, then do that or else do something else.”
Let's look at the Conditional Branch window:
If you are new to all of this, I promise you that you will be using conditional branches a lot. Now that you know how they work, let's continue.
On Page 1, select Variable, set it to regid is equal to a Constant of 2
We want the game to transfer the player to map 0 -1 one row above the south border but in the same column. We need to add a Control Variable command, where the Variable is transx, the Operation is SET and the Operand is Variable pxpos. And then we want to click OK
Then we need another Control Variable command to set transy to a constant of 11. Remember, the bottom most row of tiles is Y=12, so the row above it is Y=11.
At this point, the current segment we are working on should look like this:
Now we need to transfer the player to the new map. Add a new Event Command below the control variable command for transy. On Page 2, under Movement, click Transfer Player...
Under Location, select Designation with variables, set ID to nmap, X to transx and Y to transy. Set Direction to Up. Leave Fade set to Black. Then Click OK.
Now, based on what you've learned so far, make the next three segments look like this:
Click OK to save the event.
If you test the game now, you can exit the start screen in any direction and you will arrive at the destination on the correct side of the screen but still in the same row if you went West or East, or in the same column if you went north or south... But... Now you can't go back the way you came. That's because the new maps don't have a NavSys parallel event running on them.
Create a new map from the project root. Name it Events. Don't do anything to it. Leave it completely empty. Now go to your map 0 0, right-click on the NavSys event and click Copy. Now go back to the Events map, right-click somewhere and then click Paste.
Double-click on the event to edit it. Change the values for nmap, wmap, emap and smap to 0. Leave everything else alone and click OK. Now you have a template event that you can copy into any new map, asign the correct map ID values, and the system will automatically work on that map. When designing maps to be adjacent to each other, take care that you do not put any kind of barrier in tiles that NavSys will send the player to, unless there is a gameplay/plot-related reason for doing so. You do not want the player to get stuck due to design mistakes.
This is how the complete NavSys template script should look:
◆Control Variables:#0002 wmap = 0
◆Control Variables:#0003 emap = 0
◆Control Variables:#0004 smap = 0
◆Comment:--------------------------------------------------------------------------------
◆Control Variables:#0005 pxpos = Map X of Player
◆Control Variables:#0006 pypos = Map Y of Player
◆Get Location Info:regid, Region ID, ({pxpos},{pypos})
◆Comment:--------------------------------------------------------------------------------
◆If:regid = 2
◆Control Variables:#0008 transx = pxpos
◆Control Variables:#0009 transy = 11
◆Transfer Player:{nmap} ({transx},{transy}) (Direction: Up)
◆
:End
◆Comment:--------------------------------------------------------------------------------
◆If:regid = 3
◆Control Variables:#0008 transx = 15
◆Control Variables:#0009 transy = pypos
◆Transfer Player:{wmap} ({transx},{transy}) (Direction: Left)
◆
:End
◆Comment:--------------------------------------------------------------------------------
◆If:regid = 4
◆Control Variables:#0008 transx = 1
◆Control Variables:#0009 transy = pypos
◆Transfer Player:{emap} ({transx},{transy}) (Direction: Right)
◆
:End
◆Comment:--------------------------------------------------------------------------------
◆If:regid = 5
◆Control Variables:#0008 transx = pxpos
◆Control Variables:#0009 transy = 1
◆Transfer Player:{smap} ({transx},{transy}) (Direction: Down)
◆
:End
The following is what the Map ID segment should look like on all 5 maps:
◆Control Variables:#0001 nmap = 2
◆Control Variables:#0002 wmap = 3
◆Control Variables:#0003 emap = 4
◆Control Variables:#0004 smap = 5
0 -1
◆Control Variables:#0001 nmap = 0
◆Control Variables:#0002 wmap = 0
◆Control Variables:#0003 emap = 0
◆Control Variables:#0004 smap = 1
-1 0
◆Control Variables:#0001 nmap = 0
◆Control Variables:#0002 wmap = 0
◆Control Variables:#0003 emap = 1
◆Control Variables:#0004 smap = 0
1 0
◆Control Variables:#0001 nmap = 0
◆Control Variables:#0002 wmap = 1
◆Control Variables:#0003 emap = 0
◆Control Variables:#0004 smap = 0
0 1
◆Control Variables:#0001 nmap = 1
◆Control Variables:#0002 wmap = 0
◆Control Variables:#0003 emap = 0
◆Control Variables:#0004 smap = 0
Edit - Images placed in spoilers due to post length. Fixed some spelling errors.
Continure to Chapter 2
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadCreator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...