What I'm trying to figure out is how the engine makes tiles from the data array In a map's JSON file. I tried playing around with a map, but I'm not seeing any real patterns in the array's values.
How does the engine set tiles?
Learning JavascriptI suggest you search on himeworks.com for the scripts to change tiles, they also include a bit more about how the engine handles those changes. It is not easy to explain, especially not the autotiles because they are handled based on the surrounding tiles and not on their own.
The data is based on map width x map height x 6 layers.
If your map width is 30 tiles and your map height is 40 tiles, then the first 1200 values (30x40) are the ground layer, the next 1200 values are the ground cover layer, the next 1200 values are the first upper layer, the next 1200 values are the second upper layer, the next 1200 values are the shadow layer, and the final 1200 values are the region layer.
If your map width is 30 tiles and your map height is 40 tiles, then the first 1200 values (30x40) are the ground layer, the next 1200 values are the ground cover layer, the next 1200 values are the first upper layer, the next 1200 values are the second upper layer, the next 1200 values are the shadow layer, and the final 1200 values are the region layer.
I didn't MV plugins that handled autotiles there, but yeah it looks complicated.
ahhhh, okay. thank you for the help.
a related question, where does MV set sprite for each tile?
In the rpg_core.js script, you're looking for the Tilemap and ShaderTilemap classes. Each of those has a function called drawAllTiles or something like that.
Those two are exactly what im looking for thank you lots and lots.
Original thread: https://forums.rpgmakerweb.com/threads/how-does-the-engine-set-tiles.118243/