Help with DataManager.loadMapData?

Poppie360

chocobo wrangler
Veteran
Joined
Feb 28, 2018
Messages
180
Reaction score
54
First Language
English
Primarily Uses
RMMV
So i have been messing around with how MV loads map files, i have come across various functions relating to how map files are loaded, however when trying to make it so the function operates through custom file paths it doesn't work;



(map016.json exists, and can be acessed through normal transitions.)

Anyone have any ideas of how to actually do this?
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
So i have been messing around with how MV loads map files, i have come across various functions relating to how map files are loaded, however when trying to make it so the function operates through custom file paths it doesn't work;[/SPOILER]

Anyone have any ideas of how to actually do this?
Not exactly sure what you're in search of but I have created a plugin that might help you figure out what you need...

CT_Bolt Read Map Data: Click Here To Download (Current Version 1.1)

Does that help at all?
...Let me know. Hope that helps. :)

Edit:
Ohhh... I think I understand now... you're trying to actually load the mapdata of a different map filename when loading a map?
Eg. Player goes to Map001.json but really could be even something like MapSpecial999.json?
Did I get this correct?
 
Last edited:

Poppie360

chocobo wrangler
Veteran
Joined
Feb 28, 2018
Messages
180
Reaction score
54
First Language
English
Primarily Uses
RMMV
Not exactly sure what you're in search of but I have created a plugin that might help you figure out what you need...

CT_Bolt Read Map Data: Click Here To Download (Current Version 1.1)

Does that help at all?
...Let me know. Hope that helps. :)

Edit:
Ohhh... I think I understand now... you're trying to actually load the mapdata of a different map filename when loading a map?
Eg. Player goes to Map001.json but really could be even something like MapSpecial999.json?
Did I get this correct?
That's close to what i am trying to do! Basically what i would like is the following

Lets say that we have a CoolMap.json (great name i know) in a project folder called "Mods/maps/"
I am trying to make it so that we load that map instead of the normal way of loading Map001.json from the "data/" folder.

Edit;
And by load...I mean like, load a new map. Not sure how to describe it well but you know how in events you can transfer the player between maps? Like that.

I havent been able to really figure out how to do it as i am not really familar with the core functions of the engine and whatnot. the scene_map has a lot of functions although i am not sure how it handles switching the maps the player is in.
 
Last edited:

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
***********************
* poof * tada! * poof *
***********************

Updated to v2.0... so many new features it's hard to list them all... see demo :)
Code:
****************** How to Use ***********************
**** Map Notetags:

      Example #1:
         <MapPath: 'custom data'/>
         <MapFile: 'WorldMap'/>
         <MapId: 1/>

         The above would load the following map file: './custom data/WorldMap001.json'
      Example #2:
         <MapId: $gameVariables ? ($gameVariables.value(1) > 0) ? $gameVariables.value(1) : 4 : 4/>
         The above uses GameVariable #1. This would load the following map file:
         If the gamevariable is not set or less then 1: './data/Map004.json'
         If the gamevariable is set is will use GameVariable #1: './data/Map***.json'
            ("***" is the value of GameVariable #1)
            Example GameVariable #1 is set to 92: './data/Map092.json'

**** Plugin Command(s):

      "ReloadMap" or "Reload Map" (no quotes)
      Notes: This is default command, can be changed via plugin parameters)
             Plugin Command for reloading a Map is can be changed in the plugin parameters via plugin manager.

See demo for more information.
CT_Bolt's MapData Plugin Demo: v2.0: Click Here to Download/View

Let me know whatcha think... hopefully that helps. :)
 
Last edited:

Poppie360

chocobo wrangler
Veteran
Joined
Feb 28, 2018
Messages
180
Reaction score
54
First Language
English
Primarily Uses
RMMV
***********************
* poof * tada! * poof *
***********************

Updated to v2.0... so many new features it's hard to list them all... see demo :)
Code:
****************** How to Use ***********************
**** Map Notetags:

      Example #1:
         <MapPath: 'custom data'/>
         <MapFile: 'WorldMap'/>
         <MapId: 1/>

         The above would load the following map file: './custom data/WorldMap001.json'
      Example #2:
         <MapId: $gameVariables ? ($gameVariables.value(1) > 0) ? $gameVariables.value(1) : 4 : 4/>
         The above uses GameVariable #1. This would load the following map file:
         If the gamevariable is not set or less then 1: './data/Map004.json'
         If the gamevariable is set is will use GameVariable #1: './data/Map***.json'
            ("***" is the value of GameVariable #1)
            Example GameVariable #1 is set to 92: './data/Map092.json'

**** Plugin Command(s):

      "ReloadMap" or "Reload Map" (no quotes)
      Notes: This is default command, can be changed via plugin parameters)
             Plugin Command for reloading a Map is can be changed in the plugin parameters via plugin manager.

See demo for more information.
CT_Bolt's MapData Plugin Demo: v2.0: Click Here to Download/View

Let me know whatcha think... hopefully that helps. :)
I really appreciate that, it is exactly what i needed! I am not smart enough to do this black magic on my own. your help has been amazing.
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
I really appreciate that, it is exactly what i needed! I am not smart enough to do this black magic on my own. your help has been amazing.
lol no prob. Glad to Help.
May update this more as needed in the future.

Happy Game Making! :cutesmile:
 

Poppie360

chocobo wrangler
Veteran
Joined
Feb 28, 2018
Messages
180
Reaction score
54
First Language
English
Primarily Uses
RMMV
lol no prob. Glad to Help.
May update this more as needed in the future.

Happy Game Making! :cutesmile:
Wait so i may just be dumb, but i am having a little bit of a pickle, what would be the way to load the map by file path?

I tried Game_System.prototype.readMapData(1, 'custom data', 'WorldMap'); but it got a file not found error.

edit;
I figured out i was shoving things into the wrong place, however when using the loadmap function this happened;
 
Last edited:

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
lol no no no not like that silly :guffaw:

Updating this to be much more flexible and include extra features.

Check Out v2.1 (soon to be sold on itch.io, but you can have a sneak peek)

In this version the following is how to load a map on the fly using custom paths:
Map Notetag:
Code:
<MapPath: $mapDataInfoEx.path || 'data'/>
<MapFile: $mapDataInfoEx.file || 'Map'/>
<MapId: $mapDataInfoEx.id || 1/>
Then simply changing the variable "$mapDataInfoEx.path" will change the directory path :)
After call the load map plugin command.
Plugin Command:
load map id x y direction fade

Example(s) (without the quotes though):
"load map" this will simple reload the map
"load map 0 gamePlayer.x+5 0 0 1" this will reload the current map but place the player 5 over to the right and fade out white
"load map 6 0 0 0 0" this will load the map 6 (editor 6 not custom 6) and fade out black

Which is also a script call if needed.

1578514883640.png
More can be viewed in the demo.
Donations are welcome, but not necessary. :)

Hope that helps... I know this is a bit confusing still... I'm gonna get it much more user friendly hopefully soon. :)
 

Poppie360

chocobo wrangler
Veteran
Joined
Feb 28, 2018
Messages
180
Reaction score
54
First Language
English
Primarily Uses
RMMV
lol no no no not like that silly :guffaw:

Updating this to be much more flexible and include extra features.

Check Out v2.1 (soon to be sold on itch.io, but you can have a sneak peek)

In this version the following is how to load a map on the fly using custom paths:
Map Notetag:
Code:
<MapPath: $mapDataInfoEx.path || 'data'/>
<MapFile: $mapDataInfoEx.file || 'Map'/>
<MapId: $mapDataInfoEx.id || 1/>
Then simply changing the variable "$mapDataInfoEx.path" will change the directory path :)
After call the load map plugin command.
Plugin Command:
load map id x y direction fade

Example(s) (without the quotes though):
"load map" this will simple reload the map
"load map 0 gamePlayer.x+5 0 0 1" this will reload the current map but place the player 5 over to the right and fade out white
"load map 6 0 0 0 0" this will load the map 6 (editor 6 not custom 6) and fade out black

Which is also a script call if needed.

More can be viewed in the demo.
Donations are welcome, but not necessary. :)

Hope that helps... I know this is a bit confusing still... I'm gonna get it much more user friendly hopefully soon. :)
I really dont know how to thank you! however when i get the chance i will donate to you as hopefully a way to do just that! You are a great help around here.
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
I really dont know how to thank you! however when i get the chance i will donate to you as hopefully a way to do just that! You are a great help around here.
Aww no prob.
Thank you for your kind words.

I do what I can. :blush:
Always happy to help :cutesmile::thumbsup-right:
Hope your game dev. is going smooth and your sky's are brightened with the purest of light :)

Let me know if you need anything else, I'll be around ;)

Ps.
Sorry forgot to follow up and reply... (thought I did a while back... woops :guffaw: :blush:).
 

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

Latest Threads

Latest Profile Posts


My only regret is the portal mirror effect is too subtle to show up in these GIFs. It probably just needs more sparkles. :LZSwink:
Microsoft: Hey, let's waste money advertising the Xbox Series X when nobody has any in stock, we don't seem to be making more, we aren't taking preorders and you can't get on a waiting list. BEST. IDEA. EVER.
So I'm practicing ITC with a spirit box, and decide to try to contact my deceased soulmate. It actually gave me multiple identifiers. Me, still a bit skeptical, asked aloud "Fine but does he still love me?" and the box spoke and printed the word "Forever" at the same time. Been a mess of tears since. :kaocry:
Been scratching away at my game and making progress, but just had a revelation. I'm working in full screen and adjusting all my pictures accordingly, but will they resize if someone's screen is smaller?? I hope this doesn't turn out to be a problem later.

Forum statistics

Threads
105,635
Messages
1,015,165
Members
137,305
Latest member
SasquatchWizard
Top