11-11-2013, 07:58 PM
(I had written a lot here but then firefox crashed :< )
Mapping in RPG Maker VXAce! The built-in editor is pretty rigid. It is easy to use, but is set it the ways tiles are placed on top of one another.
What determines what tile is what on a map is $game_map.map_data it's not exposed though, so if you want to make change to it you'll have to do it inside that class. The format of @map_data is @map_data[X, Y, layer] = tile_id. X and Y are the positions on the map, and layer is a layer from 0 to 2. Higher layers are drawn on top of lower layers.
If you know a tile's tile_id, you can use @map_data to change what tile is loaded. Not just the picture, RPG Maker VX Ace uses this value to load terrain data as well.
What tile_id number equals which tile is a little odd, so here is all I've learned.
A tile_id of 0 is usually used to represent nothing, and is the first tile on tileset B. (Yes, B. I think since A contains autotiles, its tile_ids are negative. This is how it was in RPG Maker XP too, so it makes sense.) The next seven tiles to the left are 1, 2, 3, 4, 5, 6, and 7. So the first 8 tiles, reading them left to right, are 0-8.
Simple enough yes? The next part is a little weird depending on if you are looking at the acutal tile bitmap or what RPG Maker VXACe shows you in the editor. The actual bitmap is double wide, so the next 8 tile_ids in the row are 128-136. What happens is RPG Maker VXAce cuts the image in half vertically, and pastes the right half under the left half; for the purpose of assigning tile_ids anyways. This is important to us if we are writing an external editor as we'd be using the bitmap directly.
The pattern continues with the next row, starting at 8. And so on and so forth. Of special note is the fact that each tileset has 256 tiles. That's tile_ids from 0-255. tile_id 256 is the first tile on Tileset C. You can find the tile_ids for that Tileset by following these rules, and adding 256 to the result.
Mapping in RPG Maker VXAce! The built-in editor is pretty rigid. It is easy to use, but is set it the ways tiles are placed on top of one another.
What determines what tile is what on a map is $game_map.map_data it's not exposed though, so if you want to make change to it you'll have to do it inside that class. The format of @map_data is @map_data[X, Y, layer] = tile_id. X and Y are the positions on the map, and layer is a layer from 0 to 2. Higher layers are drawn on top of lower layers.
If you know a tile's tile_id, you can use @map_data to change what tile is loaded. Not just the picture, RPG Maker VX Ace uses this value to load terrain data as well.
What tile_id number equals which tile is a little odd, so here is all I've learned.
A tile_id of 0 is usually used to represent nothing, and is the first tile on tileset B. (Yes, B. I think since A contains autotiles, its tile_ids are negative. This is how it was in RPG Maker XP too, so it makes sense.) The next seven tiles to the left are 1, 2, 3, 4, 5, 6, and 7. So the first 8 tiles, reading them left to right, are 0-8.
Simple enough yes? The next part is a little weird depending on if you are looking at the acutal tile bitmap or what RPG Maker VXACe shows you in the editor. The actual bitmap is double wide, so the next 8 tile_ids in the row are 128-136. What happens is RPG Maker VXAce cuts the image in half vertically, and pastes the right half under the left half; for the purpose of assigning tile_ids anyways. This is important to us if we are writing an external editor as we'd be using the bitmap directly.
The pattern continues with the next row, starting at 8. And so on and so forth. Of special note is the fact that each tileset has 256 tiles. That's tile_ids from 0-255. tile_id 256 is the first tile on Tileset C. You can find the tile_ids for that Tileset by following these rules, and adding 256 to the result.