I am not sure if this is actually related to the Disc Changer, but I think it is, seeing as the event works just fine in the project that I made it in (which is different than the project that is running Disc Changer). Here is the script:
Script
CODE
#==============================================================================
# Disc Changer script VX + custom tilesets per disc feature
#------------------------------------------------------------------------------
# Original DC script by Zeriab, translated to VX by omegazion and added
# custom tilesets per disc feature. v1.02
#==============================================================================
=begin
INTRODUCTION
------------
This script allows you to change the disc, where each disc can contain 999 maps.
I have also added the feature so that each disc can have different tilesets.
INSTRUCTIONS
------------
This script enables the change_disc command. Use script calls to change the disc.
create the other disc maps separately in another project. when you are done, save
it, then copy the map files in the Data folder of that project. (The map files
are the ones that are named MapXXX.rvdata where XXX is an integer).
After that, in the Data folder of the Original project, you must create a disc
folder. This is where you put the map files.
For disc 1, name the disc folder 'disc1' and so on..
New!
You can name the disc folders with whatever you want, as long as you follow
special disc name instructions below.
CHANGING DISCS
--------------
The syntax is
change_disc(number, id = nil, x = nil, y = nil, direction = nil)
The nil numbers mean that those arguments are optional. When you don't use them
then they are set to whatever the current map_id, x, y and direction are at the
moment.
If you want to change to disc 2 then you can put this in a script call
change_disc(2)
You will then be transfered to disc 2 with the same map id and coordinates as
what the player currently has. (which is the folder named 'disc2'
If you are not using the format 'discX' as a disc name, (WeirdTilesDisc as an
example in the demo) you can replace the number argument with its name, closed
in ""
change_disc("WeirdTilesDisc")
If you want to be more precise and say you want to change to disc 2 on the map
with id 10 and the player must be placed at the tile with x = 6 and y = 13 then
you should put this in a call script
change_disc(2, 10, 6, 13)
Note that when you start the game the maps directly in the data folder is used.
You can back to them by changing to disc number 0.
Basically, disc number 0 is the maps directly in the data folder and not in any
of the sub folders.
The final argument is the direction. By default the player retains the current
direction. You can put 6 different values as direction
0, 10 No change
2 Turn Down
4 Turn Left
6 Turn Right
8 Turn Up
If you for example want to transfer the player to disc 1, map 43 at x = 30 and
y = 4 with the player looking down you should put this in a call script
change_disc(1, 43, 30, 4, 2)
ADDED CUSTOM TILESETS FOR EACH DISC FEATURE
-------------------------------------------
At the same folder of that disc, you could put Tileset files
(i.e. TileE, TileA4 etc..)
The script will automatically load those tilesets when they are there.
If you do this, you must also put the System.rvdata in the disc folder,
for the passage settings. If you do not do that, it will use the passage
settings in the original project, (which is most of the time, wrong).
=end
class Game_System
attr_writer :disc
def disc
@disc ||= ''
@disc
end
end
def change_disc(number, id = nil, x = nil, y = nil, direction = nil)
# Change disc
if number.is_a?(Integer)
$game_system.disc = number <= 0 ? "" : "disc#{number}/"
else
disc = number.to_s
disc += '/' unless disc[-1] == 47
$game_system.disc = disc
end
# Process arguments
map_id = id.is_a?(Integer) ? id : $game_map.map_id
x = $game_player.x unless x.is_a?(Integer)
y = $game_player.y unless y.is_a?(Integer)
direction = $game_player.direction unless direction.is_a?(Integer)
$game_player.reserve_transfer(map_id, x, y, direction)
# Change the current map id in case the new and old are identical.
$game_map.map_id = 1000 + map_id
end
class Game_Map
attr_writer :map_id
alias oz_dc_setup setup
def setup(map_id)
if $game_system.disc.empty? # Original Disc
oz_dc_setup(map_id) # Perform original call
else
@map_id = map_id
# Load map data from disc
@map = load_data(sprintf("Data/%sMap%03d.rvdata", $game_system.disc, @map_id))
@display_x = 0
@display_y = 0
# Get Folder Location
loc = "Data/#{$game_system.disc}"
$game_system.disc =~ /([0-9]+)/
dn = $1.to_i
if not $game_temp.disc_passages[dn].nil?
# Get passage data stored in game temp
@passages = $game_temp.disc_passages[dn]
elsif FileTest.exist?(loc + "System.rvdata") # If system.rvdata exists
# load system settings from that file
disc_sys = load_data(loc + "System.rvdata")
# Use passage settings from that file
@passages = disc_sys.passages
# Store in Temp data for faster loading
$game_temp.disc_passages[dn] = @passages
else
# Use default passage settings
@passages = $data_system.passages
end
referesh_vehicles
setup_events
setup_scroll
setup_parallax
@need_refresh = false
end
end
end
#==============================================================================
# ** Custom Tileset Per Disc Feature
#==============================================================================
class Spriteset_Map
alias oz_dc_create_tilemap create_tilemap
def create_tilemap
if $game_system.disc.empty?
oz_dc_create_tilemap
else
folder_loc = sprintf("Data/%s", $game_system.disc)
@tilemap = Tilemap.new(@viewport1)
# For each tileset file extension
["A1", "A2", "A3", "A4", "A5", "B", "C", "D", "E"].each_with_index do |name, i|
tilename = "Tile#{name}"
# If the file exists
if not Dir[folder_loc + tilename + ".*"].empty?
@tilemap.bitmaps[i] = Cache.load_bitmap(folder_loc, tilename)
else
# Load default bitmap
@tilemap.bitmaps[i] = Cache.system(tilename)
end
end
@tilemap.map_data = $game_map.data
@tilemap.passages = $game_map.passages
end
end
end
class Game_Temp
attr_accessor :disc_passages
alias oz_dc_init initialize
def initialize
oz_dc_init
@disc_passages = []
end
end
# Disc Changer script VX + custom tilesets per disc feature
#------------------------------------------------------------------------------
# Original DC script by Zeriab, translated to VX by omegazion and added
# custom tilesets per disc feature. v1.02
#==============================================================================
=begin
INTRODUCTION
------------
This script allows you to change the disc, where each disc can contain 999 maps.
I have also added the feature so that each disc can have different tilesets.
INSTRUCTIONS
------------
This script enables the change_disc command. Use script calls to change the disc.
create the other disc maps separately in another project. when you are done, save
it, then copy the map files in the Data folder of that project. (The map files
are the ones that are named MapXXX.rvdata where XXX is an integer).
After that, in the Data folder of the Original project, you must create a disc
folder. This is where you put the map files.
For disc 1, name the disc folder 'disc1' and so on..
New!
You can name the disc folders with whatever you want, as long as you follow
special disc name instructions below.
CHANGING DISCS
--------------
The syntax is
change_disc(number, id = nil, x = nil, y = nil, direction = nil)
The nil numbers mean that those arguments are optional. When you don't use them
then they are set to whatever the current map_id, x, y and direction are at the
moment.
If you want to change to disc 2 then you can put this in a script call
change_disc(2)
You will then be transfered to disc 2 with the same map id and coordinates as
what the player currently has. (which is the folder named 'disc2'
If you are not using the format 'discX' as a disc name, (WeirdTilesDisc as an
example in the demo) you can replace the number argument with its name, closed
in ""
change_disc("WeirdTilesDisc")
If you want to be more precise and say you want to change to disc 2 on the map
with id 10 and the player must be placed at the tile with x = 6 and y = 13 then
you should put this in a call script
change_disc(2, 10, 6, 13)
Note that when you start the game the maps directly in the data folder is used.
You can back to them by changing to disc number 0.
Basically, disc number 0 is the maps directly in the data folder and not in any
of the sub folders.
The final argument is the direction. By default the player retains the current
direction. You can put 6 different values as direction
0, 10 No change
2 Turn Down
4 Turn Left
6 Turn Right
8 Turn Up
If you for example want to transfer the player to disc 1, map 43 at x = 30 and
y = 4 with the player looking down you should put this in a call script
change_disc(1, 43, 30, 4, 2)
ADDED CUSTOM TILESETS FOR EACH DISC FEATURE
-------------------------------------------
At the same folder of that disc, you could put Tileset files
(i.e. TileE, TileA4 etc..)
The script will automatically load those tilesets when they are there.
If you do this, you must also put the System.rvdata in the disc folder,
for the passage settings. If you do not do that, it will use the passage
settings in the original project, (which is most of the time, wrong).
=end
class Game_System
attr_writer :disc
def disc
@disc ||= ''
@disc
end
end
def change_disc(number, id = nil, x = nil, y = nil, direction = nil)
# Change disc
if number.is_a?(Integer)
$game_system.disc = number <= 0 ? "" : "disc#{number}/"
else
disc = number.to_s
disc += '/' unless disc[-1] == 47
$game_system.disc = disc
end
# Process arguments
map_id = id.is_a?(Integer) ? id : $game_map.map_id
x = $game_player.x unless x.is_a?(Integer)
y = $game_player.y unless y.is_a?(Integer)
direction = $game_player.direction unless direction.is_a?(Integer)
$game_player.reserve_transfer(map_id, x, y, direction)
# Change the current map id in case the new and old are identical.
$game_map.map_id = 1000 + map_id
end
class Game_Map
attr_writer :map_id
alias oz_dc_setup setup
def setup(map_id)
if $game_system.disc.empty? # Original Disc
oz_dc_setup(map_id) # Perform original call
else
@map_id = map_id
# Load map data from disc
@map = load_data(sprintf("Data/%sMap%03d.rvdata", $game_system.disc, @map_id))
@display_x = 0
@display_y = 0
# Get Folder Location
loc = "Data/#{$game_system.disc}"
$game_system.disc =~ /([0-9]+)/
dn = $1.to_i
if not $game_temp.disc_passages[dn].nil?
# Get passage data stored in game temp
@passages = $game_temp.disc_passages[dn]
elsif FileTest.exist?(loc + "System.rvdata") # If system.rvdata exists
# load system settings from that file
disc_sys = load_data(loc + "System.rvdata")
# Use passage settings from that file
@passages = disc_sys.passages
# Store in Temp data for faster loading
$game_temp.disc_passages[dn] = @passages
else
# Use default passage settings
@passages = $data_system.passages
end
referesh_vehicles
setup_events
setup_scroll
setup_parallax
@need_refresh = false
end
end
end
#==============================================================================
# ** Custom Tileset Per Disc Feature
#==============================================================================
class Spriteset_Map
alias oz_dc_create_tilemap create_tilemap
def create_tilemap
if $game_system.disc.empty?
oz_dc_create_tilemap
else
folder_loc = sprintf("Data/%s", $game_system.disc)
@tilemap = Tilemap.new(@viewport1)
# For each tileset file extension
["A1", "A2", "A3", "A4", "A5", "B", "C", "D", "E"].each_with_index do |name, i|
tilename = "Tile#{name}"
# If the file exists
if not Dir[folder_loc + tilename + ".*"].empty?
@tilemap.bitmaps[i] = Cache.load_bitmap(folder_loc, tilename)
else
# Load default bitmap
@tilemap.bitmaps[i] = Cache.system(tilename)
end
end
@tilemap.map_data = $game_map.data
@tilemap.passages = $game_map.passages
end
end
end
class Game_Temp
attr_accessor :disc_passages
alias oz_dc_init initialize
def initialize
oz_dc_init
@disc_passages = []
end
end
Any and all help would be appreciated. Thank you.