03-08-2008, 04:49 AM
Tileset Changer VX
Version: 1.0
Version: 1.0
Introduction
Looking through the features missing to VX, I thought that changing tilesets would be easy enough. My script probably isn't the easiest way to change them, nor the most user-friendly, but it works.
Screenshots
Can't really take a screenshot....
Script
Script
Code:
#==============================================================================
# ** Tileset Changer VX
#------------------------------------------------------------------------------
# by Syvkal
# Version 1.0
# 04-05-08
#==============================================================================
#
# SCRIPT CALLS:
#
# --Changing Tilesets--
# It has a very simple format:
#
# $game_system.x = "filename"
#
# The 'x' is the abbreviation of the original tile set.
#
# TA1 = TileA1 TA2 = TileA2 TA3 = TileA3
# TA4 = TileA4 TA5 = TileA5 TB = TileB
# TC = TileC TD = TileD TE = TileE
#
# The filename is whatever is stored within the Graphics\System folder.
#
#==============================================================================
#==============================================================================
# ** Game_System
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :TA1
attr_accessor :TA2
attr_accessor :TA3
attr_accessor :TA4
attr_accessor :TA5
attr_accessor :TB
attr_accessor :TC
attr_accessor :TD
attr_accessor :TE
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias initialize_original initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Perform the original call
initialize_original
@TA1 = "TileA1"
@TA2 = "TileA2"
@TA3 = "TileA3"
@TA4 = "TileA4"
@TA5 = "TileA5"
@TB = "TileB"
@TC = "TileC"
@TD = "TileD"
@TE = "TileE"
end
#--------------------------------------------------------------------------
# * Get Tile Names
#--------------------------------------------------------------------------
def Tiles(t)
@T = t
case @T
when 0
return @TA1
when 1
return @TA2
when 2
return @TA3
when 3
return @TA4
when 4
return @TA5
when 5
return @TB
when 6
return @TC
when 7
return @TD
when 8
return @TE
end
end
end
#==============================================================================
# ** Spriteset_Map
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias update_tilemap_original update_tilemap
#--------------------------------------------------------------------------
# * Create Tilemap
#--------------------------------------------------------------------------
def create_tilemap
@tilemap = Tilemap.new(@viewport1)
for i in 0...8
@tilemap.bitmaps[i] = Cache.system($game_system.Tiles(i))
end
@tilemap.map_data = $game_map.data
@tilemap.passages = $game_map.passages
end
#--------------------------------------------------------------------------
# * Update Tilemap
#--------------------------------------------------------------------------
def update_tilemap
for i in 0...8
# if the current tileset is changed
if @tilemap.bitmaps[i] != Cache.system($game_system.Tiles(i))
# Load the tileset from the cache
@tilemap.bitmaps[i] = Cache.system($game_system.Tiles(i))
end
end
# Perform the original call
update_tilemap_original
end
end
Instructions
Put it under the Materials Section
To change the Tileset use:
$game_system.x = "filename"
Where as 'x' is the abbreviation of the original tile sets
TA1 = TileA1 | TA2 = TileA2 | TA3 = TileA3
TA4 = TileA4 | TA5 = TileA5 | TB = TileB
TC = TileC | TD = TileD | TE = TileE
$game_system.TB = "New"
Will change Tileset B to a file called "New"Compatibility
You cannot load files that have been saved before you implemented this script. I couldn't be bothered working out how to do that.