I'm trying to make a system where the server uploads its custom map to the client, which will load it as soon as possible.
The upload part works, but when I replace Map005.json(and MapInfos.json) with the new files, the game throws the error "Cannot read property 'scrollType' of null". Trying to load a map not listed in the database(lets say, Map006.json) throws the same error. Not replacing MapInfos.json throws the same error too.
Image:
The files are fine, as I tested manually loading them by closing the game, changing the files to then open, and it worked. But I need a system that doesn't require the game to be closed.
My code for replacing the files is simply this:
So, how do I load a new map, which was not bundled with the game, without closing it?
The upload part works, but when I replace Map005.json(and MapInfos.json) with the new files, the game throws the error "Cannot read property 'scrollType' of null". Trying to load a map not listed in the database(lets say, Map006.json) throws the same error. Not replacing MapInfos.json throws the same error too.
Image:
The files are fine, as I tested manually loading them by closing the game, changing the files to then open, and it worked. But I need a system that doesn't require the game to be closed.
My code for replacing the files is simply this:
Code:
fs.copyFileSync('./www/temp/Map005.json', './www/data/Map005.json')
fs.copyFileSync('./www/temp/MapInfos.json', './www/data/MapInfos.json')
$gamePlayer.reserveTransfer(5,5,5,2,2);
$gameTemp.reserveCommonEvent(6)
So, how do I load a new map, which was not bundled with the game, without closing it?