Add some data into the $dataMap(MapXXX.json)

Status
Not open for further replies.

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,710
Reaction score
1,127
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi people!
I was searching in Rm Mv codes for this... but I can't understand how it is done.
I made a function that stores all coordinates of the map per region Id.
Region Id 1 - All coordinates that have region 1 on it.
Region Id 2... and so on.

But What I want to do is this to be stored in the MapXXX.json as static data.
How can I put this information inside the JSON file?
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
529
Reaction score
275
First Language
thai
Primarily Uses
RMMV
this is my newbie suggestion something may go wrong
why you want it in that place?
you can make a float variable in your plugin and call it any time any where
just make the name a little unique

reg_mapA = [[1,2],[3,4],[5,6]]
my_region_coordinate =[reg_mapA,reg_mapB]

these will static unless you change it
I stop using many base variable data when I access to make plugin
there like no point to rely every thing on them anymore
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
I wouldn't. I would put it in completely different files - something like Map001r.json, Map002r.json, etc.

The whopping issue with storing it in Map001.json is that the moment you change that map in the editor and save it, all of your additional stuff will disappear. Best not to touch the files that the engine creates and updates.

OR make your region variables within the Game_Map class, and clear & refresh it when the map is loaded. Then you don't need to save any files at all.
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
529
Reaction score
275
First Language
thai
Primarily Uses
RMMV
I wouldn't. I would put it in completely different files - something like Map001r.json, Map002r.json, etc.

The whopping issue with storing it in Map001.json is that the moment you change that map in the editor and save it, all of your additional stuff will disappear. Best not to touch the files that the engine creates and updates.

OR make your region variables within the Game_Map class, and clear & refresh it when the map is loaded. Then you don't need to save any files at all.
hi shaz
I'm curios if you know is there a tutorial about reading thing from .json file
without import it as plugin
now I kind of had a lot of it
I can't find one by myself
if not never mind
thank you
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
I have never looked for one. I just look at what the core scripts do, and do the same thing.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,710
Reaction score
1,127
First Language
Portuguese - Br
Primarily Uses
RMMZ
@pasunna @Shaz @ct_bolt Thank you for the answers!
But I end creating this in Game_Map, as Shaz said, there is no need for me to put this into a j.son file.
Thank you all for the answers :)
 

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,048
Messages
1,018,545
Members
137,834
Latest member
EverNoir
Top