|Whenever you enter the world map your position will show up, and it'll
disappear when you enter a town or other area. Putting the start condition
on "Parallel Process" means that the entire event will repeat forever
until you're off that game map. |
You may have to tweak the colors and transparency to make sure you can actually see the display map. If in doubt as to whether the dispaly map is really there, try making a version of it with bright red and blue. Or temporarily make a section of your tiles snow and move so that the display map is over them, since the colors should show up better on white.
This works because of the variables. Setting the variables "MapCursorX" and "MapCursorY" to your Hero X- and Y-coordinates stores the row and column numbers of whatever tile the hero is standing on. These are used for the center position of the cursor. Since the display map is on the upper-left corner of the screen, the pixel row and column number in the display map is the same as the tile row and column number of the hero.
|Common events are events that can be called from (almost) anywhere in
the game. In this case, using your item "Map" will turn on the "UseMap"
switch. This switch starts the common event "Use Map." In this event, it
first clears the screen of any map pictures that are there. Then it will
flick the switch "ShowMap." Using the ON/OFF trigger setting means that
whenever this event is called, the switch ShowMap will be set to its
opposite: if it is currently ON, it will be switched OFF, and vice versa.
Then the event turns itself off by switching off "UseMap."|
Adding the switch condition "ShowMap" - ON to the event that displays the display map changes it so that it will only be shown if the Map item has been activated.
|Technically, the scale here is 1 x 1 pixels = n x n tiles, but since a pixel is a square anyway it's usually shown as 1 pixel = some number of tiles. Obviously, the number of tiles in the width or height of your game map must be divisible by whatever number you use for n, or else you're going to wind up with some fractions of pixels. For example, you can use 1x1 pixels = 2x2 tiles for a 200x200 tile map, but you can also use that scale for a 200x400 tile map and end up with a rectangle.|
|Technically, the scale here is 1 x 1 tiles = n x n pixels, but since a tile is a square anyway it's usually shown as 1 tile = some number of pixels. Obviously, the number of pixels in the width or height of your display map must be divisible by whatever number you use for n, or else you're going to wind up with fractions of tiles displayed. For example, you can use 1x1 tiles = 2x2 pixels for a 50x50 tile map to display it as a 100x100 pixel map.|
|These two options both use the fundamental concepts behind
In the first one, where 1 pixel = n x n tiles, you want it so that whenever the hero move n tiles, the display cursor will move 1 pixel. For example, in my 200x200 tile map, with a scale of 1 pixel = 2 x 2 tiles, I want the display cursor to move 1/2 (or 0.5) pixels whenever the hero moves 1 tile. This is why you add a "Change Variable" command that divides by n.
In the second one, where n x n pixels = 1 tile, you want it so that whenever the hero moves 1 tile, the display cursor will move n pixels. For example, in my 50x50 tile map, with a scale of 2 x 2 pixels = 1 tiles, I want the display cursor to move 1 pixel whenever my hero moves 1/2 (or 0.5) tiles. This is why you add the command that multiplies by n.
However, simply multiplying by n is not enough. This means that when you are at the tile in Row 1, Column 1, the cursor will be at the pixel in Row n Column n -- at the bottom-right corner of the tile's representation on the display map. To remedy this, you subtract half of the width of that square of pixels (ie, n/2) to put the cursor in the center.
|The addition operations to the variables MapCursorX and MapCursorY serve to shift the cursor over that number of pixels -- to the correct position on the screen. It's a lot of math here to get the positions right, but it works.|
|If your map didn't fit into the display even at 1/8 zoom, you'll
have to "stitch" it together from pieces.