Group: Member
Posts: 8
Type: Event Designer
RM Skill: Advanced
Waypoints VX Ver. 1.5 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: 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
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.
#=============================================================================== # * [VX] Waypoints VX # Ver. 1.5 # By Mundane, mundane92@gmail.com #------------------------------------------------------------------------------- # Special thanks to: # • Yeyinde, for helping me improve the script # # History: # • 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"] ]
# 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 WINDOW_RIGHT = false # Position window on right? False is left. #------------------------------------------------------------------------------- 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
#=============================================================================== # ** 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 if WayVX::WINDOW_RIGHT == true @wayhelp_window = Window_WaypointHelp.new(286,0) else @wayhelp_window = Window_WaypointHelp.new(0,0) end end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- def terminate super dispose_menu_background @command_window.dispose @wayhelp_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super update_menu_background @command_window.update @wayhelp_window.update if @command_window.active update_command_selection end 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 if WayVX::WINDOW_RIGHT == true @command_window.x = 286 @command_window.y = 60 else @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 return else 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 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
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
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
This post has been edited by Mundane: Aug 17 2008, 08:27 AM
Nice script, but is there any way that instead of the undiscovered waypoints being greyed out that they would just not be displayed at all until they have been discovered?
For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.
Thanks in advance.
Hey there,
Well I don't make battle neither though I can still teach you some things :)... The way I've learned to script is by reading other scripts for the most part. I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!! The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script. You also need to feel the competition that's around in the scripting-community. Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P So that's an other thing... You also don't need to be afraid to learn from others or helpfiles. When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember. Then, you must be calm, cause you need to try the script a lot of times. When I write a script, I test it after almost every changes. First I set up the major structure. Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base def initialize(x,y,width,height) super(x,y,width,height) refresh end
def refresh self.contents.clear draw_contents end
def draw_contents draw_something(with, some, parameters) end
def update refresh if @something != @what_it_should_be end end
So that's also very important. Then, the biggest thing I learned scripting from is TRIAL AND ERROR. That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.
So that's it how I did it. Now it's up to you. Do some requests (if I didn't do it allready :P) and learn from them.
Hope that helped you out a little. If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials. Perhaps they're going to be usefull for you one day ;)
Nice script, but is there any way that instead of the undiscovered waypoints being greyed out that they would just not be displayed at all until they have been discovered?
How will the waypoints be discovered, if they are not displayed lol? Unless you want the player to have to search for an invisible waypoint ...
Group: Member
Posts: 6
Type: Developer
RM Skill: Beginner
Yeah, I'm having the same problem with the time resetting. I'm using BigEd's Final Fantasy 9 menu script and it is above the Waypoint script. So could you possibly help me with this? Great script by the way. It has made my game a lot more enjoyable.
recruiting: writer(for the dialogues), mapper and eventer... visit this thread to join: Grendis Recruitment Thread "You can tame a lion, but you can never make it vegetables"