Map System Plugin

Status
Not open for further replies.

Nekohime1989

Nekohime
Veteran
Joined
May 31, 2014
Messages
498
Reaction score
227
First Language
English
Primarily Uses
RMMZ
My game has a map system quite similar to the Addams Family Values.

My maps are actually several maps stitched together. So this is why im adding a map system. A minimap I could care less about. But an actual big map that shows how these maps are stiched together is what would really help the player figure out where they are.
I plan to call this map in a common event from the main menu.
Here's the information that must be provided to the plugin dynamically (map notetags i guess?)
1, image to use for the map
2, x,y coordinates so I can display a icon so the player actually knows where they are in each said area.

Side notes: there is more then one map image (one per area). but as usual several maps share the same image. but each map has unique coordinates relative to their area.

Thanks in advance for your time reading this.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
You can't just use the Show Picture command?
 

Nekohime1989

Nekohime
Veteran
Joined
May 31, 2014
Messages
498
Reaction score
227
First Language
English
Primarily Uses
RMMZ
true that would work, only problem is since its a common event. it would be the same always be the same picture which is dynamic when you enter a new area (not a new map but a whole new area.)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
Not sure I understand. Are you saying one area consists of several maps, or that one map can be broken into several areas? You can still do it with Show Picture, using the current map id and maybe player's x and y coordinates (if it's several areas within one map).

You may need to be more clear in how the game maps and your drawn map relate.
 

Nekohime1989

Nekohime
Veteran
Joined
May 31, 2014
Messages
498
Reaction score
227
First Language
English
Primarily Uses
RMMZ
see the first post, the areas are several maps stitched together.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
And I still don't see why you can't do it with Show Picture. You're going to need to explain exactly what the problem is, because if a plugin IS needed, it's going to have to overcome that problem.

You can put the current map id into a variable, then use conditional branches to display the correct map based on the current map id. You can also add the "you are here" to the appropriate place based on the current map id.
 

Nekohime1989

Nekohime
Veteran
Joined
May 31, 2014
Messages
498
Reaction score
227
First Language
English
Primarily Uses
RMMZ
@Shaz
Now that I've had some time to think, let me explain this in a way that hopefully makes sense for everyone.
Standard event commands would result in a conditional tree with a unique condition for every map: this is a common event.
My guess is I'll have around 100 maps which will result in a messy conditional tree and that by its very nature is bad programming practice.

English is not my first language so i have trouble explaining complex concepts. sorry.
 
Last edited:

Levolpehh

Veteran
Veteran
Joined
Nov 17, 2018
Messages
86
Reaction score
78
First Language
English
Primarily Uses
RMMV
Lol.. you realize that's exactly how it'd work inside a plugin as well?
 

Nekohime1989

Nekohime
Veteran
Joined
May 31, 2014
Messages
498
Reaction score
227
First Language
English
Primarily Uses
RMMZ
Umm no. how do you figure? One uses a conditional tree, the other actually has its variables assigned by map note tags. :smile:
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
mmm ... you could use a common event but still use map note tags. That would actually be easier than writing a plugin. Instead of using the Show Picture event command, you would use a script call passing the arguments, with the picture name pulled from the note tags rather than hardcoding. Same for the "you are here!" image.

Working through an example ...

Let's say maps 1-10 all use the area map called "Castle".

You will have a Picture called Castle.png
You will also have a Picture called Locator.png
All pictures will have the origin in the top left corner, so your coordinates of the locator/pointer will be based on that position.

Let's say map 1 needs the locator to be pointing to 50,100 and map 2 needs the locator to be pointing to 80,300

In map 1's notebox, you could put:
<area:Castle>
<locatorX:50>
<locatorY:100>

In map 2's notebox, you could put:
<area:Castle>
<locatorX:80>
<locatorY:300>

(no spaces after the : in those)


These values can then be accessed via a script call with:
$dataMap.meta["area"]
$dataMap.meta["locatorX"]
$dataMap.meta["locatorY"]

(make sure to add the " around the name)

Now in the common event, just do a script call with the following command:
$gameScreen.showPicture(pictureId, name, origin, x, y, scaleX, scaleY, opacity, blendMode)

Inserting your values:
$gameScreen.showPicture(1, $dataMap.meta["area"], 0, 0, 0, 100, 100, 255, 0);
$gameScreen.showPicture(2, "Locator", 0, $dataMap.meta["locatorX"], $dataMap.meta["locatorY"], 100, 100, 255, 0);

When you want to get rid of the pictures, just use the Erase Picture event commands.


If you want the locator to be words instead of an arrow, and the words should be centred in the room, put 1 after "Locator" in the command, rather than 0, and it will centre it over those coordinates.

Try that, and if it doesn't work, show a screenshot of your map notes, a screenshot of your common event, a screenshot of what it looks like in the game when the common event runs, and attach the area and locator images that you're using.

I'll do this myself a bit later, just to make sure the commands are all okay.

You will just need to make sure, if there are any maps that don't have the notes set up, the player can't use the item to show the area map.
 
Last edited:

Nekohime1989

Nekohime
Veteran
Joined
May 31, 2014
Messages
498
Reaction score
227
First Language
English
Primarily Uses
RMMZ

It's freezing the game. Not sure if i messed up the common event somehow. Im calling it using yanflys menu manager if your curious.
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
I just tested this and made a few small corrections to the instructions above. If you get errors, please check in case you already did something and I then changed it.

Works quite nicely.
 

Nekohime1989

Nekohime
Veteran
Joined
May 31, 2014
Messages
498
Reaction score
227
First Language
English
Primarily Uses
RMMZ
Loading Error
Failed to load: img/pictures/ castle.png Which makes no sense cause thats the name of the image. (just working on a test game to make sure it works before adding to the actual game if that makes sense.)

works nicely, just got to remember no space after area: (is their a way to change that?)
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
Instead of looping, just show the pictures, do a Show Text at the bottom with a transparent background and no actual text, then erase the pictures. The game will show the small "pause" icon at the bottom of the screen then wait for input, then continue with the erase pictures.

If you MUST loop, put the Show Picture script above the loop - you don't need to execute that command every frame while you're waiting for input.

Your screenshot shows the errors that I discovered and fixed - using $dataMap.data instead of $dataMap.meta, putting spaces after the : in the map notes, and not putting quotes around the "variable" names.

You might be able to cater for spaces by doing $dataMap.meta["area"].trim()
 

Nekohime1989

Nekohime
Veteran
Joined
May 31, 2014
Messages
498
Reaction score
227
First Language
English
Primarily Uses
RMMZ
Every works as expected thank you for your help Shaz, much appreciated.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,381
Reaction score
8,537
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,551
Members
137,837
Latest member
Dabi
Top