[Event Tut] Creating a functional Mini-Map [VX][Difficulty: Intermediate]

0 Members and 1 Guest are viewing this topic.

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
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:
  • Color detail Mini-map
  • Mini-map IS what map you're on
  • Can change the cursor color
  • Can change the Mini-map's opacity
  • Can change the Cursor's opacity
  • Each map has it's own unique Mini-map
  • Can turn it on and off easily
Cons:
  • Need a ton of screenshot images for high map quantity games
  • Can sometimes be a little small


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


SCREENSHOT:
Spoiler for:



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.





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.



  • 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!?

        - ->     <--

  • 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]




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



  • 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]




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



  • [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



  • 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]




STEP III:
Spoiler for:

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



  • 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"



  • [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



  • 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



  • 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"




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




STEP II:
Spoiler for:

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



  • 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]




STEP III:
Spoiler for:

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



  • 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"




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




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)
Mirror 2 (Mediafire)


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!
« Last Edit: January 25, 2010, 12:41:56 AM by grafikal »

********
Shadow Knight
Rep:
Level 91
Ruin that brick wall!
Project of the Month winner for October 2008
Whoa, downloading demo.
Be kind, everyone you meet is fighting a hard battle.

****
Hey... my name's... Sashikinaroji...
Rep:
Level 83
fear me...
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...)
Ok, DON'T EXPECT HELP FROM ME~! I will perhaps rant a bit, but don't expect me to do graphics for you, even if I say I will... I won't.

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best RPG Maker User (Scripting)2011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best Use of Avatar and Signature Space2010 Favourite Staff Member2010 Most Mature Member
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]

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
uploaded the demo to a new site as well. sooo... there's 2 downloads now

****
Hey... my name's... Sashikinaroji...
Rep:
Level 83
fear me...
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.
Ok, DON'T EXPECT HELP FROM ME~! I will perhaps rant a bit, but don't expect me to do graphics for you, even if I say I will... I won't.

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best RPG Maker User (Scripting)2011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best Use of Avatar and Signature Space2010 Favourite Staff Member2010 Most Mature Member
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.
« Last Edit: January 31, 2010, 12:55:24 AM by Modern Algebra »

**
Rep: +0/-0Level 72
RMRK Junior
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?

****
Hey... my name's... Sashikinaroji...
Rep:
Level 83
fear me...
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.
Ok, DON'T EXPECT HELP FROM ME~! I will perhaps rant a bit, but don't expect me to do graphics for you, even if I say I will... I won't.

**
Rep: +0/-0Level 72
RMRK Junior
Okay, thanks! Just wanted to make sure.

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

Below is my Common Event:



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?

****
Hey... my name's... Sashikinaroji...
Rep:
Level 83
fear me...
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...
Ok, DON'T EXPECT HELP FROM ME~! I will perhaps rant a bit, but don't expect me to do graphics for you, even if I say I will... I won't.

**
Rep: +0/-0Level 72
RMRK Junior
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:



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!
« Last Edit: August 18, 2011, 06:02:29 PM by memberp »

****
Hey... my name's... Sashikinaroji...
Rep:
Level 83
fear me...
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.
Ok, DON'T EXPECT HELP FROM ME~! I will perhaps rant a bit, but don't expect me to do graphics for you, even if I say I will... I won't.