$game_map.replace_tileset(tileset_id)
$game_map.replace_tileset(1)
class Game_Map
# ---------------
attr_accessor :new_tileset
[...]
def setup(map_id)
@new_tileset = false
[...]
end
[...]
def replace_tileset(new_tiles) # New Method
tileset = $data_tilesets[new_tiles]
@tileset_name = tileset.tileset_name
@autotile_names = tileset.autotile_names
@panorama_name = tileset.panorama_name
@panorama_hue = tileset.panorama_hue
@fog_name = tileset.fog_name
@fog_hue = tileset.fog_hue
@fog_opacity = tileset.fog_opacity
@fog_blend_type = tileset.fog_blend_type
@fog_zoom = tileset.fog_zoom
@fog_sx = tileset.fog_sx
@fog_sy = tileset.fog_sy
@battleback_name = tileset.battleback_name
@passages = tileset.passages
@priorities = tileset.priorities
@terrain_tags = tileset.terrain_tags
$game_map.new_tileset = true
end
if $game_map.new_tileset == true
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
@tilemap.priorities = $game_map.priorities
for i in 0..6
autotile_name = $game_map.autotile_names[i]
@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
end
$game_map.new_tileset = false
end