Waypoints VX
Ver. 1.6
By Mundane
Introduction
This is my first script. Waypoints VX is a portal system similar to that of the Diablo games. When the scene is called it gives you a list of places to go. Simple as that.
History
• 8/17/08 #2: Updated script to Version 1.6; added an optional Point Spending System and removed bugged window position option
• 8/17/08: Updated script to Version 1.5; adds MUCH simpler Waypoint addition
Features
• Simple menu design
• Pre-activated waypoints
• Activation controlled by switches
• Configurable sounds and animations
• Optional Points Spending System - allows teleporting only if you have points to spend
Script
I highly recommend downloading the demo. The events in the demo will make it easier for you to implement this script as easily as possible.
Downloads
I have a demo available for your convenience. It features all the events you'll ever need built in. If the mirrors below don't work for you, request another one and I'll put it up.
MSN SkyDrive Mirror: Download
MediaFire Mirror: Download
Screenshots
http://img520.imageshack.us/img520/7593/wayvxra1.png[/img]
Instructions
Instructions on how to add waypoints are provided in the script.
To call the Waypoint window put this line in a 'Script...' event command:
The Point Spending System only takes away points upon transfering. You will need to give the party/player points(by adding to your designated variable) on your own.
NOTE: Waypoints VX DOES NOT stop weather or reset screen tones! You must set your maps to change that up on arriving on it. Future versions may support weather and tone features.
FAQ
Q: Can I request add-ons for this script?
A: Don't PM me with requests for add-ons. If you mention it in here and I can do it - I will.
Q: Can I use the events in the demo in my games?
A: Yes. Feel free to just copy those events over to your games.
Compatibility
There are no known compatibility issues. Report any you may find here.
Credits and Usage
You can use this in any non-commercial project. If you wish to use it for a commercial project, please contact me before doing so. Please credit me if you use the script; it may be a cluster-fuck of default scripts, but I worked hard on it.
Special tanks to:
-Yeyinde, for helping me improve the script
-Enterbrain
Thanks for your interest in Waypoints VX!
Mundane
Ver. 1.6
By Mundane
Introduction
This is my first script. Waypoints VX is a portal system similar to that of the Diablo games. When the scene is called it gives you a list of places to go. Simple as that.
History
• 8/17/08 #2: Updated script to Version 1.6; added an optional Point Spending System and removed bugged window position option
• 8/17/08: Updated script to Version 1.5; adds MUCH simpler Waypoint addition
Features
• Simple menu design
• Pre-activated waypoints
• Activation controlled by switches
• Configurable sounds and animations
• Optional Points Spending System - allows teleporting only if you have points to spend
Script
I highly recommend downloading the demo. The events in the demo will make it easier for you to implement this script as easily as possible.
Code:
#===============================================================================
# * [VX] Waypoints VX
# Ver. 1.6
# By Mundane, mundane92@gmail.com
#-------------------------------------------------------------------------------
# Special thanks to:
# • Yeyinde, for helping me improve the script
#
# History:
# • 8/17/08 #2 - Updated script to Ver. 1.6 which added optional Points System
# and removed window position option
# • 8/17/08 - Updated script to Ver. 1.5 which added easier Waypoint addition
#-------------------------------------------------------------------------------
module WayVX
#-------------------------------------------------------------------------------
# * CONFIGURATION
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Waypoint Set-Up:
#-------------------------------------------------------------------------------
# To add a Waypoint make a new line based on the following template:
# WAYPOINTS = [
# [C, S, M, X, Y, N],
# [C, S, M, X, Y, N]
# ]
# •C: Corresponds to the command number. Starts at '0' and counts up.
# •W: Corresponds to the switch number that that point needs on to activate.
# Set to '0' for pre-activated waypoints.
# •M: Corresponds to the ID of the map you are porting to.
# •X: Corresponds to the X coordinate on the map you are porting to, that you
# want the user to appear at.
# •Y: Corresponds to the Y coordinate on the map you are pointing to, that you
# want the user to appear at.
# •N: Sets the name of the Waypoint.
#-------------------------------------------------------------------------------
WAYPOINTS = [ #C S M X Y N
[0, 0, 1, 8, 6, "Garden"],
[1, 1, 2, 8, 6, "Plains"],
[2, 2, 3, 8, 6, "Tundra"]
]
NOSHOW = false # Set to true if you wish unactivated points to not
# show instead of graying out
# Point System Set-Up:
ENABLEPTS = true # Points enabled?
POINTVAR = 1 # Variable assigned to points
# Optional Aesthetic and Audio Configuration:
TELEPORT_SE = "/Audio/SE/Teleport" # Name of Teleport sound in Audio/SE/
TELEPORT_ANIM = 41 # ID of Teleport animation in the Database
#-------------------------------------------------------------------------------
end
#-------------------------------END CONFIG--------------------------------------
#-------------------------------------------------------------------------------
# * Window_WaypointHelp
#-------------------------------------------------------------------------------
class Window_WaypointHelp < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 258, 60)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(4, 0, 250, 24, 'Select a Waypoint')
end
end
#==============================================================================
# ** Window_Waypoints
#------------------------------------------------------------------------------
# This window deals with Waypoint selection.
#==============================================================================
class Window_Waypoints < 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
super(0, 0, width, row_max * WLH + 32, spacing)
@commands = commands
@item_max = commands.size
@column_max = column_max
refresh
self.index = 0
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
#-------------------------------------------------------------------------------
# * Window_WaypointHelp
#-------------------------------------------------------------------------------
class Window_Points < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 160, 60)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(4, 0, 250, 24, 'Points:')
self.contents.draw_text(70, 0, 150, 24, $game_variables[WayVX::POINTVAR].to_s)
end
end
#===============================================================================
# ** Scene_Waypoints
#===============================================================================
class Scene_Waypoints < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#-----------------------------------------------------------------------------
# * Start processing
#-----------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@wayhelp_window = Window_WaypointHelp.new(0,0)
if WayVX::ENABLEPTS == true
@pts_window = Window_Points.new(258,0)
end
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@wayhelp_window.dispose
if WayVX::ENABLEPTS == true
@pts_window.dispose
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@wayhelp_window.update
if WayVX::ENABLEPTS == true
@pts_window.update
end
update_command_selection
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
# * Add your waypoints here!
#--------------------------------------------------------------------------
def create_command_window
commands = WayVX::WAYPOINTS.collect{|waypoint| waypoint[5]}
@command_window = Window_Waypoints.new(258, commands)
waypoint = WayVX::WAYPOINTS[@command_window.index]
@command_window.index = @menu_index
@command_window.y = 60
WayVX::WAYPOINTS.each do |waypoint|
if waypoint[1] > 0 && !$game_switches[waypoint[1]]
@command_window.draw_item(waypoint[0], false)
end
end
#-----------------------------------------------------------------------------
# * Update Command Selection
#-----------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
waypoint = WayVX::WAYPOINTS[@command_window.index]
if waypoint[1] > 0 && !$game_switches[waypoint[1]]
Sound.play_buzzer
elsif WayVX::ENABLEPTS and $game_variables[WayVX::POINTVAR] == 0
Sound.play_buzzer
return
else
if WayVX::ENABLEPTS == true
$game_variables[WayVX::POINTVAR] -= 1
end
Audio.se_play(WayVX::TELEPORT_SE)
$game_player.animation_id = WayVX::TELEPORT_ANIM
$game_map.setup(waypoint[2])
$game_player.moveto(waypoint[3], waypoint[4])
$game_player.refresh
$scene = Scene_Map.new
RPG::BGM.fade(120)
RPG::BGS.fade(120)
Graphics.fadeout(30)
Graphics.wait(40)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
end
end
end
end
end
Downloads
I have a demo available for your convenience. It features all the events you'll ever need built in. If the mirrors below don't work for you, request another one and I'll put it up.
MSN SkyDrive Mirror: Download
MediaFire Mirror: Download
Screenshots
http://img520.imageshack.us/img520/7593/wayvxra1.png[/img]
Instructions
Instructions on how to add waypoints are provided in the script.
To call the Waypoint window put this line in a 'Script...' event command:
Code:
$scene = Scene_Waypoints.new
The Point Spending System only takes away points upon transfering. You will need to give the party/player points(by adding to your designated variable) on your own.
NOTE: Waypoints VX DOES NOT stop weather or reset screen tones! You must set your maps to change that up on arriving on it. Future versions may support weather and tone features.
FAQ
Q: Can I request add-ons for this script?
A: Don't PM me with requests for add-ons. If you mention it in here and I can do it - I will.
Q: Can I use the events in the demo in my games?
A: Yes. Feel free to just copy those events over to your games.
Compatibility
There are no known compatibility issues. Report any you may find here.
Credits and Usage
You can use this in any non-commercial project. If you wish to use it for a commercial project, please contact me before doing so. Please credit me if you use the script; it may be a cluster-fuck of default scripts, but I worked hard on it.
Special tanks to:
-Yeyinde, for helping me improve the script
-Enterbrain
Thanks for your interest in Waypoints VX!
Mundane