[VX] Auto_Tilesets Version: 1.0
By: Darkleo
Features
Preliminaries
Copy and paste the script above main.
Open your games folder and go into Graphics/System.
You should have the default tilesets. If not, use the resource manager.
Change the tilesets by adding "default_" before each tilesets name.
(Example : "TileA1.png" becomes "default_TileA1.png").
Script
Instructions
Configuration is from line 19.
For each map, add "when X" (X = map ID) in the script configuration, and add the name of the tileset for that map.
For example, map 5 uses the tileset "special.png" for tileA1 instead of the default tileset "TileA1.png" and map 7 uses the tileset "special2.png" for tileD instead of the default tileset "TileD.png", so the code you would use in the configuration settings is:
To change the tileset in the editor, select one map, save and run the game.
You will notice in the editor (by changing the map) that the tileset that you see is the one used in the map you have selected when you launched the game.
Terms and Conditions
You can freely use this script, but you must include my name by crediting me on your game
Darkleo.
PS: Thanks to joshuaalanhargreaves to help me to translate the documentation in English.
By: Darkleo
Features
- Allows you to use more tilesets
- Enables you to see the tileset in the editor
Preliminaries
Copy and paste the script above main.
Open your games folder and go into Graphics/System.
You should have the default tilesets. If not, use the resource manager.
Change the tilesets by adding "default_" before each tilesets name.
(Example : "TileA1.png" becomes "default_TileA1.png").
Script
Code:
#==============================================================================
# ** Auto_Tilesets
# Version 1.0 #02/2009
# By Darkleo ([email=cestleonard@aol.com]cestleonard@aol.com[/email])
#==============================================================================
module Data_Tileset
 module_function
 #--------------------------------------------------------------------------
 def [](map_id)
  tileA1 = "TileA1"
  tileA2 = "TileA2"
  tileA3 = "TileA3"
  tileA4 = "TileA4"
  tileA5 = "TileA5"
  tileB  = "TileB"
  tileC  = "TileC"
  tileD  = "TileD"
  tileE  = "TileE"
# Configuration
  case map_id
  when 5 # Map ID
   tileA1 = "special"
  end
# End configuration
  return [tileA1, tileA2, tileA3, tileA4, tileA5,
   tileB, tileC, tileD, tileE]
 end
 #--------------------------------------------------------------------------
 def change_tileset
  map_id = load_data("Data/System.rvdata").edit_map_id
  path = "Graphics/System/"
  default = self[0]
  ext = ".png"
  for i in 0..8
   tileset = self[map_id][i]
   default_tileset = default[i]
   tileset = "default_" + tileset if tileset == default_tileset
   file1 = File.open(path + tileset + ext, 'rb')
   file2 = File.open(path + default_tileset + ext, 'wb')
   file2.write(file1.read)
   file1.close
   file2.close
  end
 end
 change_tileset if $TEST
 #--------------------------------------------------------------------------
end
#==============================================================================
class Spriteset_Map
 #--------------------------------------------------------------------------
 alias old_create_tilemap create_tilemap
 def create_tilemap
  tab = Data_Tileset[$game_map.map_id]
  @tilemap = Tilemap.new(@viewport1)
  for i in 0..8
   @tilemap.bitmaps[i] = Cache.system(tab[i])
  end
  @tilemap.map_data = $game_map.data
  @tilemap.passages = $game_map.passages
 end
 #--------------------------------------------------------------------------
end
#==============================================================================
Instructions
Configuration is from line 19.
For each map, add "when X" (X = map ID) in the script configuration, and add the name of the tileset for that map.
For example, map 5 uses the tileset "special.png" for tileA1 instead of the default tileset "TileA1.png" and map 7 uses the tileset "special2.png" for tileD instead of the default tileset "TileD.png", so the code you would use in the configuration settings is:
Code:
case map_id
  when 5 # Map ID
   tileA1 = "special"
  when 7
   tileD = "special2"
  end
To change the tileset in the editor, select one map, save and run the game.
You will notice in the editor (by changing the map) that the tileset that you see is the one used in the map you have selected when you launched the game.
Terms and Conditions
You can freely use this script, but you must include my name by crediting me on your game
Darkleo.
PS: Thanks to joshuaalanhargreaves to help me to translate the documentation in English.