ALRIGHT so I know this is a TERRIBLE necro post but I have added functionality to this to make it more available for those who have or wish to add this script to their Scene_Menu. First, I will describe how to use it.
in your scene menu, in the update_command section (where you added the functionality for it to go to the quest log and made it play the sound effect), you will make it look like this (replacing the "3" with whatever case it is in your script):
when 3 # Quest Log
# Play decision SE
if $game_party.quests_avail == false
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Quest.new
That is only step one. You will want to also grey-out your Quest Log option(more than likely, unless you are a trickster and like to prank the people who play your game into thinking its broken...). Do so like this (again, replacing "3" with whatever case it is in your script):
if $game_party.quests_avail == false
#disable quest log
@command_window.disable_item(3)
end
Now, your menu is finished. Now you need to update your quest log script. Here is the quest log script as I have it now (any updates to this quest log made after the version I grabbed will not be available with this functionality unless it was already added and I was not privy to such information).
#===============================================================================
# Quest Log System
# Author game_guy
# Updated by Lethrface
# Version 3.1
# Date: 1-28-2012
#-------------------------------------------------------------------------------
# Intro:
# A script that keeps track of quests you obtain and complete.
#
# Features:
# Marks quest names with a yellow color if they're completed
# Easy to setup one quest
# Be able to use a fairly long description
# Be able to display a picture
# Easy to add and complete a quest
# More compatible than earlier versions
# *NEW!!!* Able to call a check to see if the Quest log has any quests available
#
# Instructions:
# Scroll down a bit until you see # Being Config. Follow the instructions there.
# Scroll below that and you'll see Begin Quest Setup. Follow the steps there.
#
# Script Calls:
# Quest.add(id) ~ Adds the quest(id) to the parties quests.
# Quest.take(id) ~ Takes the quest(id) from the party.
# Quest.complete(id) ~ Makes the quest(id) completed.
# Quest.completed?(id) ~ Returns true if the quest(id) is completed.
# Quest.has?(id) ~ Returns true if the party has quest(id).
# $scene = Scene_Quest.new ~ Opens the quest menu.
#
# Credits:
# game_guy ~ for making it
# Beta Testers ~ Sally and Landith
# Blizzard ~ Small piece of code I borrowed from his bestiary
# Steven Wallace a.k.a Lethrface ~ adding ability to check for available quests
#===============================================================================
module GameGuy
#==================================================
# Begin Config
# UsePicture ~ true means it'll show pictures in
# the quests, false it wont.
#==================================================
UsePicture = false
def self.qreward(id)
case id
#==================================================
# Quest Reward
# Use when x then return "Reward"
# x = id, Reward = reward in quotes
#==================================================
when 1 then return "100 Gold"
when 2 then return "3 Potions"
when 3 then return "Strength Ring"
end
return "????"
end
def self.qpicture(id)
case id
#==================================================
# Quest Picture
# Use when x then return "picture"
# x = id, picture = picutre name in quotes
#==================================================
when 1 then return "ghost"
end
return nil
end
def self.qname(id)
case id
#==================================================
# Quest Name
# Use when x then return "name"
# x = id, name = quest name in quotes
#==================================================
when 1 then return "Village Hunt"
when 2 then return "Pay Tab"
when 3 then return "Hunting Knife"
end
return ""
end
def self.qlocation(id)
case id
#==================================================
# Quest Location
# Use when x then return "location"
# x = id, location = location in quotes
#==================================================
when 1 then return "Arton Woods"
when 2 then return "Eeka"
when 3 then return "Eeka"
end
return "????"
end
def self.qdescription(id)
case id
#==================================================
# Quest Description
# Use when x then return "description"
# x = id, description = quest description in quotes
#==================================================
when 1 then return "Extremely LOOOOOOOOOOONNNNNNGGGGGGGG quest description as you can see this goes on for awhile. :P:P:P:P:P"
when 2 then return "Bring gold to Jarns Defense to pay her tab."
when 3 then return "Go get Kip a hunting knife from Eeka."
end
return ""
end
end
module Quest
def self.add(id)
$game_party.add_quest(id)
end
def self.take(id)
$game_party.take_quest(id)
end
def self.complete(id)
$game_party.complete(id)
end
def self.completed?(id)
return $game_party.completed?(id)
end
def self.has?(id)
return $game_party.has_quest?(id)
end
def self.check
return $game_party.check_quests
end
end
class Game_Party
attr_accessor :quests
attr_accessor :completed
attr_accessor :quests_avail
alias gg_quests_lat initialize
def initialize
@quests = []
@completed = []
gg_quests_lat
@quests_avail = false
end
def add_quest(id)
unless @quests.include?(id)
@quests.push(id)
end
end
def completed?(id)
return @completed.include?(id)
end
def complete(id)
unless @completed.include?(id)
if @quests.include?(id)
@completed.push(id)
end
end
end
def has_quest?(id)
return @quests.include?(id)
end
def take_quest(id)
@quests.delete(id)
@completed.delete(id)
end
def check_quests
if @quests == []
@quests_avail = false
else
@quests_avail = true
end
end
end
class Scene_Quest
def main
@quests = []
for i in $game_party.quests
@quests.push(GameGuy.qname(i))
end
#@map = Spriteset_Map.new
@quests2 = []
for i in $game_party.quests
@quests2.push(i)
end
@quests_window = Window_Command.new(160, @quests)
@quests_window.height = 480
@quests_window.back_opacity = 255
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
@quests_window.dispose
@quest_info.dispose if @quest_info != nil
#@map.dispose
end
def update
@quests_window.update
if @quests_window.active
update_quests
return
end
if @quest_info != nil
update_info
return
end
end
def update_quests
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new
return
end
if Input.trigger?(Input::C)
if @quests != [""]
$game_system.se_play($data_system.decision_se)
@quest_info = Window_QuestInfo.new(@quests2[@quests_window.index])
@quest_info.back_opacity = 110
@quests_window.active = false
return
end
end
end
def update_info
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@quests_window.active = true
@quest_info.dispose
@quest_info = nil
return
end
end
end
class Window_QuestInfo < Window_Base
def initialize(quest)
super(160, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
@quest = quest
refresh
end
def refresh
self.contents.clear
if GameGuy::UsePicture
pic = GameGuy.qpicture(@quest)
bitmap = RPG::Cache.picture(GameGuy.qpicture(@quest)) if pic != nil
rect = Rect.new(0, 0, bitmap.width, bitmap.height) if pic != nil
self.contents.blt(480-bitmap.width-32, 0, bitmap, rect) if pic != nil
end
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 480, 32, "Quest:")
self.contents.font.color = normal_color
self.contents.draw_text(0, 32, 480, 32, GameGuy.qname(@quest))
self.contents.font.color = system_color
self.contents.draw_text(0, 64, 480, 32, "Reward:")
self.contents.font.color = normal_color
self.contents.draw_text(0, 96, 480, 32, GameGuy.qreward(@quest))
self.contents.font.color = system_color
self.contents.draw_text(0, 128, 480, 32, "Location:")
self.contents.font.color = normal_color
self.contents.draw_text(0, 160, 480, 32, GameGuy.qlocation(@quest))
self.contents.font.color = system_color
self.contents.draw_text(0, 192, 480, 32, "Completion:")
self.contents.font.color = normal_color
if $game_party.completed.include?(@quest)
self.contents.font.color = crisis_color
self.contents.draw_text(0, 224, 480, 32, "Completed")
else
self.contents.font.color = normal_color
self.contents.draw_text(0, 224, 480, 32, "In Progress")
end
self.contents.font.color = system_color
self.contents.draw_text(0, 256, 480, 32, "Description:")
self.contents.font.color = normal_color
text = self.contents.slice_text(GameGuy.qdescription(@quest), 460)
text.each_index {|i|
self.contents.draw_text(0, 288 + i*32, 460, 32, text[i])}
end
end
class Bitmap
def slice_text(text, width)
words = text.split(' ')
return words if words.size == 1
result, current_text = [], words.shift
words.each_index {|i|
if self.text_size("#{current_text} #{words[i]}").width > width
result.push(current_text)
current_text = words[i]
else
current_text = "#{current_text} #{words[i]}"
end
result.push(current_text) if i >= words.size - 1}
return result
end
end
Now, you have something to work with, but wait...there's more!
What if you want to add a quest or take away a quest? By default, the menu is disabled so if you add a quest, you wont be able to access the quest! Now, I could have simply made it check the quest automatically upon adding/taking the quests but I like to add the OPTION to be able to do this without forcing you to do it (and also because I have some plans that will require this option to be available in my own game). This allows you to give someone a quest and keep the quest log unavailable until you are ready to do this if you for some reason wish to do so here is a way to handle this type of thing. Keep in mind there are many ways to handle this (some will require some more editing of the Quest Log script), but this is just something i was playing around with (and probably in no way the easy way lol)
Here is an image of the event that I gave an npc as an example of using the check to see if any quests are available.
As you can see, I added a new script call. Quest.check will check your quests array to see if there are any quests available and if there aren't any, it will disable or enable your Quest Log command in the menu. This will further help avoid getting the error that you receive when you have no quests in your quest log. Remember you want to add a Quest.check command to each of your add or take calls to let the game decide whether the quest log needs to be enabled or disabled and if it is left enabled when you take away all of your quests then you will run the risk of the player getting that nasty error and if its left disabled when you just gave the player a quest, it will not be viewable to the player and thus deemed broken!
PHEW!!! Long winded reply/update over! Sorry to the original author of the script for working on this without asking for permission but I felt it was long-overdue for an update. If this has been updated in another post with a totally different version, well...then blame google for not taking me to the new quest log script upon searching for one!