I think the autotile problem has to do with that system that checks if the autotile needs to be updated. I think it should always be updated if it exists. I just wouldn't know what to change, but I think it's in this part of the code...
def map_data=(data)
# Set the map data to an instance variable.
@map_data = data
# Clear any sprites' bitmaps if it exists, or create new ones.
@layers.each_index {|i|
if @layers[i].bitmap != nil
# Dispose bitmap and set to nil.
@layers[i].bitmap = @layers[i].bitmap.dispose
end
# Create new bitmap, whose size is the same as the game map.
@layers[i].bitmap = Bitmap.new($game_map.width*32, $game_map.height*32)
}
# Draw bitmaps accordingly.
refresh
end
def refresh
# Set the animation data from the file if it exists, or create it now.
@animated = $game_map.autotile_data
# Iterate through all map layers, starting with the bottom.
[0,1,2].each {|z| (0...@map_data.ysize).each {|y| (0...@map_data.xsize).each {|x|
tile_id = @map_data[x, y, z]
# Go to the next iteration if no bitmap is defined for this tile.
if tile_id == 0 # No tile
next
elsif tile_id < 384 # Autotile
name = $game_map.autotile_names[(tile_id / 48) - 1]
bitmap = RPG::Cache.load_autotile(name, tile_id)
else # Normal Tile
bitmap = RPG::Cache.tile($game_map.tileset_name, tile_id, 0)
end
# Determine what the layer to draw tile, based off priority.
layer = @priorities[tile_id]
# Perform a block transfer from the created bitmap to the sprite bitmap.
@layers[layer].bitmap.blt(x*32, y*32, bitmap, Rect.new(0, 0, 32, 32))
}}}
end
def update
# Update the sprites.
if Graphics.frame_count % $game_map.autotile_speed == 0
# Increase current frame of tile by one, looping by width.
@animated[0].each_index {|i|
@animated[2][i] = (@animated[2][i] + 1) % @animated[1][i]
@animated[3][i].each {|data|
# Gather data using the stored coordinates from the map data.
tile_id, x, y = @map_data[data[0], data[1], data[2]], data[0], data[1]
name, layer = @animated[0][i], @priorities[tile_id]
# Load the next frame of the autotile and set it to the map.
bitmap = RPG::Cache.load_autotile(name, tile_id, @animated[2][i])
@layers[layer].bitmap.blt(x*32, y*32, bitmap, Rect.new(0, 0, 32, 32))
}
}
end
end
end