It's not the tileset itself that's the problem. Like, let's say for example (note, this is not how it actually is, but just to make it easier to explain) your tileset graphic has 80 tiles on it. The top left tile is tile ID 0. Immediately right of it is tile ID 1, then 2, then 3...and the tile immediately below 0 is tile ID 7. Using that logic, the bottom right tile on the tileset will be tile ID 79.
So you make your map, using all the tiles your tileset has. Then, at some later point in time, you go "do I really need 80 tiles?" and change the tileset graphic to something smaller in size (let's say 40 tiles in total). While your map no longer draws the tile IDs 40-79 anymore,
they still exist in the map data. This is what your error most likely is--your map is using a tile ID that the tileset graphic does not support.
You can put this script above Main
class Game_Map
alias check_invalid_tiles setup
def setup(map_id)
check_invalid_tiles(map_id)
bitmap = RPG::Cache.tileset(@tileset_name)
maxtileid = (bitmap.width / 32) * (bitmap.height / 32) - 1
for x in 0...@map.data.xsize
for y in 0...@map.data.ysize
for z in 0...@map.data.zsize
if @map.data[x,y,z] - 384 > maxtileid
p("[#{x},#{y},#{z}] = " + @map.data[x,y,z].to_s)
end
end
end
end
end
end
and put your character in the problem map. If there are invalid tile IDs, a message window will pop up showing the [x, y, layer] coordinates.