Hello all,
I was just wondering if there is a way to change a map size via in game events? For example -
Player starts out on a map that is 32x32 - Once he unlocks the farming part of the map the map size would increase to 48x48.
So is there way we can change the map size via events or scripts? I could always make new maps for the area and transfer the player, but the idea I am working on is more along the line that they can keep expanding the map as they unlock different parts of it.
No, map's are read-only and can only be changed in the editor. You would need a plugin to change that.
And a game will begin to lag if the map is too large, so you might rethink your structure anyway and split the map - 48x48 is not critical yet, but if you keep adding then the game might get to the critical part and start to lag.
Well one thing you can do is create the biggest possible plot of land and then block it with various obstacles, like trees, fences, mountains etc. It's a rather natural method of restricting/expanding the territory, because hey, those new grounds have to come from somewhere. Set a number of obstacles to disappear after a value in a variable is reached and have the next batch of obstacles disappear when the value increases again and so forth.
Another thing you can do is create a black event block and copy it all around the perimeter of the available area. That way you give the illusion that the map ends there, even though you have already built all of the map. That method however, will devastate your fps, unless you have an anti-lag script OR you make blocks much bigger than 32x32 to cover larger areas. After that, it works exactly like the one before.
The second method can also work with fixed black pictures around the perimeter. Fixed pictures scripts are used it parallax mapping, so that the pictures do not move along with the camera when the player moves.
Thank for the response, I think I will go with making a decent size default map and then do the show the area and, when the player can transfer use the transfer event to bring them to the map so it does not lag the game to much.