09-29-2009, 04:54 AM
Jaberwocky's Quest Log
(February 26, 2007)
Minor Edited Version
(February 26, 2007)
Minor Edited Version
Unsupported script.
When asked to post the script in RMVXPUniverse:
Quote:Go for it. I'm actually going to be rewriting it at some point so you can just stick the active/completed quests in an an array instead of the bajillion switches it's using now.
Introduction
A visually enticing Quest system that can track a near limitless number of quests. Revised from Jaberwocky's original system, it now has a minor configurable section so you can keep track of your graphics and settings with ease.
Features
- Revised version has a configuration page to set your own graphic filenames as desired.
- Instructions for usage & system editing contained in the main code.
- Can have up to 10000 quests if you're determined enough.
- Initial version (in this post) showcases two pages of quests, expandable to include more pages. That is IF you read the instructions.
Screenshots
Three to enjoy
A Quests In Progress list, showing the description, and different colored objectives with their icons.
Yes, I know Franz is a stupid name o_O;
What the list looks like when you have no quests active
A Completed Quests list
Yes, I know Franz is a stupid name o_O;
What the list looks like when you have no quests active
A Completed Quests list
Script
In four parts:
Main Code
Code:
#==============================================================================
# Jaberwocky's Quest Log
# Mon Feb 26, 2007
#------------------------------------------------------------------------------
#
# CONTROLS IN THE QUEST LOG:
#
# Up/Down arrows scroll through the list, Left/Right changes lists.
#
#------------------------------------------------------------------------------
#
# INSTALLING INTO THE MENU:
#
# To set up the quest log so it is accessed through your menu, you will need
# to edit your Scene_Menu's 'main' and 'update_command' methods.
#
# Editing the 'main' method requires you to add an additional 'Quest' command
# option and to perform any additional edits as required.
#
# And when you edit the 'update_command' method, you will insert a block of
# code that includes the following statements:
#
# $game_temp.quest_menu_calling = true
# $scene = Scene_Quests.new
#
#
#------------------------------------------------------------------------------
#
# BRINGING UP THE QUEST LOG SCREEN THROUGH A SCRIPT CALL:
#
# You can call the quest log from a map. To do so, you will use script call
# such as this: $scene = Scene_Quests.new
#
# That's really it.
#
#------------------------------------------------------------------------------
#
# TURNING ON/OFF QUESTS
#
# Activating quests and turning on/off switches in the system is easy.
#
# This system calls on a series of switch arrays created in the 'Game_Temp'
# class that identifies which quests have been performed. By default, the
# switch array accessed are 'qupdate' and 'qupdate2'.
#
# To activate a quest, you turn on a switch in the array after specifying the
# number of the quest and an 'objective number' of 0 (zero). This is the
# syntax of the script call:
#
# $game_temp.qupdate[Quest Number][Objective Number] = true
#
# So, to activate the third quest, use this: $game_temp.qupdate[3][0] = true
#
# Like I just stated, use an 'objective number' of 0.
#
# The quest number specifies the quest block in the list of quests, while the
# objective number identifies the tasks to be performed in your quests. For
# the objective number, setting 0 to 'true' will show the quest on the list.
# And values of 1 on up are the goals for the quest.
#
# And these values can also be turned off by setting them to 'false'
#
# * * *
#
# If you have a second page of quests, such as 'completed' quests, that use
# a 'qupdate2' value, you will use '$game_temp.qupdate2[Quest][Objective]'
# in your script calls.
#
#------------------------------------------------------------------------------
#
# THE TWO PAGES OF LISTS (What lists??):
#
# By design, the system is set up to have only two lists of quests... the 1st
# list being 'incomplete' quests (or quests in progress), and the 2nd list
# being 'completed' quests. The second list is typically a 'near duplicate'
# of the first list with subtle changes to show that the quest(s) were done.
#
# == This means the code for the first and second list are near identical ==
#
# Each list you access is its own class. You don't have to 'alias' anything,
# or do any super-special editing other than what you'll be instructed herein.
# The cool part is that each list of quests (completed or otherwise) can have
# its own setup. Each list can have its own rendered background image and its
# own collection of color choices for the text displayed.
#
#------------------------------------------------------------------------------
#
# ACCESSING A SPECIFIC PAGES OF LISTS:
#
# By general design, when you call the Quest Log, the system assumes you are
# going to load the very first list, or list #1. Most of the time, this list
# is the 'incomplete' list. But what if you want to access the second list?
#
# You can specify exactly which page of lists you wish to call by using the
# 'Scene_Quest' script call as explained earlier, but with a minor change so
# you can specify which page. Here's the syntax:
#
# $scene = Scene_Quests.new(list number)
#
# The 'list number' in the parentesis indicates which list to access. So if
# you wish to access the second list, use '$scene = Scene_Quests.new(2)'
#
# NOTE: Certain changes to the script may be necessary if you have more than
# two lists in your project.
#
#------------------------------------------------------------------------------
#
# MORE THAN TWO PAGE OF LISTS:
#
# Again... By design, the system is set up to have only 2 lists of quests...
# the 1st list being 'incomplete' quests (or quests in progress), and the 2nd
# list being 'completed' quests. The second list is typically a 'near dupli-
# cate' of the first list with subtle changes to show that the quest(s) were
# done.
#
# But, you can increase the number of lists, thereby increasing the number of
# pages you can cycle through. It will take some work.
#
# * First, take note of the names of your 'quest pages', aka the code with
# names such as Game_Quest, Game_Quest2, Game_Quest3... etc. It will be
# necessary to reference them in the script itself. You will receive in-
# structions on this soon.
#
# * How many pages have you created? Again, by design it is set up to have
# only 2 lists of quests. But if you made three pages, then you will have
# to add an additional set of switches in the Game_Temp class. If you look
# in Game_Temp, you will see arrays such as 'qupdate' and 'qupdate2'. For
# each additional quest page, you'll need to create an additional qupdate
# array such as qupdate3. In Game_Temp, you will need to add it into the
# Public Instance Variables (aka those attr_accessors), create it in the
# initialize method, and then add it into the for i in 0... loop.
#
# * The next thing you will need to do is edit the script to allow you to
# load and save the additional qupdate arrays you just created. These are
# easy to do just by copying the Marshall.load and Marshall.dump lines you
# will find in the script, and changing the qupdate names accordingly.
#
# * The nest step is to edit the 'initialize' method in Scene_Quests itself.
# Look at the 'case...end' block of code. Right now, it only has two sets
# of code, one that loads the data from the Game_Quest class into $qdata
# and copies the qupdate array into the @quest_sw value, and the other
# that copies the data from Game_Quest2.... etc. You will need to make a
# 3rd case that copies your new page (Game_Quest3 ? ) into $qdata and have
# it copy its qupdate3(?) array of switches into @quest_sw.
#
# * Finally, at the bottom of the script, in the 'update_command' method,
# there are two blocks of code that are executed when you press the left
# or right buttons. Within these are some 'case...end' blocks of code that
# will reload the Quest Log based on the which page/list you are currently
# using. So if you are currently on the 1st page/list of quests and hit
# the [align=right] button, you should go to the 2nd page. You will want to add
# additional code to allow you to switch to the 3rd page when you're cur-
# rently on the 2nd page when pressing the [align=right] button, or switch to
# the 3rd page when you're on the 1st one when hitting the [align=left] button.
#
# It'll take a little time to get it right for intermediate or beginner
# scripters, but not too long. Good luck
#
#------------------------------------------------------------------------------
#
# TERMS:
#
# Credit Jaberwocky if you use this.
#
#==============================================================================
module JABERWOCKY
module_function
# Quest Settings
# General default settings to customize
# your quest system and display.
Quest_Max = 10 # Maximum number of quests
Quest_Backgrd = "Menuback" # Optional 'nil' to use map as background
Quest_Opacity = 240 # Opacity of quest screen
Quest_Z = 990 # Adjustable Z-Depth for the quest screen
# Quest Icons
# The graphic icons that appear depending
# on whether a goal has or hasn't been reached.
# Must be placed in the Graphics\Icon folder.
# ==Optional. May set to 'nil'==
InProgress = "InProgressIcon"
Completed = "CompletedIcon"
# Coordinate Settings for the command window
# This affects the command window system
# and not the background image itself.
QCommand_X = -10
QCommand_Y = 50
QCommand_Width = 182
QCommand_Height = 380
# Coordinate Settings for the description window
# This affects the placement of the quest text
# and not the background image itself.
QDescrips_X = 160
QDescrips_Y = 75
QDescrips_Width = 480
QDescrips_Height = 480
end
#==============================================================================
# ** Bitmap
#------------------------------------------------------------------------------
# The bitmap class. Bitmaps are expressions of so-called graphics.
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# * Object Initialization
# x : x-coordinates
# y : y-coordinates
# width : window width
# height : window height
# align : text alignment
# ouline : text outline color
# inside : text interior color
#--------------------------------------------------------------------------
def draw_text_outline_custom(x, y, width, height, text, align, outline, inside)
if $qdata.useoutlines == true
self.font.color = outline
draw_text(x + 1, y + 1, width, height, text, align)
draw_text(x + 1, y - 1, width, height, text, align)
draw_text(x - 1, y - 1, width, height, text, align)
draw_text(x - 1, y + 1, width, height, text, align)
end
self.font.color = inside
draw_text(x, y, width, height, text, align)
end
end
#==============================================================================
# ** 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 :map_bgm # map music (for battle memory)
attr_accessor :qupdate # quest switch arrays
attr_accessor :qupdate2 # quest switch arrays
attr_accessor :quest_menu_calling # quest calling flag (menu)
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias asdfghjkl initialize
def initialize
# Perform the original call
asdfghjkl
# Create the quest switch arrays
@qupdate = []
@qupdate2 = []
# Set the default call switch
@quest_menu_calling = false
# Increase the switch arrays to the number of quests
for i in 0...JABERWOCKY::Quest_Max
@qupdate[i] = []
@qupdate2[i] = []
end
end
end
#==============================================================================
# ** Window_Quest
#------------------------------------------------------------------------------
# This window displays the quest screen, including the descriptive text and
# the goals for the quest in progress. Goals change colors and have an icon
# next to them.
#==============================================================================
class Window_Quest < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, JABERWOCKY::QDescrips_Width, JABERWOCKY::QDescrips_Height)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Set the line count to 0
y = 0
# For every line in the description array
for i in 0...$qdata.desc[$scene.quest_id[$scene.command_window.index]].size
# Draw each line of text
self.contents.draw_text_outline_custom(2, 24 * y,
JABERWOCKY::QDescrips_Width, 32, $qdata.desc[$scene.
quest_id[$scene.command_window.index]][i], 0, $qdata.descoutline,
$qdata.desctext)
# Increase the line count
y += 1
end
# For each line in the goal array
for i in 0...$qdata.goals[$scene.quest_id[$scene.command_window.index]].size
# Increase the line count
y += 1
# If this goal has been completed
if $scene.quest_sw[$scene.quest_id[$scene.command_window.index]][i + 1]
# Draw the completed icon if available
unless JABERWOCKY::Completed == nil
bitmap = RPG::Cache.icon(JABERWOCKY::Completed)
self.contents.blt(0, 4 + ( y * 24) , bitmap, Rect.new(0, 0, 18, 18))
end
# Draw each line of text
self.contents.draw_text_outline_custom(24, 0 + (y * 24),
JABERWOCKY::QDescrips_Width-24, 24, $qdata.goals[$scene.
quest_id[$scene.command_window.index]][i], 0, $qdata.compoutline,
$qdata.comptext)
# If this goal has not been reached
else
# Draw the incomplete icon if available
unless JABERWOCKY::InProgress == nil
bitmap = RPG::Cache.icon(JABERWOCKY::InProgress)
self.contents.blt(0, 4 + ( y * 24) , bitmap, Rect.new(0, 0, 18, 18))
end
# Draw each line of text
self.contents.draw_text_outline_custom(24, 0 + (y * 24),
JABERWOCKY::QDescrips_Width-24, 24, $qdata.goals[$scene.
quest_id[$scene.command_window.index]][i], 0, $qdata.incompoutline,
$qdata.incomptext)
end
end
end
end
#==============================================================================
# ** Window_QCmand
#------------------------------------------------------------------------------
# This window displays the list of quests on the left.
#==============================================================================
class Window_Qmand < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# width : window width
# commands : command text string array
#--------------------------------------------------------------------------
def initialize(commands)
super(JABERWOCKY::QCommand_X, JABERWOCKY::QCommand_Y,
JABERWOCKY::QCommand_Width, JABERWOCKY::QCommand_Height)
self.contents = Bitmap.new(width - 32, commands.size * 32)
@commands = commands
@item_max = @commands.size
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@commands.size
self.contents.draw_text_outline_custom(0, 32 * i, self.contents.width, 32,
@commands[i],1, $qdata.menuoutline, $qdata.menutext)
end
end
end
#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
# This class performs save screen processing.
#==============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# * Write Save Data
# file : write file object (opened)
#--------------------------------------------------------------------------
alias qwertyuiop write_save_data
def write_save_data(file)
# Perform the original call
qwertyuiop(file)
# Save the quest switch data
Marshal.dump($game_temp.qupdate, file)
Marshal.dump($game_temp.qupdate2, file)
end
end
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
# This class performs load screen processing.
#==============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# * Read Save Data
# file : file object for reading (opened)
#--------------------------------------------------------------------------
alias zxcvbnm read_save_data
def read_save_data(file)
# Perform the original call
zxcvbnm(file)
# Load the quest switch data
$game_temp.qupdate = Marshal.load(file)
$game_temp.qupdate2 = Marshal.load(file)
end
end
#==============================================================================
# ** Scene_Quests
#------------------------------------------------------------------------------
# This class performs quest screen processing.
#==============================================================================
class Scene_Quests
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :quest_id # quest ID numbers
attr_accessor :command_window # command window
attr_accessor :quest_sw # quest switches
#--------------------------------------------------------------------------
# * Object Initialization
# list : quest list number
#--------------------------------------------------------------------------
def initialize(list = 1)
@quest_index = 0
@currentlist = list
case list
# HEREIN DECIDES WHICH PAGE TO SWITCH
when 1 ; $qdata = Game_Quest.new
@quest_sw = $game_temp.qupdate
when 2 ; $qdata = Game_Quest2.new
@quest_sw = $game_temp.qupdate2
# ===================================
end
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Displays the background picture, or the map if set to nil
if JABERWOCKY::Quest_Backgrd == nil
@spriteset = Spriteset_Map.new
else
@backpic = Sprite.new
@backpic.bitmap = RPG::Cache.picture(JABERWOCKY::Quest_Backgrd)
@backpic.z = JABERWOCKY::Quest_Z
end
# Show the quest page's pic if available
unless $qdata.backpicture == nil
@questback = Sprite.new
@questback.bitmap = RPG::Cache.picture($qdata.backpicture)
@questback.opacity = JABERWOCKY::Quest_Opacity
@questback.z = JABERWOCKY::Quest_Z + 1
end
# Create the quest arrays
questwin = []
@quest_id = []
# Increase the switch arrays to the number of quests
for i in 1...JABERWOCKY::Quest_Max
if @quest_sw[i][0] == true
questwin.push($qdata.name[i])
@quest_id.push(i)
end
end
# Add the quest names to the command window array
if questwin.size == 0
questwin.push($qdata.name[0])
@quest_id.push(0)
end
# Create the quest command window
@command_window = Window_Qmand.new(questwin)
@command_window.index = @quest_index
@command_window.opacity = 0
@command_window.z = JABERWOCKY::Quest_Z + 2
# Create the window for the description text and goals:
@desc_window = Window_Quest.new
@desc_window.x = JABERWOCKY::QDescrips_X
@desc_window.y = JABERWOCKY::QDescrips_Y
@desc_window.z = JABERWOCKY::Quest_Z + 2
@desc_window.opacity = 0
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update_command
# Abort loop if screen is changed
break if $scene != self
end
# Dispose of the command and description windows
@command_window.contents.clear
@command_window.dispose
@desc_window.contents.clear
@desc_window.dispose
# Dispose the background picture or spritesheet
if JABERWOCKY::Quest_Backgrd == nil
@spriteset.dispose
else
@backpic.dispose
end
# Dispose the quest page picture if it exists
unless $qdata.backpicture == nil
@questback.dispose unless @questback == nil
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If the up directional button was pressed
if Input.repeat?(Input::UP)
if @command_window.index == 0
@command_window.index = @quest_id.size - 1
else
@command_window.index -= 1
end
unless @quest_id.size == 1
# Play cursor SE
$game_system.se_play($data_system.cursor_se) unless @quest_id.size == 1
# Refresh the description window
@desc_window.refresh
end
end
# If the down directional button was pressed
if Input.repeat?(Input::DOWN)
if @command_window.index == @quest_id.size - 1
@command_window.index = 0
else
@command_window.index += 1
end
unless @quest_id.size == 1
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# Refresh the description window
@desc_window.refresh
end
end
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# If called from the menu
if $game_temp.quest_menu_calling
# Clear save call flag
$game_temp.quest_menu_calling = false
# Switch to the menu screen
$scene = Scene_Menu.new(4)
return
end
# Switch to the map screen
$scene = Scene_Map.new
return
end
# If the left directional button was pressed
if Input.trigger?(Input::LEFT)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# Dispose the quest page picture if it exists
@questback.dispose unless $qdata.backpicture == nil
# Branch by currently loaded quest page
case @currentlist
# HEREIN DECIDES WHICH PAGE TO SWITCH
when 1 ; $scene = Scene_Quests.new(2)
when 2 ; $scene = Scene_Quests.new(1)
# ===================================
end
end
# If the right directional button was pressed
if Input.trigger?(Input::RIGHT)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# Dispose the quest page picture if it exists
@questback.dispose unless $qdata.backpicture == nil
# Branch by currently loaded quest page
case @currentlist
# HEREIN DECIDES WHICH PAGE TO SWITCH
when 1 ; $scene = Scene_Quests.new(2)
when 2 ; $scene = Scene_Quests.new(1)
# ===================================
end
end
end
end
Quest List
Code:
#==============================================================================
# ** Game_Quest
#------------------------------------------------------------------------------
# This class handles all the data for the quests. If you want to add a new
# set of quests, it is entered here. To add another list, you need to add
# a different class name, such as Game_Quest2/3/4/5/6/etc...
#==============================================================================
class Game_Quest
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :name, :useoutlines, :backpicture,
:goals, :incompoutline, :incomptext, :compoutline, :comptext,
:desc, :descoutline, :desctext, :menuoutline, :menutext
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@name, @desc, @goals = [], [], []
for i in 0...JABERWOCKY::Quest_Max
@desc[i], @goals[i] = [], []
end
#------------------------------------------------------------------------
# * Editables:
#------------------------------------------------------------------------
# Quest Menu Background Picture
# Stored in the Graphics/Pictures folder.
@backpicture = "InProgressQuestScroll"
# Outline On/Off Switch ((set to false if you don't want outlines
@useoutlines = true
#-------------------------------------------------------------------------
# Text Color Settings (outline color and interior/regular text color)
# - Command Menu settings:
@menuoutline = Color.new(0, 0, 0, 255)
@menutext = Color.new(255, 255, 255, 255)
# - Description settings:
@descoutline = Color.new (0, 0, 0, 255)
@desctext = Color.new (255, 255, 255, 255)
# - Incomplete goal settings:
@incompoutline = Color.new(0, 0, 0, 255)
@incomptext = Color.new(255, 0, 0, 255)
# - Completed goal settings:
@compoutline = Color.new(0, 0, 0, 255)
@comptext = Color.new(0, 255, 0, 255)
#-------------------------------------------------------------------------
# Empty Quest Data
# - Text shown in the command and description window when there are
# no quests to perform.
# The format for your description text is as follows:
# @desc[quest#] = ["line 1", "line 2", "line 3", "etc..."]
@name[0] = "No Quests"
@desc[0] = ["I am not currently on any quests."]
#-------------------------------------------------------------------------
# Quest Data
# - Text shown for each quest: The name, description and goals
# The format for descriptions are as follows:
# @desc[quest#] = ["line 1", "line 2", "line 3", "etc..."]
# Note: If you have too many lines of description you can run out of
# room for goals to show
# The format for @goals (if any) are the same as for descriptions.
# QUEST #1
@name[1] = "Get some rest!"
@desc[1] = ["Even with 2 years of training,",
"I was unable to best Pengzoda...",
"Why has he shown himself after all this time?",
"What are these 'things at work' he spoke of?",
"Why did he spare my life a second time?",
"...Not that I'm complaining about that one...", " ",
"These are questions for another time.",
"Right now I need to make it back to my house",
"and rest so I can recover from this injury."]
@goals[1] = ["-Make it back to your house",
"-Rest so that your wound can recover"]
#------------------------------------------------------------------------
# * End of Editables
#------------------------------------------------------------------------
end
end
Quest List #2 (completed quests)
Virtually Identical
Code:
#==============================================================================
# ** Game_Quest2
#------------------------------------------------------------------------------
# This class handles all the data for the quests. If you want to add a new
# set of quests, it is entered here. To add another list, you need to add
# a different class name, such as Game_Quest2/3/4/5/6/etc...
#==============================================================================
class Game_Quest2
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :name, :useoutlines, :backpicture,
:goals, :incompoutline, :incomptext, :compoutline, :comptext,
:desc, :descoutline, :desctext, :menuoutline, :menutext
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@name, @desc, @goals = [], [], []
for i in 0...JABERWOCKY::Quest_Max
@desc[i], @goals[i] = [], []
end
#------------------------------------------------------------------------
# * Editables:
#------------------------------------------------------------------------
# Quest Menu Background Picture
# Stored in the Graphics/Pictures folder.
@backpicture = "CompletedQuestScroll"
# Outline On/Off Switch ((set to false if you don't want outlines
@useoutlines = true
#-------------------------------------------------------------------------
# Text Color Settings (outline color and interior/regular text color)
# - Command Menu settings:
@menuoutline = Color.new(0, 0, 0, 255)
@menutext = Color.new(255, 255, 255, 255)
# - Description settings:
@descoutline = Color.new (0, 0, 0, 255)
@desctext = Color.new (255, 255, 255, 255)
# - Incomplete goal settings:
@incompoutline = Color.new(0, 0, 0, 255)
@incomptext = Color.new(255, 0, 0, 255)
# - Completed goal settings:
@compoutline = Color.new(0, 0, 0, 255)
@comptext = Color.new(0, 255, 0, 255)
#-------------------------------------------------------------------------
# Empty Quest Data
# - Text shown in the command and description window when there are
# no quests to perform.
# The format for your description text is as follows:
# @desc[quest#] = ["line 1", "line 2", "line 3", "etc..."]
@name[0] = "No Quests"
@desc[0] = ["I have not completed any quests."]
#-------------------------------------------------------------------------
# Quest Data
# - Text shown for each quest: The name, description and goals
# The format for descriptions are as follows:
# @desc[quest#] = ["line 1", "line 2", "line 3", "etc..."]
# Note: If you have too many lines of description you can run out of
# room for goals to show
# The format for @goals (if any) are the same as for descriptions.
# QUEST #1
@name[1] = "Got some rest!"
@desc[1] = ["Even with 2 years of training,",
"I was unable to best Pengzoda...",
"Why has he shown himself after all this time?",
"What are these 'things at work' he spoke of?",
"Why did he spare my life a second time?",
"...Not that I'm complaining about that one...", " ",
"These are questions for another time.",
"Right now I need to make it back to my house",
"and rest so I can recover from this injury."]
@goals[1] = ["-Make it back to your house",
"-Rest so that your wound can recover"]
#------------------------------------------------------------------------
# * End of Editables
#------------------------------------------------------------------------
end
end
Optional edit for the Default Menu System
Main Code
Code:
#-------------------------------------------------------------------------------
# This rewrite of Scene_Menu just adds the Quests option into the menu, and it
# makes the number of menu features longer.
#
# I did not edit any other window in the system, so you will see the QUIT option
# print overtop of the Game Time window in the screen. I merely wanted to show
# how to call the Quest Window from a menu or script.
#-------------------------------------------------------------------------------
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make command window
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
# Changed the s5 from Save to Quests, added an s7 to make the list longer
s5 = "Quests"
s6 = "Save"
s7 = "End Game"
# Added the s7 to the command window
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
# If number of party members is 0
if $game_party.actors.size == 0
# Disable items, skills, equipment, and status
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# Make play time window
@playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 224
# Make steps window
@steps_window = Window_Steps.new
@steps_window.x = 0
@steps_window.y = 320
# Make gold window
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 416
# Make status window
@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Item.new
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
# Changed #4 to the Quest menu (instead of save)
when 4 # quest
# This is for quests now:
$game_temp.quest_menu_calling = true
$scene = Scene_Quests.new
# Changed 5 on down to keep save and quit in the menu...
when 5 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
when 6 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
end
return
end
end
end
Instructions
Plenty... all built into the script.
Resources
By default this system asks for the following graphic images stored in the Graphics\Pictures folder.
Menu backgrounds
By default, named 'InProgressQuestScroll.png'
By default, named 'CompletedQuestScroll.png'
By default, named 'Menuback.png'
By default, named 'CompletedQuestScroll.png'
By default, named 'Menuback.png'
And these icons, to be stored in the Graphics\Icons folder:
By default, named 'InProgressIcon.png'
By default, named 'CompletedIcon'
Notes
This system allows you to track the progress of a quest by turning on/off built-in switches built into Game_Temp. However, there is no 'automated' system to log a script as completed once the last goal has been reached... no system to count the number of completed goals in a single quest. That feature is still up to the end user of this system.
Compatibility
RPGMaker XP system only. Highly compatible though.
Terms and Conditions
Please credit Jaberwocky for this system.