Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Sign in to follow this  
Leon

Change Map Tileset

Recommended Posts

Okay, this script allows you to change the current tileset with another one. Sounds like something you wouldn't want to do, but it is great for 3 big things:

1. Create bridges using a duplicate tileset and a simple command.

2. Mountains with real depth.

3. Change the appearance of a tileset. (for instance, make it look more demonic without needing a new map to teleport to.)

 

Demo

 

#====================================
#  Phylomortis Script, Ryethe.  Rewrite: Leon_Westbrooke
#------------------------------------------------------------------------
#  Game_Map and Spriteset_Map are aliased
#  To call $game_map.replace_tileset(x), where x is the ID number of the new tileset.
#====================================

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Game_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Game_Map
 attr_accessor :new_tileset

 alias leon_gm_tileset_setup setup

 def setup(map_id)
@new_tileset = false
leon_gm_tileset_setup(map_id)
 end

 def replace_tileset(new_tiles)
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
end

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Spriteset_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Spriteset_Map

 alias leon_sm_tileset_update update

 def update  
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
leon_sm_tileset_update
 end
end

Share this post


Link to post
Share on other sites

Thanks for posting this now Leon, I will check the demo when I get home from school, I might request further assistant then.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...