Like the Diablo II Waypoint Travel system, you will encounter a menu that depicts two windows. Originally, the two windows were called 'Acts' and 'Waypoints' under the auspices that the game was divided into chapters or acts. Now revised, the names within this script were altered into Regions and Locations, though the mechanics and meanings remain the same.
When properly configured, you can set events on a map that act as teleport stations, activating upon touch. Under normal circumstances, you can only teleport between such waypoints if you had encountered them before, unable to teleport to other destinations not yet reached.
Of course, a few new options have been since been added.
Script
Waypoints Page 1
Code:
#==============================================================================
# Diablo II Waypoints - Expanded
# Based on the 'Diablo 2 Waypoints v. 1.1 by arevulopapo (March 1, 2007"
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.1
# 06-17-2020 (mm/dd/yyyy)
# RGSS / RPGMaker XP
# Requires: * SDK's 'Window_HorizCommand' class
# Requires: * 'Window_HorizCommand Addendum'
#==============================================================================
#
# INSTRUCTIONS and CONFIGURATION
#
#==============================================================================
#
# INTRODUCTION:
# =============
#
# A remastered and heavily edited version of arevulopapo's original work,
# this script replicates the Waypoint Travel system from Diablo II (c) 2000.
#
# Like the Diablo II Waypoint Travel system, you will encounter a menu that
# depicts two windows. Originally, the two windows were called 'Acts' and
# 'Waypoints' under the auspices that the game was divided into chapters or
# acts. Now revised, the names within this script were altered into Regions
# and Locations, though the mechanics and meanings remain the same.
#
# When properly configured, you can set events on a map that act as teleport
# stations, activating upon touch. Under normal circumstances, you can only
# teleport between such waypoints if you had encountered them before, unable
# to teleport to other destinations not yet reached.
#
# Of course, a few new options have been since been added.
#
#==============================================================================
#
# INSTALLATION:
# =============
#
# SDK 2.4+ Users:
# ----------------
# Below the SDK system, paste the "Window_HorizCommand Addendum" followed
# by this script set. All of which goes above Main.
#
# Regular Users:
# --------------
# Below the SDK system, paste the "Window_HorizCommand Addendum" followed
# Below Scene_Debug and above Main, paste the SDK's 'Window_HorizCommand'
# class script followed by the 'Window_HorizCommand Addendum' script.
# After both, paste this script set. All of which goes above Main.
#
# Once pasted into your project, configure as desired.
#
#==============================================================================
#
# EVENT SCRIPT CALLS:
# ===================
#
# This system is dependent upon map events, as waypoints within your map are
# created with map events. Still, these events require scripts to initialize
# and execute this scripts's features.
#
# * Set Waypoint Teleport
# ---------------------
# The 'Waypoint' command is the main script call that makes your project's
# waypoint teleportation system. Not only does this command bring up the
# system's menu where you can choose where to teleport, but it also esta-
# blishes itself as a new location where you may travel.
#
# waypoint(region, location)
# - region: This sets the main region where the waypoint is set.
# - location: This sets the location within the region where it is set.
#
# The 'Waypoint' command is the main script call that makes your project's
# Both of these values combine to make a 'key' which is used by the config
# system to get its name and return coordinates. So the following example
# would be used by a waypoint event to access the configuration contents
# of LOCATIONS[[2,5]]:
#
# @>Script: waypoint(2,5)
#
# - - - - - - - - - - -
#
# * Add/Activate Waypoint
# ---------------------
# Each waypoint teleport becomes an active return point after you touch
# them. However, waypoints not encountered may be activated by way of a
# simple script call.
#
# add_waypoint(region, location)
# - region: This specifies the region of the activated waypoint.
# - location: This specifies the location of the waypoint in a set region
#
# The 'Add Waypoint' command i s a nice touch to the system, allowing the
# expansion of the system to locations not yet ventured. Such uses of this
# command may be if an NPC likes your player enough to give him/her a new
# place in which to travel. And the way it is called is very much like the
# way one creates a waypoint itself, with a script call where its region
# and location combine to make a key used within the configured LOCATIONS
# setting, much like so:
#
# @>Script: add_waypoint(2,5)
#
# - - - - - - - - - - -
#
# * Delete/Remove Waypoint
# ----------------------
# The complete opposite of the 'Add Waypoint' command, this script call
# is used to simply deactivate a waypoint event so its location may become
# unavailable, This is of course assuming that the waypoint doesn't become
# active later.
#
# delete_waypoint(region, location)
# - region: This specifies the region of the deactivated waypoint.
# - location: This specifies the location of the waypoint in a set region
#
# The 'Delete Waypoint' command is a new feature only just added. But it
# certainly should prove handy. And it can be used like all of the other
# previously described commands:
#
# @>Script: delete_waypoint(2,5)
#
# - - - - - - - - - - -
#
# * Temporarily Block Waypoints
# ---------------------------
# This is a brand new function, one that allows some of the waypoint loca-
# tions to be temporarily blocked, and will not appear within the waypoint
# system's menu. It is meant to be called and executed right before the
# use of the 'Waypoint' command itself.
#
# block_waypoints(key_array)
# - key_array: This is an array, each argument within being the key to an
# entry within the LOCATIONS hash array.
#
# As you can see, this one differs in the data supplied. Instead of send-
# ing simple integer values, it requests an array, and the array is filled
# with two-parameter arrays itself. These two-parameter arrays happen to
# be the keys used by the LOCATIONS hash array within the configuration
# section. Let's assume you want to block the two teleports locations for
# a given waypoint, these being for Region 2, the locations being 5 and 6.
# You would so so with the following example:
#
# @>Script: block_waypoints( [ [2,5],[2,6] ] )
# @>Script: waypoint(1,5)
#
# The 'Add Waypoint' command i s a nice touch to the system, allowing the
# As stated before, the 'Block Waypoints' command is a feature that should
# be used directly before the use of the actual 'Waypoint' command. The
# effect is temporary, and the waypoints blocked are forgotten once you
# exit the waypoint system's menu. But it is highly recommended that it be
# run directly before the calling of the menu.
#
#==============================================================================
#
# TELEPORT EFFECT CALLS:
# ======================
#
# ==========================================================================
# Originally, the screen flashed and you were graced with a sound effect
# when the player teleported from one waypoint to another. It was hardcoded
# into the script. But this version made these features editable within the
# newly crafted configuration module. And along with these two is an anima-
# tion feature so a battle-animation may play upon the player after he shows
# up in the new map/locale.
#
# Now therse are configurable options, true enough. But they can be altered
# by script calls if you so desire. And as all these options stored within
# the Game_System class, they are also kept within your save game files.
#
# * Teleport Sound
# --------------
# You can change the sound effect that plays when you teleport from one
# map to another. This sound effect being one stored within your Audio/SE
# folder. Of note, the whole path and filename must be passed into the
# the script call, like the example below:
#
# $game_system.teleport_sound = "Audio/SE/020-Teleport03"
#
# On the other hand, you can set this value to 'nil' so no audio plays.
#
# - - - - - - - - - - -
#
# * Teleport Flash
# --------------
# You can change the flash effect that plays when you teleport from one
# map to another. This effect is a colored flash, using the same RGB Color
# system used mainly for text fonts. You can set this value to 'nil' and
# eliminate the flash effect. But the below example shows how you can make
# a blue fhash that occurs when you teleport with the system:
#
# $game_system.teleport_flash = Color.new(0,0,255,160)
#
# - - - - - - - - - - -
#
# * Teleport Animation
# ------------------
# You can change the battle animation that shows over the player after he
# or she appears at his/her new location. Meanwhile, you can set this
# value to either '0' or 'nil' to eliminate the animation effect:
#
# $game_system.teleport_anim = 16
#
# The above example sets the animation to play as animation #16. This is
# more recognized as the 'HP Restoration 2' battle animation
#
#==============================================================================
#
# THE CONFIG SECTION:
# ===================
#
# TELEPORT EFFECTS
# ----------------
# Here, you get to set the effects that play when you use the system to go
# from one map to another. It was JUST DESCRIBED ABOVE!!!! Sure, they are
# here as configurable options, but you can change them in-game now.
#
#
# REGION MENU WIDTH
# -----------------
# The Waypoint System's menu is a default 320px width, and the windows that
# display Regions and Location names are both 304px in width. That happens
# to be the 320 width minus a 16px border guys.
#
# The original system fit all the Region names within one window, compressed
# in width if each region name is long enough. However, you can change the
# way this system works. The value you set here determine how much space
# each region name may have, now allowing you to scroll left/right and have
# some regions not be visible. For example, setting this value to 304, you
# will only see one region name at a time. Still, you can set this value to
# return it to its original default style.
#
#
# REGIONS AND LOCATIONS
# ---------------------
# The main section of the configuration module defines regions and locations
# that one may travel or encounter. Each defined region has one (or more)
# accompanied locations. And no defined location can exist without having a
# region.
#
# The original design kept the regions and locations defined separately, but
# this script's configuration page shows the region/locations combined with
# the hope it is easier to understand.
#
# Each REGION in the demo has a simple numeric key value and the value of
# each region is the region's name. For example, let's say you have seven
# regions named: Africa, Antarctica, Asia, Australia, Europe, North America,
# and South America. You could define the fifth region like so:
#
# REGION[5] = "Europe"
#
# As just stated, each region is followed by a list of locations. But this
# time, the key to each location is a 2-digit array; the first digit being
# the value of the region and the second being its own individual numeric
# value. So for a region like "Europe" above, its locations may have keys
# resembling [5,2], [5,4] and so on.
#
# Meanwhile, the value of each location is more than just a simple name. It
# is the name of the location for sure, but acompanied by the map ID and the
# X/Y coordinated where you will appear. All of this content being held
# within. So let's say one was to make a list of locations to appear in
# "Europe" (above), they may resemble this:
#
# LOCATION[ [5,1] ] = [ "London", 2, 20, 45 ]
# LOCATION[ [5,2] ] = [ "Paris", 4, 73, 15 ]
# LOCATION[ [5,3] ] = [ "Madrid", 5, 157, 5 ]
# LOCATION[ [5,4] ] = [ "Oslo", 8, 55, 275 ]
# LOCATION[ [5,5] ] = [ "Frankfurt", 9, 2, 245 ]
# LOCATION[ [5,6] ] = [ "Budapest", 10, 108, 5 ]
# LOCATION[ [5,7] ] = [ "Venice", 15, 18, 22 ]
#
# So if you teleport to a waypoint that has a key of [5,3], you are in fact
# teleporting to "Madrid", onto map #5 at the x-y coordinates of 157,5. Just
# make sure your actual teleport event is not 'AT' that location, but away
# by at least one tile. If you place your teleport event at a location, you
# may get stuck within a solid tile or tile event.
#
#==============================================================================
#
# COMPATABILITY WITH BIG MAPS:
#
# This system does work with 'Big Maps' by DerVVulfman. Teleporting to the
# first 'map' in the big map set can use the same x and y coordinates. But
# there are nuances when teleporting to one of the attached maps. The map
# id used is still the ID of the first map, but the x and y coordinates are
# those of the attached map with the accumulated width/height added.#
#
# So if you have four maps creating a 2x2 big map, each map being 200x200
# in size, you can teleport to the 1st map at coordinates 23, 53. But to
# teleport to map #2 to the right, getting to coordinate 52,120 would re-
# quire the actual coordinates be the first map's ID at 252,120... the
# original 52 x coordinate + 200 more for the first map's width.
#
#==============================================================================
#
# CREDITS AND THANKS:
#
# Many thanks to arevulopapo for the original system.
#
#==============================================================================
#
# TERMS OF USE:
#
# Free for use in games, even commercial works. Only due credit for myself
# and arevulopapo are required.
#
#==============================================================================
module Diablo
# ===========================================================================
REGIONS, LOCATIONS = {},{} # Do Not Touch
# ===========================================================================
#==============================================================================
# Diablo 2 Waypoints - Expanded
# Based on the 'Diablo 2 Waypoints v. 1.1 by arevulopapo (March 1, 2007"
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.1
# 06-17-2020 (mm/dd/yyyy)
# RGSS / RPGMaker XP
# Requires: * SDK's 'Window_HorizCommand' class
# Requires: * 'Window_HorizCommand Addendum'
#==============================================================================
#
# MAIN ENGINE
#
#==============================================================================
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :waypoint_block # waypoints not showing in menu
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias game_temp_arev_diablo_way_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Execute new code
@waypoint_block = []
# Original method call
game_temp_arev_diablo_way_initialize
end
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles data surrounding the system. Backround music, etc.
# is managed here as well. Refer to "$game_system" for the instance of
# this class.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :regions # Regions
attr_accessor :region_names # Region Names
attr_accessor :waypoints_active # Active Waypoints
attr_accessor :waypoint_sound # SE for Waypoint Transport
attr_accessor :waypoint_flash # Flash for Waypoint Transport
attr_accessor :waypoint_anim # Animation for Waypoint Teleport
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias game_system_arev_diablo_way_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Execute new code
initialize_waypoints
# Original method call
game_system_arev_diablo_way_initialize
end
#--------------------------------------------------------------------------
# * Initialize Waypoints
#--------------------------------------------------------------------------
def initialize_waypoints
# Defined values
@waypoint_sound = Diablo::TELEPORT_SOUND
@waypoint_flash = Diablo::TELEPORT_FLASH
@waypoint_anim = Diablo::TELEPORT_ANIM
@regions = []
@region_names = []
@waypoints_active = []
# Ensure regions are sorted
way_keys = Diablo::REGIONS.keys
way_keys.sort!
# Go through regions and apply
for key in way_keys
destination = Diablo::REGIONS[key]
@region_names.push(destination)
end
# Define arrays based on defined regions
for i in 0..@region_names.size - 1
@regions << []
@waypoints_active << []
end
# Ensure locations are sorted
way_keys = Diablo::LOCATIONS.keys
way_keys.sort!
# Go through Locations and apply to region
for key in way_keys
region = (key[0])-1
destination = Diablo::LOCATIONS[key]
@regions[region].push(destination)
end
end
end
#==============================================================================
# ** Window_Region_Name
#------------------------------------------------------------------------------
# This window allows selection of a region by its name.
#==============================================================================
class Window_Region_Name < Window_HorizCommand
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(region=0)
commands = []
# Ensure regions are sorted
way_keys = Diablo::REGIONS.keys
way_keys.sort!
# Go through regions and apply
for key in way_keys
destination = Diablo::REGIONS[key]
commands.push(destination)
end
if Diablo::REGION_WIDTH.nil?
super(320, commands)
else
super(320, commands, Diablo::REGION_WIDTH)
end
self.back_opacity = 160
@region = region
refresh
self.index = region
end
end
#==============================================================================
# ** Window_Waypoint_List
#------------------------------------------------------------------------------
# This window displays the available transport locations for a given region.
#==============================================================================
class Window_Waypoint_List < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# region : region
# target_region : target region
# waypoint : waypoint
#--------------------------------------------------------------------------
def initialize(region, target_region, waypoint)
super(0, 64, 320, 416)
self.back_opacity = 160
@region = region
@target_region = target_region
@waypoint = waypoint
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@item_max = $game_system.regions[@target_region].size
self.contents = Bitmap.new(288, @item_max * 32)
for i in 0..@item_max - 1
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
x = 0
y = (index) * 32
if $game_system.waypoints_active[@target_region].include?(index)
testarray = [@target_region,index]
unless $game_temp.waypoint_block.include?(testarray)
self.contents.font.color = normal_color
text = $game_system.regions[@target_region][index][0].to_s
else
self.contents.font.color = disabled_color
text = ". . ."
end
else
self.contents.font.color = disabled_color
text = ". . ."
end
self.contents.draw_text(x, y, 288, 32, text, 1)
end
end
#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
# This interpreter runs event commands. This class is used within the
# Game_System class and the Game_Event class.
#==============================================================================
class Interpreter
#--------------------------------------------------------------------------
# * Execute Waypoint Code
# region : region
# location : waypoint location
#--------------------------------------------------------------------------
def waypoint(region=1, location=1)
$scene = Scene_Waypoint.new(region-1,location-1)
end
#--------------------------------------------------------------------------
# * Add Waypoint without touching
# region : region
# location : waypoint location
#--------------------------------------------------------------------------
def add_waypoint(region=1, location=1)
$game_system.waypoints_active[region-1] << location-1
end
#--------------------------------------------------------------------------
# * Delete Waypoint
# region : region
# location : waypoint location
#--------------------------------------------------------------------------
def delete_waypoint(region=1, location=1)
$game_system.waypoints_active[region-1].delete(location-1)
end
#--------------------------------------------------------------------------
# * Block Waypoint
# array : array
#--------------------------------------------------------------------------
def block_waypoints(waypoint_array=nil)
return if waypoint_array.nil?
ret_array = []
for region_idx in 0..waypoint_array.size-1
region = waypoint_array[region_idx][0]
location = waypoint_array[region_idx][1]
ret_array.push([region-1,location-1])
end
$game_temp.waypoint_block = ret_array
end
end
#==============================================================================
# ** Scene_Waypoint
#------------------------------------------------------------------------------
# This class handles waypoint teleporation processing
#==============================================================================
class Scene_Waypoint
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :region # Region
#--------------------------------------------------------------------------
# * Object Initialization
# region : region
# waypoint : waypoint
#--------------------------------------------------------------------------
def initialize(region, waypoint)
@waypoint = waypoint
@region = region
@target_region = region
unless $game_system.waypoints_active.include?(@waypoint)
$game_system.waypoints_active[@region] << @waypoint
end
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Generate Display
main_windows
# Main Loop
loop do
Graphics.update
Input.update
update
break if $scene != self
end
# Dispose
main_dispose
end
#--------------------------------------------------------------------------
# * Main Processing : Create Windows and visuals
#--------------------------------------------------------------------------
def main_windows
@spriteset = Spriteset_Map.new
@name_window = Window_Region_Name.new(@region)
@name_window.adaption = true
@list = Window_Waypoint_List.new(@region,
@target_region, @waypoint)
@list.index = @waypoint
if $game_player.screen_x < 320
@name_window.x = 320
@list.x = 320
end
Graphics.transition
end
#--------------------------------------------------------------------------
# * Main Processing : Dispose Windows and visuals
#--------------------------------------------------------------------------
def main_dispose
Graphics.freeze
@spriteset.dispose
@name_window.dispose
@list.dispose
$game_temp.waypoint_block = []
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@name_window.update
@list.update
return if update_left?
return if update_right?
return if update_decision?
return if update_cancel?
end
#--------------------------------------------------------------------------
# * Frame Update : Handling Left Button Input
#--------------------------------------------------------------------------
def update_left?
return false unless Input.trigger?(Input::LEFT)
# Run window update with left/negative direction
update_region_window(-1)
return true
end
#--------------------------------------------------------------------------
# * Frame Update : Handling Right Button Input
#--------------------------------------------------------------------------
def update_right?
return false unless Input.trigger?(Input::RIGHT)
# Run window update with right/positive direction
update_region_window(1)
return true
end
#--------------------------------------------------------------------------
# * Frame Update : Handling Decision Input
#--------------------------------------------------------------------------
def update_decision?
# Exit false as C Button not pressed
return false unless Input.trigger?(Input::C)
# Exit true with buzzer for invalid choice
unless $game_system.waypoints_active[@target_region].include?(@list.index)
$game_system.se_play($data_system.buzzer_se)
return true
end
# Perform Flash animatics
unless $game_system.waypoint_sound.nil?
Audio.se_play($game_system.waypoint_sound)
end
unless $game_system.waypoint_flash.nil?
$game_screen.start_flash($game_system.waypoint_flash, 5)
end
unless $game_system.waypoint_anim.nil?
$game_player.animation_id = $game_system.waypoint_anim
end
# Acquire new location and facing direction
map_id = $game_system.regions[@target_region][@list.index][1]
map_x = $game_system.regions[@target_region][@list.index][2]
map_y = $game_system.regions[@target_region][@list.index][3]
dir = $game_player.direction
# Perform Teleport and exit true
$game_map.setup(map_id)
$game_player.moveto(map_x, map_y)
$game_player.straighten
$game_map.update
$game_map.autoplay
$scene = Scene_Map.new
Graphics.transition(20)
$game_temp.waypoint_block = []
return true
end
#--------------------------------------------------------------------------
# * Frame Update : Handling Cancel Input
#--------------------------------------------------------------------------
def update_cancel?
return false unless Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
$game_temp.waypoint_block = []
return true
end
#--------------------------------------------------------------------------
# * Frame Update : Handling Act Window Input
# direction : region window update direction
#--------------------------------------------------------------------------
def update_region_window(direction)
$game_system.se_play($data_system.cursor_se)
new_region = (@target_region + direction) % $game_system.regions.size
@name_window.index = new_region
@target_region += direction
@list.dispose
@list = Window_Waypoint_List.new(@region, new_region, @waypoint)
@target_region %= $game_system.regions.size
if $game_player.screen_x < 320
@name_window.x = 320
@list.x = 320
end
end
end
Both scripts must be above Diablo II Waypoints - Extended as described in the script itself.
Compatibility
Designed for use with RPGMaker XP and is dependent upon two scripts as so described. Compatible with Big Maps by DerVVulfman.
Credits and Thanks
Many thanks to arevulopapo for the original system.
Terms of Use
Free for use in games, even commercial works. Only due credit for myself and arevulopapo are required.
RE: Diablo II Waypoints - Expanded - DerVVulfman - 06-18-2020
BUMP to version 1.1
This update fixes an error. Unfortunately, the system transported you based ONLY on your X-coordinate. If you were to teleport to coordinate 4,15.... you'd end up in coordinate 4,4.