The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Tutorials => Topic started by: Grafikal on August 08, 2008, 01:41:16 PM

Title: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: Grafikal on August 08, 2008, 01:41:16 PM
Creating a Mini-Map in VX

TUTORIAL BY: Grafikal007
Precredit to: Kipe    [I couldn't of had converted this to VX without his XP tut for this.]


PURPOSE:
As the topic title suggests, this tutorial will teach you how to create a FULLY fuctional mini-map for your game.

Pros:
Cons:


[NOTE: YOU MUST FIX THE SCRIPT GAME_INTERPRETER FOR THIS TO WORK; THE DEMO INCLUDES THE FIXED SCRIPT]


SCREENSHOT:
Spoiler for:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg390.imageshack.us%2Fimg390%2F9949%2F444zr8.jpg&hash=c4edb5a1efe5c54ffeb6d457c1ff0f74e8f3b6cc)


PREREQUISITES:
STEP I:
Spoiler for:

Create 2 Variables:

  • Name the first variable:
Quote
Player X
  • Name the second variable:
Quote
Player Y


Create 2 Switches:

  • Name the first switch:
Quote
Cursor [or Cursor On]
  • Name the second switch:
Quote
MiniMap Off


STEP II:
Spoiler for:

  • Create and finish a map.
  • Zoom out to 1/8 view in the editor.

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg253.imageshack.us%2Fimg253%2F4407%2Fscreenshot1di8.png&hash=a6623422f7f2d00203c08b745e48a990400594e0)



STEP III:
Spoiler for:

  • Take a screenshot of your map from the editor's view.
  • Crop the image using an image editing program like MSPaint.

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg518.imageshack.us%2Fimg518%2F8172%2Fmap1bc7.png&hash=149310f172774d65206073089fd942142e8be93f)

  • Save this image as something you will recognize as THIS map.


STEP IV:
Spoiler for:

  • Open an image editing program. [I prefer MSPaint for this.]
  • Create an image that is 2x2 pixels.
  • Color it any color you want that you think will stand out most against your maps.

        It's there. Can you see it!?

        - ->   (https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg291.imageshack.us%2Fimg291%2F7509%2Fcursorcv7.png&hash=75c9ab11f1c3c6e549263ac42e14b7670fbbcaf1)   <--

  • Save that cursor image as:
Quote
Cursor.png


STEP V:
Spoiler for:

  • Open your game editor
  • Open the resource editor
  • Select the folder:
Quote
Graphics/Pictures
  • Import your newly created map and cursor  [NOTE: You'll need to import all of your map screenshots and designate each 'in-game' map with the corresponding image]

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg230.imageshack.us%2Fimg230%2F884%2Fscreenshot2ll2.png&hash=a923e0d993b09a266d91e685d63186d748cb3596)


STEP VI:
Spoiler for:

  • When you import images anywhere, you'll be given the option to choose 2 colors; One is full transparency and the other is semi-transparency
  • When selecting the transparencies for your maps, leave them both black by selecting
    by each box

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg386.imageshack.us%2Fimg386%2F6613%2Fscreenshot3kq6.png&hash=220978e0279dc94e615f6f5daa76769c26a44565)

  • When selecting the transparencies for your cursor, zoom in using the x4 zoom tool in the upper right hand corner
  • Leave the full-transparency black;
    it
  • Right-click on the cursor to make it semi-transparent [NOTE: This is optional whether you want the cursor to be slightly transparent or fully opaque]

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg530.imageshack.us%2Fimg530%2F9761%2Fscreenshot4ga9.png&hash=3d74312efe8be334703b22cdd9b6a728d2d373f1)


THE MEAT:
STEP I:
Spoiler for:

  • Open your Database
  • Select the Common Events tab
  • Create a new Common Event
  • Name it:
Quote
Cursor
  • Select its trigger as a [Parallel Process]
  • Select your "Cursor" switch that you created earlier for your condition switch here

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg511.imageshack.us%2Fimg511%2F5329%2Fscreenshot5km9.png&hash=1ded5f5e049f8ba6bcfc592ad8060c7c45ad0e35)

  • [NOTE: Use the above image as a reference if you run into trouble]


STEP II:
Spoiler for:
  • Create a new event command in this window pane
  • Select "Show Picture" from the Second Page tab

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg230.imageshack.us%2Fimg230%2F3176%2Fscreenshot13mc5.png&hash=44276684b152a20998d0973c6fdb3e43a3c372b0)

  • Select it's "Number" as "2"
  • Choose the "Picture Graphic" that you saved as "Cursor.png"
  • Check its "Display Postion / Origin" as "Center"
  • Check "Variable"
  • Select "X:" as your "Player X" variable that you created earlier
  • Select "Y:" as your "Player Y" variable that you created earlier
  • Keep "Blending / Opacity" at "255" [NOTE: If you did not change the cursor to semi-transparent when you first imported it, you can manually change it from this option]

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg154.imageshack.us%2Fimg154%2F2991%2Fscreenshot6df7.png&hash=80f79d33858169b271cea6b5aecc9d671e73d3d7)


STEP III:
Spoiler for:

  • Create a new event command in this window pane
  • Select "Control Variables..." from the First Page tab

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg291.imageshack.us%2Fimg291%2F9042%2Fscreenshot16lv8.png&hash=b16b4eebe26103d751c3c47384f4d46123aef612)

  • Check "Single"
  • Select the "Player X" variable that you created earlier
  • The "Operation" must be checked as "Set"
  • The "Operand" must be checked as "Character"
  • Select "Player" 's
  • Select "Map X"

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg144.imageshack.us%2Fimg144%2F6981%2Fscreenshot7ga7.png&hash=c924f05a3abfa3749d9fd0887f25112e862d2c80)

  • [Note:This sequence means that this variable is equal to your player's X coordinate on the map they are in]


STEP IV:
Spoiler for:

  • Create a new event command in this window pane
  • Select "Control Variables..." from the First Page tab

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg291.imageshack.us%2Fimg291%2F9042%2Fscreenshot16lv8.png&hash=b16b4eebe26103d751c3c47384f4d46123aef612)

  • Check "Single"
  • Select the "Player X" variable that you created earlier
  • The "Operation" must be checked as "Mul"
  • The "Operand" must be checked as "Constant"
  • Select "2"


STEP V:
Spoiler for:

  • Create a new event command in this window pane
  • Select "Control Variables..." from the First Page tab

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg291.imageshack.us%2Fimg291%2F9042%2Fscreenshot16lv8.png&hash=b16b4eebe26103d751c3c47384f4d46123aef612)

  • Check "Single"
  • Select the "Player X" variable that you created earlier
  • The "Operation" must be checked as "Add"
  • The "Operand" must be checked as "Constant"
  • Select "2"

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg520.imageshack.us%2Fimg520%2F6968%2Fscreenshot9rc5.png&hash=d8237d5cfcaa276c67ea095c4c07ab9846f2ee5b)


STEP VI:
Spoiler for:

  • Repeat Steps:

Quote
III through V
  • Any instance of X MUST be rewritten as Y:

Quote
Variable: Player X --> Player Y
Character: Map X --> Map Y
  • All "Operations" and "Operands" stay the same



MARKING THE MAPS:
STEP I:
Spoiler for:

  • Go back to the editor
  • Go to the Events editor
  • Right-click on the map and create a new Event
  • Name the event:
Quote
Minimap On
  • Set its "Priority" as:
Quote
Below Characters
  • Set its "Trigger" as:
Quote
Parallel Process

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg514.imageshack.us%2Fimg514%2F5718%2Fscreenshot10xz3.png&hash=f5e8c8f1281890245f62411202434d563695312a)


STEP II:
Spoiler for:

  • Create a new event command in this window pane
  • Select "Show Picture" from the Second Page tab

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg230.imageshack.us%2Fimg230%2F3176%2Fscreenshot13mc5.png&hash=44276684b152a20998d0973c6fdb3e43a3c372b0)

  • Select its "Number" as "1"
  • Choose the "Picture Graphic" that corresponds to your map; in this tutorial it is "Map1"
  • Check its "Display Postion / Origin" as "Upper Left"
  • Check "Constant"
  • Set "X:" as "2"
  • Set "Y:" as "2"
  • Under "Zoom / Width %", select "50"
  • Under "Zoom / Height %", select "50"
  • Keep "Blending / Opacity" at "255" [NOTE: You can change the opacity of the actual Mini-map here; Lower the number, the more transparent the Mini-map will]

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg169.imageshack.us%2Fimg169%2F5314%2Fscreenshot11zq7.png&hash=fd4107abeb6d31396f2bc115494c5ffaa3e35ece)


STEP III:
Spoiler for:

  • Create a new event command in this window pane
  • Select "Control Switches..." from the First Page tab

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg410.imageshack.us%2Fimg410%2F1571%2Fcontrolswitchkq0.jpg&hash=71d51da39299d38a2d9fa54ff22ee5a9573edddd)

  • Check "Single" and select the SAME switch you used in the Common Event's Condition Switch, which should be "Cursor"
  • The "Operation" must be checked "ON"

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg514.imageshack.us%2Fimg514%2F3837%2Fcontrolswitchpanepf6.png&hash=f6d8960dbb122d2c53794372fa2854c5f14a22d7)


STEP IV:
Spoiler for:

  • Create a NEW EVENT PAGE
  • On that new page, check either "Switch" under the "Conditions"
  • Leave the "List of Event Commands" empty

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg241.imageshack.us%2Fimg241%2F9634%2Fsecondeventpageaz2.jpg&hash=d91241bdb4592850f82f8e47a07a8b6267634dda)


STEP V:
Spoiler for:

  • Press "Ok" or "Apply" and close the event
  • Move the event anywhere on your map out of the way
  • Copy and Paste this event to every map that will use a Mini-Map; Change only the picture file that is displayed
  • Open the Demo to look at how the "Teleport" events are tweaked.
  • Test Play!  ;8


DOWNLOAD DEMO:
Spoiler for:

[NOTE: YOU MUST FIX THE SCRIPT GAME_INTERPRETER FOR THIS TO WORK; THE DEMO INCLUDES THE FIXED SCRIPT]

Mirror 1 (Sendspace) (http://www.sendspace.com/file/v4o6mf)
Mirror 2 (Mediafire) (http://www.mediafire.com/file/ltknz0jwt0x/Demo_MiniMap.exe)


CREDITS:
Spoiler for:

Kipe - His original XP Mini Map Tutorial
Grafikal007 - Modifications and Fixes included for VX conversion, and a freakin' awesome/organized Tutorial here  :P
Maia - For finding the VX Script variable errors
Modern Algebra - For Fixing the VX Script variable errors


[edit] WTB easier list tags!
Title: Re: [Event Tut] Creating a functional Mini-Map [VX]
Post by: Leventhan on August 09, 2008, 12:54:01 AM
Whoa, downloading demo.
Title: Re: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: Sashikinaroji on January 24, 2010, 11:57:39 PM
This is awesome, and I want to implement it in my game... However, I only have need for a "world map" and not an area map (as my world is quite large and my towns... not quite), but I just can't get it to work.

I have set everything up the same way, but I placed the variables to x and y on the main map as an parallel event rather than a common event (so that, theorhetically, they would only be calculated when the player is on the main map)

Is this precisely where I went wrong?

Also, for some reason, my RMXV won't play your demo so that I can check your codes/map functionality out... very annoying (I cannot even play it normally...)
Title: Re: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: modern algebra on January 25, 2010, 12:27:55 AM
Well, what's going wrong. And also, just in case you magically missed this:

Quote from: grafikal

[NOTE: YOU MUST FIX THE SCRIPT GAME_INTERPRETER FOR THIS TO WORK; THE DEMO INCLUDES THE FIXED SCRIPT]
Title: Re: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: Grafikal on January 25, 2010, 12:42:33 AM
uploaded the demo to a new site as well. sooo... there's 2 downloads now
Title: Re: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: Sashikinaroji on January 31, 2010, 12:08:10 AM
Well, what's going wrong. And also, just in case you magically missed this:

Quote from: grafikal

[NOTE: YOU MUST FIX THE SCRIPT GAME_INTERPRETER FOR THIS TO WORK; THE DEMO INCLUDES THE FIXED SCRIPT]
Well, what was going wrong is that the variables wouldn't adjust to make a moving blip. And also, just in case you magically missed this:

Quote from: Sashikinaroji
I have set everything up the same way

Hahah...


But, yeah... I ended up just getting rid of the event system and making a new switch so that it works by editing the variable while you are on the wold map, but not towns... The downfall of this is that, if you don't start the process (as I edited it for my game) before you enter a town, the blip won't show up until you leave the town... Which isn't a big loss...

Long story short, it is fixed, thank you both for your help.
Title: Re: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: modern algebra on January 31, 2010, 12:40:50 AM
Well, that's fine then if you're OK with it.

 But, just so you know, I did read that and assumed you were telling the truth, which is why I pointed the script error out, because it would be an easy error to make and has nothing to do with setting anything up incorrectly in the eventing. You could have set everything up completely correctly in terms of eventing and the exact error you described would occur unless you fixed the Game_Interpreter script, which would have required going into the Script Editor (F11) and replacing it. This is because by default, Game_Interpreter has a bug where when you try to multiply a variable by anything, then it will instead be set to equal what you wanted to multiply it by. This would result in the cursor always being at the position (2,2), which is the error you reported.

You'll have to forgive me for assuming that might be the problem given the fact that you had said you set the eventing up correctly. And I didn't mean "magically" in any way offensively - just that it was capitalized, gigantic, red, and moving across the screen.
Title: Re: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: memberp on August 13, 2011, 01:14:39 PM
I hope this isn't considered a necro, but I really need some help with this.

I just cannot seem to make this evented minimap work on my 480x360 World Map.

When I walk up or down the cursor doesn't move at all and when I walk from left to right or vice versa the cursor moves up or down.

Any pointers to what I could edit the formula to make it work?
Title: Re: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: Sashikinaroji on August 14, 2011, 04:35:57 AM
Asking for assistance does not constitute a necro. If it weren't for this, there wouldn't be anything we could do about this. So, never be afraid to post in a topic, no matter how old, if you need help with implementing it in your game...

So..

what it seems like is that there is an issue with your variables, if you don't have all the refs set up correctly, you'll end up with unexpected results... Any chance you could give us an idea of how you have your variables set up in both the event system and the script.

It would help enormously.
Title: Re: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: memberp on August 14, 2011, 08:18:17 AM
Okay, thanks! Just wanted to make sure.

Well, I pretty much copied everything from the demo as it was.

Below is my Common Event:

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg155.imageshack.us%2Fimg155%2F5666%2F61453806.png&hash=ce5ab339f4d576b2ba3a747515d59b130a5d223b)

The image for the minimap is rectangular rather than square (because my Map is rectangular as well)

And I didn't make any changes to the fixed game interpreter as I wouldn't have an idea what to change.

Anything else you need to know?
Title: Re: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: Sashikinaroji on August 14, 2011, 02:30:23 PM
You need the fixed game interpreter to make this work correctly. It is a download you can find pretty easily if you search it. Otherwise, this won't work.

Also, due to the fact that your dimensions and sizes are different, you need to tweak the equations... I know I had to tweak quite a bit on mine as well... There is really no way to check this except for guess and check though...
Title: Re: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: memberp on August 14, 2011, 03:36:39 PM
I already have the fixed game interpreter integrated. Any examples or estimations to what I could tweak the equations? I've tried a lot, but the result is always the same. On top of that I never even got the marker dot to move in the proper direction.

When I walk up/down the cursor doesn't move, when I walk left/right the cursor moves up/down. That just isn't right, lol.

EDIT: I fixed the problem described above - it had something to do with setting up some switches and variables wrong -

There's one issue though. I need to scale the minimap down a lot more. These are my current settings:

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg716.imageshack.us%2Fimg716%2F7726%2F95029280.png&hash=884dc03a8581aa89fd6a67daa08f00884506d871)

Even with all my variables down to 1, the scaling is still way too large. Unfortunately it doesn't seem possible to enter .1 or 0.1 or any variation that's < 1, which is what I really need. Does anybody know how I can still accomplish this?

EDIT #2:

I fixed it! It seems to be working fine for now. Thanks for the support!
Title: Re: [Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]
Post by: Sashikinaroji on August 20, 2011, 03:23:57 AM
Meh, I kinda forgot to get online, so didn't give much support, but either way, I'm happy you worked the problems out. For anyone having similar problems and intelligent enough to read through the topic to check if their problem was common, I have this advice.

1. the original event is tailored to his specific algorithm for the mini-map size. If you choose sizes arbitrarily (as I did), you will have issues, however, they can be fixed.

.     . 1a. sometimes, you may find that 1 isn't working as a minimum spacing difference. You can fix
.     .     . this by dividing 1 by any number you need. This will allow you to create fractions for your
.     .     . move speed.

.     . 1b. Your map's left most or top most point is not matching up with how your blip is placed. This
.     .     . can be fixed by figuring out how many pixels from the edge your map begins. This will be
.     .     . your new blip starting point. You can add this to your move speed (after it is calculated) to
.     .     . make sure you start and end in the correct positions on the map.

2. Always doublecheck that none of your variables or switches are used by any other function. You can change what does what in the event, but if you really want to plug and play, you will have to change any other event system that uses those variables and/or switches.