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

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?
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
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.
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
I have never looked for one. I just look at what the core scripts do, and do the same thing.
Might be helpful... not sure though... at least get an idea maybe from it?
@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 🙂

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.

Original thread: https://forums.rpgmakerweb.com/threads/add-some-data-into-the-datamap-mapxxx-json.119076/