Hi,
In RGSS3 there was the possibility to get informations like height and width of non-active maps, by storing "load_data(sprintf("Data/Map%03d.rvdata2", mapid))" into a variable.
In MV, I can't seem to find a way to check height and width of a specific map that is not the current map. Any ideas?
thanks
DataManager.loadFile(NAME OF VARIABLE, FILENAME)
Example: DataManager.loadFile('map1Data', 'Map001.json');
You can then do map1Data.width or map1Data.height
While that will work, it will make a global variable that anyone can see and edit. This is generally frowned upon, so only do this if you know what you're doing.
Looks like if you use the function DataManager.loadMapData(mapId), it will overwrite $dataMap with the map you provide it. Normally I'd say this would be a terrible idea, but since you're transferring the player to that map anyway, it might work out just fine? (Disclaimer: I'm new to JS and MV, too...)
So I think it would look like this:
var newmapid = eval(transinfo[0]); //this is a line you already have
DataManager.loadMapData(newmapid); // this is the line I'm suggesting you add, then just let the rest of the code go as-is
Awesome, I think that is the right approach. For some reason, it doesn't instantly make width/height available, though. If I just put in the new line, it gives me this error:
"Cannot read property 'width' of null"
Maybe I need to refresh something? I have trouble finding a reference point for that stuff.
Thanks. I think that I understand the idea and I will try to implement that tomorrow.
Should I put all of it inside of my method or wouldn't it be better to create new methods in DataManager or Game_Player?
Ah, so you were basically doing Zelda-style map transitions. Neat.
Nice, I really like those transitions. I love Zelda!. I'm glad I could be a part of this re-creation and I'm glad I could help. It may seem like a complex solution but most of the complex stuff is getting around JavaScripts single threaded nature. Anyways, good luck, can't wait to see the final results.