I came across StorymasterQ's Rm2k3 Style Teleport System. It seems easy enough to use, and I copied and pasted the script into the materials section. However, the script causes my game to crash.
From my understanding of this script, I would use a "Call Script" and input the following: $skew_tele.add(map_id, x_coord, y_coord, facing, target_name, sw_id)
I edited it to say the following: $skew_tele.add(007, 8, 22, Sarah's Cottage)
Now, when I talk to the npc that activates this call script, the game says "SyntaxError occured while running the script."
Script
#=========================================================================
=====
# StorymasterQ's Teleport System v1.0
#------------------------------------------------------------------------------
# Trying to copy RPGMaker2003's Teleport System as faithfully as possible
#------------------------------------------------------------------------------
# USAGE
#------------------------------------------------------------------------------
# To add a teleport target, from event call
# $skew_tele.add(map_id, x_coord, y_coord, facing, target_name, sw_id)
# where:
# map_id = ID of the target map or area
# x_coord = X coordinate on the target map or area
# y_coord = Y coordinate on the target map or area
# facing = (Optional) Character facing after teleport, omit to retain
# target_name = (Optional) Target text. If omitted, will use map or area name
# sw_id = (Optional) Switch ID to turn ON after teleport
#------------------------------------------------------------------------------
# To remove a teleport target, from event call
# $skew_tele.remove(map_id, x_coord, y_coord)
# where:
# map_id = ID of the target map or area
# x_coord = X coordinate on the target map or area
# y_coord = Y coordinate on the target map or area
#------------------------------------------------------------------------------
# To show the teleport target windows, from event call $skew_tele.show
# Upon selection of a teleport target, the Player will be teleported to the
# target immediately.
# If no teleport targets have been added, $skew_tele.show does nothing
#------------------------------------------------------------------------------
# To enable teleportation, call the $skew_tele.enable
# To disable, call $skew_tele.disable
# To switch between enabled and disabled, call $skew_tele.toggle
# Default is enabled. When disabled, $skew_tele.show does nothing
#------------------------------------------------------------------------------
# To set a switch on the current teleport ability, from event call
# $skew_tele.isenabled(switch_id)
# where:
# switch_id = Switch ID to be set TRUE if teleportation is enabled,
# FALSE otherwise
#==============================================================================
class Skew_Teleport
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize
@tele_enabled = true
@tele_targets = Array.new
end
#--------------------------------------------------------------------------
# * Add
#--------------------------------------------------------------------------
# To add a teleport target, from event call
# $skew_tele.add(map_id, x_coord, y_coord, facing, target_name, sw_id)
# where:
# map_id = ID of the target map or area
# x_coord = X coordinate on the target map or area
# y_coord = Y coordinate on the target map or area
# facing = (Optional) Character facing after teleport, omit to retain
# target_name = (Optional) Target text. If omitted, will use map or area
name
# sw_id = (Optional) Switch ID to turn ON after teleport
#----------------------------------------------------------------------------
def add(map_id, x_coord, y_coord, facing = 0, target_name = nil, sw_id = nil)
if target_name.nil?
mapdata = load_data("Data/MapInfos.rvdata")
map_name = mapdata[map_id].name
else
map_name = target_name
end
facing = 0 if facing.nil?
@tele_targets.push([map_id, x_coord, y_coord, facing, map_name, sw_id])
@tele_targets = @tele_targets.uniq
end
#----------------------------------------------------------------------------
# * Remove
#----------------------------------------------------------------------------
# To remove a teleport target, from event call
# $skew_tele.remove(map_id, x_coord, y_coord)
# where:
# map_id = ID of the target map or area
# x_coord = X coordinate on the target map or area
# y_coord = Y coordinate on the target map or area
#----------------------------------------------------------------------------
def remove(map_id, x_coord, y_coord)
for targets in @tele_targets
mapid = targets[0]
ekusu = targets[1]
waiyu = targets[2]
if mapid == map_id && ekusu == x_coord && waiyu == y_coord
@tele_targets.delete(targets)
end
end
end
#----------------------------------------------------------------------------
# * Show
#----------------------------------------------------------------------------
# To show the teleport target windows, from event call $skew_tele.show
# Upon selection of a teleport target, the Player will be teleported to the
# target immediately.
# If no teleport targets have been added, $skew_tele.show does nothing
#----------------------------------------------------------------------------
def show
if @tele_enabled && @tele_targets.size > 0
$scene = Scene_SkewTele.new(@tele_targets)
end
end
#----------------------------------------------------------------------------
# * Enable, Disable, and Toggle
#----------------------------------------------------------------------------
# To enable teleportation, call the $skew_tele.enable
# To disable, call $skew_tele.disable
# To switch between enabled and disabled, call $skew_tele.toggle
# Default is enabled. When disabled, $skew_tele.show does nothing
#----------------------------------------------------------------------------
def enable
@tele_enabled = true
end
def disable
@tele_enabled = false
end
def toggle
@tele_enabled = !@tele_enabled
end
#----------------------------------------------------------------------------
# * Is Enabled?
#----------------------------------------------------------------------------
# To set a switch on the current teleport ability, from event call
# $skew_tele.isenabled(switch_id)
# where:
# switch_id = (Optional) Switch ID to be set TRUE if teleport is enabled,
# FALSE otherwise.
# To check the current teleport ability in a Conditional Branch, call
# $skew_tele.isenabled()
# from Conditional Branch Script field
#----------------------------------------------------------------------------
def isenabled(switch_id = nil)
if switch_id.nil? then
return @tele_enabled
else
$game_switches[switch_id] = @tele_enabled
end
end
end
$skew = {} if $skew == nil
$skew["TeleSys"] = true
class Scene_SkewTele < Scene_Base
#--------------------------------------------------------------------------
# START SCRIPT CUSTOMIZATION
#--------------------------------------------------------------------------
# The width of the teleport window
TELEPORT_WINDOW_WIDTH = 272
# Number of targets shown on the teleport window
TELEPORT_WINDOW_SHOWN_TARGETS = 3
# Title of the teleport window
TELEPORT_WINDOW_TITLE = "Teleport"
# Teleport window horizontal offset
TELEPORT_WINDOW_X_OFFSET = 0
# Teleport window vertical offset
TELEPORT_WINDOW_Y_OFFSET = 0
# Dim map window when teleport window is showing
TELEPORT_WINDOW_DIM_MAP = false
#--------------------------------------------------------------------------
# END SCRIPT CUSTOMIZATION
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize(targets, menu_index = 0)
@tele_targets = targets
target_list = Array.new
for targets in @tele_targets
mname = targets[4].to_s
target_list = target_list + mname.to_a
end
@teleport_target_names = target_list
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
end
#--------------------------------------------------------------------------
# * Post-Start Processing
#--------------------------------------------------------------------------
def post_start
super
open_command_window
end
#--------------------------------------------------------------------------
# * Pre-termination Processing
#--------------------------------------------------------------------------
def pre_terminate
super
close_command_window
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_command_window
dispose_menu_background
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
if Input.trigger?(Input::
Sound.play_cancel
close_command_window
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
target = @tele_targets[@command_window.index]
map_id = target[0]
x_coord = target[1]
y_coord = target[2]
facing = target[3]
sw_id = target[5]
command_teleport(map_id, x_coord, y_coord, facing)
$game_switches[sw_id] = true if !sw_id.nil?
end
end
#--------------------------------------------------------------------------
# * Update Background for Menu Screen
#--------------------------------------------------------------------------
def update_menu_background
super
@menuback_sprite.tone.set(0, 0, 0, 128) if TELEPORT_WINDOW_DIM_MAP
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_Command_Scrollable.new(TELEPORT_WINDOW_WIDTH,
@teleport_target_names, 1, TELEPORT_WINDOW_SHOWN_TARGETS)
@command_window.index = @menu_index
@command_window.x = ((544 - @command_window.width) / 2) +
TELEPORT_WINDOW_X_OFFSET
@command_window.y = ((416 - @command_window.height)/ 2) +
TELEPORT_WINDOW_Y_OFFSET
@command_window.openness = 0
@title_window = Window_Base.new(@command_window.x, @command_window.y - 56,
@command_window.width, Window_Base::WLH + 32)
@title_window.contents.draw_text(0, 0, @title_window.contents.width,
Window_Base::WLH, TELEPORT_WINDOW_TITLE, 1)
@title_window.openness = 0
end
#--------------------------------------------------------------------------
# * Dispose of Command Window
#--------------------------------------------------------------------------
def dispose_command_window
@command_window.dispose
@title_window.dispose
end
#--------------------------------------------------------------------------
# * Open Command Window
#--------------------------------------------------------------------------
def open_command_window
@command_window.open
@title_window.open
begin
@command_window.update
@title_window.update
Graphics.update
end until @command_window.openness == 255
end
#--------------------------------------------------------------------------
# * Close Command Window
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
@title_window.close
begin
@command_window.update
@title_window.update
Graphics.update
end until @command_window.openness == 0
end
#--------------------------------------------------------------------------
# * Process When Choosing a Teleport Target
#--------------------------------------------------------------------------
def command_teleport(map_id, x_coord, y_coord, facing = 0)
#Sound.play_decision
Audio.se_play("Audio/SE/Teleport", 100, 100)
$game_player.reserve_transfer(map_id, x_coord, y_coord, facing)
close_command_window
$scene = Scene_Map.new
end
end
$skew_tele = Skew_Teleport.new
class Scene_File < Scene_Base
#--------------------------------------------------------------------------
# * Write Save Data
# file : write file object (opened)
#--------------------------------------------------------------------------
alias skew_tele_write_save_data write_save_data
def write_save_data(file)
skew_tele_write_save_data(file)
Marshal.dump($skew_tele, file)
end
#--------------------------------------------------------------------------
# * Read Save Data
# file : file object for reading (opened)
#--------------------------------------------------------------------------
alias skew_tele_read_save_data read_save_data
def read_save_data(file)
skew_tele_read_save_data(file)
$skew_tele = Marshal.load(file)
end
end
class Window_Command_Scrollable < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :commands # command
#--------------------------------------------------------------------------
# * Object Initialization
# width : window width
# commands : command string array
# column_max : digit count (if 2 or more, horizontal selection)
# row_max : row count (0: match command count)
# spacing : blank space when items are arrange horizontally
#--------------------------------------------------------------------------
def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
if row_max == 0
row_max = (commands.size + column_max - 1) / column_max
end
@row_count = row_max
@commands = commands
super(0, 0, width, row_max * WLH + 32, spacing)
@item_max = commands.size
@column_max = column_max
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Create Window Contents
#--------------------------------------------------------------------------
def create_contents
item_count = commands.size
self.contents.dispose
self.contents = Bitmap.new(width - 32, [item_count * WLH, @row_count *
WLH].max)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
# enabled : enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_item(index, enabled = true)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(rect, @commands[index])
end
end
=====
# StorymasterQ's Teleport System v1.0
#------------------------------------------------------------------------------
# Trying to copy RPGMaker2003's Teleport System as faithfully as possible
#------------------------------------------------------------------------------
# USAGE
#------------------------------------------------------------------------------
# To add a teleport target, from event call
# $skew_tele.add(map_id, x_coord, y_coord, facing, target_name, sw_id)
# where:
# map_id = ID of the target map or area
# x_coord = X coordinate on the target map or area
# y_coord = Y coordinate on the target map or area
# facing = (Optional) Character facing after teleport, omit to retain
# target_name = (Optional) Target text. If omitted, will use map or area name
# sw_id = (Optional) Switch ID to turn ON after teleport
#------------------------------------------------------------------------------
# To remove a teleport target, from event call
# $skew_tele.remove(map_id, x_coord, y_coord)
# where:
# map_id = ID of the target map or area
# x_coord = X coordinate on the target map or area
# y_coord = Y coordinate on the target map or area
#------------------------------------------------------------------------------
# To show the teleport target windows, from event call $skew_tele.show
# Upon selection of a teleport target, the Player will be teleported to the
# target immediately.
# If no teleport targets have been added, $skew_tele.show does nothing
#------------------------------------------------------------------------------
# To enable teleportation, call the $skew_tele.enable
# To disable, call $skew_tele.disable
# To switch between enabled and disabled, call $skew_tele.toggle
# Default is enabled. When disabled, $skew_tele.show does nothing
#------------------------------------------------------------------------------
# To set a switch on the current teleport ability, from event call
# $skew_tele.isenabled(switch_id)
# where:
# switch_id = Switch ID to be set TRUE if teleportation is enabled,
# FALSE otherwise
#==============================================================================
class Skew_Teleport
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize
@tele_enabled = true
@tele_targets = Array.new
end
#--------------------------------------------------------------------------
# * Add
#--------------------------------------------------------------------------
# To add a teleport target, from event call
# $skew_tele.add(map_id, x_coord, y_coord, facing, target_name, sw_id)
# where:
# map_id = ID of the target map or area
# x_coord = X coordinate on the target map or area
# y_coord = Y coordinate on the target map or area
# facing = (Optional) Character facing after teleport, omit to retain
# target_name = (Optional) Target text. If omitted, will use map or area
name
# sw_id = (Optional) Switch ID to turn ON after teleport
#----------------------------------------------------------------------------
def add(map_id, x_coord, y_coord, facing = 0, target_name = nil, sw_id = nil)
if target_name.nil?
mapdata = load_data("Data/MapInfos.rvdata")
map_name = mapdata[map_id].name
else
map_name = target_name
end
facing = 0 if facing.nil?
@tele_targets.push([map_id, x_coord, y_coord, facing, map_name, sw_id])
@tele_targets = @tele_targets.uniq
end
#----------------------------------------------------------------------------
# * Remove
#----------------------------------------------------------------------------
# To remove a teleport target, from event call
# $skew_tele.remove(map_id, x_coord, y_coord)
# where:
# map_id = ID of the target map or area
# x_coord = X coordinate on the target map or area
# y_coord = Y coordinate on the target map or area
#----------------------------------------------------------------------------
def remove(map_id, x_coord, y_coord)
for targets in @tele_targets
mapid = targets[0]
ekusu = targets[1]
waiyu = targets[2]
if mapid == map_id && ekusu == x_coord && waiyu == y_coord
@tele_targets.delete(targets)
end
end
end
#----------------------------------------------------------------------------
# * Show
#----------------------------------------------------------------------------
# To show the teleport target windows, from event call $skew_tele.show
# Upon selection of a teleport target, the Player will be teleported to the
# target immediately.
# If no teleport targets have been added, $skew_tele.show does nothing
#----------------------------------------------------------------------------
def show
if @tele_enabled && @tele_targets.size > 0
$scene = Scene_SkewTele.new(@tele_targets)
end
end
#----------------------------------------------------------------------------
# * Enable, Disable, and Toggle
#----------------------------------------------------------------------------
# To enable teleportation, call the $skew_tele.enable
# To disable, call $skew_tele.disable
# To switch between enabled and disabled, call $skew_tele.toggle
# Default is enabled. When disabled, $skew_tele.show does nothing
#----------------------------------------------------------------------------
def enable
@tele_enabled = true
end
def disable
@tele_enabled = false
end
def toggle
@tele_enabled = !@tele_enabled
end
#----------------------------------------------------------------------------
# * Is Enabled?
#----------------------------------------------------------------------------
# To set a switch on the current teleport ability, from event call
# $skew_tele.isenabled(switch_id)
# where:
# switch_id = (Optional) Switch ID to be set TRUE if teleport is enabled,
# FALSE otherwise.
# To check the current teleport ability in a Conditional Branch, call
# $skew_tele.isenabled()
# from Conditional Branch Script field
#----------------------------------------------------------------------------
def isenabled(switch_id = nil)
if switch_id.nil? then
return @tele_enabled
else
$game_switches[switch_id] = @tele_enabled
end
end
end
$skew = {} if $skew == nil
$skew["TeleSys"] = true
class Scene_SkewTele < Scene_Base
#--------------------------------------------------------------------------
# START SCRIPT CUSTOMIZATION
#--------------------------------------------------------------------------
# The width of the teleport window
TELEPORT_WINDOW_WIDTH = 272
# Number of targets shown on the teleport window
TELEPORT_WINDOW_SHOWN_TARGETS = 3
# Title of the teleport window
TELEPORT_WINDOW_TITLE = "Teleport"
# Teleport window horizontal offset
TELEPORT_WINDOW_X_OFFSET = 0
# Teleport window vertical offset
TELEPORT_WINDOW_Y_OFFSET = 0
# Dim map window when teleport window is showing
TELEPORT_WINDOW_DIM_MAP = false
#--------------------------------------------------------------------------
# END SCRIPT CUSTOMIZATION
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize(targets, menu_index = 0)
@tele_targets = targets
target_list = Array.new
for targets in @tele_targets
mname = targets[4].to_s
target_list = target_list + mname.to_a
end
@teleport_target_names = target_list
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
end
#--------------------------------------------------------------------------
# * Post-Start Processing
#--------------------------------------------------------------------------
def post_start
super
open_command_window
end
#--------------------------------------------------------------------------
# * Pre-termination Processing
#--------------------------------------------------------------------------
def pre_terminate
super
close_command_window
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_command_window
dispose_menu_background
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
if Input.trigger?(Input::
Sound.play_cancel
close_command_window
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
target = @tele_targets[@command_window.index]
map_id = target[0]
x_coord = target[1]
y_coord = target[2]
facing = target[3]
sw_id = target[5]
command_teleport(map_id, x_coord, y_coord, facing)
$game_switches[sw_id] = true if !sw_id.nil?
end
end
#--------------------------------------------------------------------------
# * Update Background for Menu Screen
#--------------------------------------------------------------------------
def update_menu_background
super
@menuback_sprite.tone.set(0, 0, 0, 128) if TELEPORT_WINDOW_DIM_MAP
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_Command_Scrollable.new(TELEPORT_WINDOW_WIDTH,
@teleport_target_names, 1, TELEPORT_WINDOW_SHOWN_TARGETS)
@command_window.index = @menu_index
@command_window.x = ((544 - @command_window.width) / 2) +
TELEPORT_WINDOW_X_OFFSET
@command_window.y = ((416 - @command_window.height)/ 2) +
TELEPORT_WINDOW_Y_OFFSET
@command_window.openness = 0
@title_window = Window_Base.new(@command_window.x, @command_window.y - 56,
@command_window.width, Window_Base::WLH + 32)
@title_window.contents.draw_text(0, 0, @title_window.contents.width,
Window_Base::WLH, TELEPORT_WINDOW_TITLE, 1)
@title_window.openness = 0
end
#--------------------------------------------------------------------------
# * Dispose of Command Window
#--------------------------------------------------------------------------
def dispose_command_window
@command_window.dispose
@title_window.dispose
end
#--------------------------------------------------------------------------
# * Open Command Window
#--------------------------------------------------------------------------
def open_command_window
@command_window.open
@title_window.open
begin
@command_window.update
@title_window.update
Graphics.update
end until @command_window.openness == 255
end
#--------------------------------------------------------------------------
# * Close Command Window
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
@title_window.close
begin
@command_window.update
@title_window.update
Graphics.update
end until @command_window.openness == 0
end
#--------------------------------------------------------------------------
# * Process When Choosing a Teleport Target
#--------------------------------------------------------------------------
def command_teleport(map_id, x_coord, y_coord, facing = 0)
#Sound.play_decision
Audio.se_play("Audio/SE/Teleport", 100, 100)
$game_player.reserve_transfer(map_id, x_coord, y_coord, facing)
close_command_window
$scene = Scene_Map.new
end
end
$skew_tele = Skew_Teleport.new
class Scene_File < Scene_Base
#--------------------------------------------------------------------------
# * Write Save Data
# file : write file object (opened)
#--------------------------------------------------------------------------
alias skew_tele_write_save_data write_save_data
def write_save_data(file)
skew_tele_write_save_data(file)
Marshal.dump($skew_tele, file)
end
#--------------------------------------------------------------------------
# * Read Save Data
# file : file object for reading (opened)
#--------------------------------------------------------------------------
alias skew_tele_read_save_data read_save_data
def read_save_data(file)
skew_tele_read_save_data(file)
$skew_tele = Marshal.load(file)
end
end
class Window_Command_Scrollable < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :commands # command
#--------------------------------------------------------------------------
# * Object Initialization
# width : window width
# commands : command string array
# column_max : digit count (if 2 or more, horizontal selection)
# row_max : row count (0: match command count)
# spacing : blank space when items are arrange horizontally
#--------------------------------------------------------------------------
def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
if row_max == 0
row_max = (commands.size + column_max - 1) / column_max
end
@row_count = row_max
@commands = commands
super(0, 0, width, row_max * WLH + 32, spacing)
@item_max = commands.size
@column_max = column_max
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Create Window Contents
#--------------------------------------------------------------------------
def create_contents
item_count = commands.size
self.contents.dispose
self.contents = Bitmap.new(width - 32, [item_count * WLH, @row_count *
WLH].max)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
# enabled : enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_item(index, enabled = true)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(rect, @commands[index])
end
end
The script isn't too long and I assume I'm just missing something easy. Any help would be appreciated! If you guys know another script that would replicate this same effect, that would be ok too.
