Thread: Tutorials
View Single Post
 
Reply
Posted 2003-02-11, 01:32 PM in reply to "CRØNîC-KîLLå"'s post "Tutorials"
World Map

This is rather complicated, but it works fine when it's done. I'll assume you're using I-Draw Chara maker. (Otherwise, you'll have to convert all images into 256 color mode!) I'm also assuming that you import all images you make into your game using the RAW Material Editor.

---------------------------

First, some terms:

Square = The smallest unit you can edit, the map editor is made of squares (check the Event Layer for a grid!)

Screen = 20 x 15 squares, this is the screen size.

----------------------------

For the map:

Every square = 1 pixel.
Your character will be one pixel on the map, as well.

-----------------------------

For my example, I'll use an 80 x 60 square world map (4 screens by 4 screens, small but easy to convert.) That means that the map should be 80 x 60 pixels big. This is easy: Just take a screenshot at 1/8 zoom and crop/resize to the proper amount.

Also, create a 1x1 pixel image (Whatever color you think is appropriate, I would use yellow or white)

-----------------------------

Map position: Most likely you want it in the bottom left. On fullscreen mode, the screen is 320x240, with the bottom right as coordinates (319,239), using an (X, Y) numbering system.

Bottom left then would be (0, 239).

Images are placed with respect to the center of the image. With some simple math, the proper placement for my 80 x 60 map is at coordinates (45,204) since I'm using a 5 pixel separation from the sides of the screen.

Math to find bottom left placement:

((ImageSizeX / 2) + Border) -> X coordinate
(239 - (ImageSizeY / 2) - Border) -> Y coordinate

---

Top left of map (X=0, Y=0) is (4,173) -This is important! Just subtract half of the image size from each coordinate, then subtract 1.


------------------------

Now, you need to call it to see what it looks like. In the RPG map editor, put an event that automatically starts and switches itself to not start again.

The EVENT is using Show Picture.

Use Pic. Number 1, the picture you're using, and the proper coordinates. 35% Transparancy is good, too. Don't select Move With Map! Start your game and see if it looks right.

-------------------------

Okay, here's the tough part. Go into the Database and set up a new Common Event, call it Hero Map Position or something similar. Set it as a parallel process that activates when the World Map variable is on.

Variable names assumed are:
0001: Hero X
0002: Hero Y
0003: Hero Map (not used here)

Quote:
Events Commands:


<>Memorize Place:Map[0003], X[0001], Y[0002]
<>Change Var: Var[0001:Hero X] (+) 4
<>Change Var: Var[0002:Hero Y] (+) 173
<>Show Picture: ID:2-whitedot-(V[0001],V[0002])
<>
What you do, is add 4 to the X value and 173 to the Y value (that's the 0,0 image coordinates, remember?)

---------------------------------

Another Event is needed also:

Assuming this switch:
0081: World Map

Quote:
Name: Show Map
Event Start Condition: Call

Events Commands:

<>Show Picture: ID:1-World Map-(45,204)
<>Change Switch: Var[0081:World Map] Switch ON
<>
---------------------------------

And of course, when you're in a dungeon, or something..

Quote:
Name: Kill Map

Event Start Condition: Call
Events Commands:

<>Change Switch: Var[0081:World Map] Switch OFF
<>Erase Picture: ID:1
<>Erase Picture: ID:2
<>
----------------------------------

Now all you have to do is call the Show Map procedure on the world map! (Get rid of the other event used to test-call the map, you don't need it anymore!)

Put the event at (1,1) or somewhere out of the way.

Quote:
Name: AutoShowMap

Page 1:
Conditions: None
Event Start Condition: Auto Start
Position: Below Hero

Events Commands:

<>Call Event: Show Map
<>Change Switch: Var[0081:World Map] Switch ON
<>

Page 2:
Conditions: Switch (0081: World Map)
Event Start Condition: Push Key

Events Commands:

<>(NONE)
----------------------

Remember, you CAN edit your map, just keep it the same size!
With some forking, you can call the Show Map and set a variable to set up what map you want, and other cool stuff.

Hope that wasn't TOO difficult..

Last edited by BlueCube; 2003-02-12 at 11:22 AM.
Old
Profile PM WWW Search
BlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzBlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
BlueCube