(note: if someone has a better term for this, please let me know and I'll change the header)
This is a simple event tutorial to help with making exits for wide open spaces acessable from a world map (example: forests, plains, etc.), among other uses. It removes the need to put dozens of events along the edge of the map. I hope it's easy to understand, it's my first tutorial.
Download Tutorial Project file (includes walkthrough game)
You need to have a basic understanding of Variables and the "Transfer Player" event.
Basic Transfers
First create two variables. Call them "TargetX" and "TargetY". These will be used to check where your character is on the map. X refers to the left-right location, while Y refers to the updown location.
Now to the map. We're going to pretend our map is 30 X 30.
When RMXP gets map coordinates, it starts with 0 instead of 1. This means our coordinates will range from 0,0 to 29,29. If your character is 5 squares to the right of the leftmost edge and 3 squares down from the top of the map, your coordinates would be "4,2".
Now we create a parallel process event to check for our location and to see if we're on the map's edge.
http://www.stkp.com/rpgmxp/tutorial/basic_edgeexits.jpg[/img]
We start by setting TargetX and TargetY to whatever our current coordinates are.
Next we use a conditional branch to see if we are on the top of the map (Is Y<=0). If it is, we ask if the player wants to leave the map. If they say yes, we transport them to the world map. If not, we have the player step away from the exit zone.
Then we do the same thing for the bottom of the map (Is Y>=29).
While it's not pictured, we do the same thing for the X values as well. Same principle, just with left and right.
And that's all there is to it.
Room to Room Transfers
This effect is good for puzzles or a more retro-feeling game where you go from screen to screen. I'm only going to do one edge for this example. What we're doing is transfering the character from area to area while keeping track of their position so that it looks like they're walking from room to room.
We need to create three more variables. MapX, MapY, and MapMap. These will be the variables we use when we use the Transfer Player option.
We're going to pretend our maps are 20 X 15, default size.
Once again, we create a parallel process event to check for our location and to see if we're on the map's edge.
http://www.stkp.com/rpgmxp/tutorial/roo ... eexits.jpg[/img]
We're only checking the leftmost edge of the map this time.
Again we start by setting TargetX and TargetY to whatever our current coordinates are. Then we check to see if the player is touching the leftmost edge.
Since we know our maps is 20 squares wide, and that the squares on x coordinate 19 are going to be used as our exit, we are going to want to transfer our character to the new map as far right as possible without triggering the exit. That means we send them to X coordinate 18; hence MapX=18
We want our character to be at the same up and down position when we cross the edge, so we make sure that MapY = our current Y coordinate.
And finally, the room next door is mapped on Map #5, so we set MapMap = 5
Now that we have our coordinates, we transfer the character to the next rooom. Use the same principles in the next room to make a way back.
And that's it. Hope it was helpful. :D
This is a simple event tutorial to help with making exits for wide open spaces acessable from a world map (example: forests, plains, etc.), among other uses. It removes the need to put dozens of events along the edge of the map. I hope it's easy to understand, it's my first tutorial.
Download Tutorial Project file (includes walkthrough game)
You need to have a basic understanding of Variables and the "Transfer Player" event.
Basic Transfers
First create two variables. Call them "TargetX" and "TargetY". These will be used to check where your character is on the map. X refers to the left-right location, while Y refers to the updown location.
Now to the map. We're going to pretend our map is 30 X 30.
When RMXP gets map coordinates, it starts with 0 instead of 1. This means our coordinates will range from 0,0 to 29,29. If your character is 5 squares to the right of the leftmost edge and 3 squares down from the top of the map, your coordinates would be "4,2".
Now we create a parallel process event to check for our location and to see if we're on the map's edge.
http://www.stkp.com/rpgmxp/tutorial/basic_edgeexits.jpg[/img]
We start by setting TargetX and TargetY to whatever our current coordinates are.
Next we use a conditional branch to see if we are on the top of the map (Is Y<=0). If it is, we ask if the player wants to leave the map. If they say yes, we transport them to the world map. If not, we have the player step away from the exit zone.
Then we do the same thing for the bottom of the map (Is Y>=29).
While it's not pictured, we do the same thing for the X values as well. Same principle, just with left and right.
And that's all there is to it.
Room to Room Transfers
This effect is good for puzzles or a more retro-feeling game where you go from screen to screen. I'm only going to do one edge for this example. What we're doing is transfering the character from area to area while keeping track of their position so that it looks like they're walking from room to room.
We need to create three more variables. MapX, MapY, and MapMap. These will be the variables we use when we use the Transfer Player option.
We're going to pretend our maps are 20 X 15, default size.
Once again, we create a parallel process event to check for our location and to see if we're on the map's edge.
http://www.stkp.com/rpgmxp/tutorial/roo ... eexits.jpg[/img]
We're only checking the leftmost edge of the map this time.
Again we start by setting TargetX and TargetY to whatever our current coordinates are. Then we check to see if the player is touching the leftmost edge.
Since we know our maps is 20 squares wide, and that the squares on x coordinate 19 are going to be used as our exit, we are going to want to transfer our character to the new map as far right as possible without triggering the exit. That means we send them to X coordinate 18; hence MapX=18
We want our character to be at the same up and down position when we cross the edge, so we make sure that MapY = our current Y coordinate.
And finally, the room next door is mapped on Map #5, so we set MapMap = 5
Now that we have our coordinates, we transfer the character to the next rooom. Use the same principles in the next room to make a way back.
And that's it. Hope it was helpful. :D