The RPG Maker Resource Kit

RMRK RPG Maker Creation => XP => XP Scripts Database => Topic started by: game_guy on June 01, 2009, 12:29:27 AM

Title: [XP] Quest Log System
Post by: game_guy on June 01, 2009, 12:29:27 AM
Quest Log System
Authors: game_guy
Version: 3.0
Type: Mission Logger
Key Term: Misc System

Introduction

A script that keeps track of quests you obtain and complete.

Features


Screenshots
Spoiler for:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi678.photobucket.com%2Falbums%2Fvv143%2FGameGuysProjects%2F1-21-20107-34-54PM.png&hash=098bd28b0376827b2de8f8d8f1ddd1adf73a16e1)

Demo

Mediafire (http://www.mediafire.com/download.php?mjmjtw2nham)

Script

Spoiler for:
Code: [Select]
#===============================================================================
# Quest Log System
# Author game_guy
# Version 3.0
#-------------------------------------------------------------------------------
# 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
#
# 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
#===============================================================================
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
  
end
  
class Game_Party
  
  attr_accessor :quests
  attr_accessor :completed
  
  alias gg_quests_lat initialize
  def initialize
    @quests = []
    @completed = []
    gg_quests_lat
  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
  
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 = 110
    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)
      $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
  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

Instructions

In the script.

Compatibility

Not tested with SDK.
Works with all of my scripts and blizzard's scripts. (Tested with most add-ons and all of his scripts)

Credits and Thanks


Author's Notes

Enjoy and give credits
Title: Re: [XP] Quest Log System
Post by: modern algebra on June 01, 2009, 01:48:13 AM
I like that you use items here to track the quests. I'm not sure I like the design of the script. It seems kind of plain. Anyway, nice work on this game guy.
Title: Re: [XP] Quest Log System
Post by: game_guy on June 01, 2009, 01:51:53 AM
thanks, if you can whip up some sort of image on how I can make it look I'll change it. I had to make the thing so large because the window was displaying the quest info and the info was the item description.
Title: Re: [XP] Quest Log System
Post by: modern algebra on June 01, 2009, 02:01:15 AM
Well, my #1 suggestion without adding features to the script would be to set the info in a window in the quest screen, rather than giving it such a big window. ALl of that information can fit in the half-screen gap in the Quest selection screen, aside from the description, and with that I would suggest you just break it into lines. Rather, than draw it in one long line, calculate and make it into another line if it goes over. That's what I did for the quest system I made for VX.

Anyway, it's just a preference thing for me. You certainly don't need to take a suggestion from me. It's fine as is.
Title: Re: [XP] Quest Log System
Post by: game_guy on June 01, 2009, 09:31:12 PM
Could you help me with making the text be in a paragraph please? I cant figure out how to make it go to a new line if its too long
Title: Re: [XP] Quest Log System
Post by: modern algebra on June 01, 2009, 09:46:35 PM
I actually wrote a scripting too to help with that a long time ago: http://rmrk.net/index.php/topic,22215.0.html
Title: Re: [XP] Quest Log System
Post by: game_guy on June 01, 2009, 10:04:35 PM
Mind if I include the script in my next version? That way it'll be easier to see the text and be able to have more of a description. Thanks in advance!
Title: Re: [XP] Quest Log System
Post by: modern algebra on June 01, 2009, 10:40:38 PM
Nah, of course you can include it. That's what it's there for :)
Title: Re: [XP] Quest Log System
Post by: Buland on June 02, 2009, 07:57:39 AM
Amazing new script! Finally a Quest Log for XP!   :D

I can't wait for the next version to come by!

P.S. How many quests can this deal with?
Title: Re: [XP] Quest Log System
Post by: game_guy on June 04, 2009, 03:48:51 AM
Ah shit I forgot to update the script here sorry guys :(

Ok I updated the post and this can have as many quests as you have items. I think the max items are 999 so you can have a total of 999 quests but of course you'll have regular items taking away at least 100-200 so that leaves you with 799-899 quests.

Title: Re: [XP] Quest Log System
Post by: Buland on June 23, 2009, 11:19:06 AM
That's more than enough for me! :D
Title: Problems :(
Post by: SeMcDun on June 30, 2009, 04:52:34 PM
Hey Game_Guy, nice work!

I have a little problem with it though :( seeing as I have little knowledge of the scripting language in use I don't know how to fix what seems to be wrong.

I pasted the code into my game and left it exactly the way it was to see how it worked at first and used an event to call item_id 34 like it already was. I made the item and away I went. The problem however was when I tried to click on a quest to get more info about the quest it comes up with this:


Script "Quest Log" line 292: NoMethodError occurred.

undefined method "new for #<Game_Item:0x33f2128
@completed = false>

:( any help would be greatly appreciated.

Thanks.
Title: Re: [XP] Quest Log System
Post by: game_guy on July 06, 2009, 06:45:21 PM
fixed ;)
Title: Re: [XP] Quest Log System
Post by: happyhibisci on July 16, 2009, 05:38:47 PM
Hey, this is a really nice script.  Clever too :)

Could you include a little more instruction though?  I would like to know if it's possible to change the reward after you complete a quest.  For example, when you receive a quest, I would like the "reward" to display "? ? ? ?" but after you complete the quest and receive a reward, I want it to say "3000 Gold" or something.  So is it possible to change it mid-game?

Also, I don't really understand how to use "$quest.quest(item id) > 0" as a condition branch.  I want someone to say 3 different things depending on the status of a Quest: Before you accept the quest, during the quest, and once the quest is completed.  How do I do that?

Thanks for any help, I appreciate it.  This script is awesome.
Title: Re: [XP] Quest Log System
Post by: eps5000 on September 15, 2009, 07:55:55 PM
This seems like an awsome script, however i wish that you could have written it to pull info from a .txt or .ini file, much more room to write description and specifics that way... Thx for the script, ill b sure to cite you!
Title: Re: [XP] Quest Log System
Post by: tidloc on September 15, 2009, 08:36:41 PM
This seems like an awsome script, however i wish that you could have written it to pull info from a .txt or .ini file, much more room to write description and specifics that way... Thx for the script, ill b sure to cite you!

That shouldn't be a problem.
If you're intrested in that kind of script, i could make it.
Just tell me what features shall be realised and it will be done over the next weekend :D
PM or better e-mail me ^^
Title: Re: [XP] Quest Log System
Post by: Smooth on November 17, 2009, 10:59:48 PM
Nice script.. im using it for my game.

EDIT: it would be nice if you could use diferent icons depending in the quest just like in your archievment script(Gold,Silver or Bronze Type missions) according to the importance.. and uuhmm how do i change the the color of the text for "incomplete" and "complete"?? Yellow doesnt fit for a complete mission xD

EDIT2: Nevermind, made a little research and found out :)
Title: Re: [XP] Quest Log System
Post by: Frzanny on November 24, 2009, 06:58:16 AM
Hi, I'm new to RPG maker and everything, but i tried out your script and it was great. I was looking to make a game with my friend, i was just wondering if we could use your quest system in the game if we decided to sell the game. If we did, we would say it was made by you, not us.

Thanks, Frzanny
Title: Re: [XP] Quest Log System
Post by: Eternal on November 26, 2009, 08:13:45 PM
@Frzanny: You should probably PM him personally. If he doesn't answer, try PM'ing on another of the websites he's active on.

@Game_guy: Love it, and I'm probably going to use it, but let me come with a suggestion: Do so that when you select a quest it appears in the empty area instead of covering the whole screen. Example:

_______________
|______________|
|          |           |
|          |           |
| Quest | Quest  |
|  List!  |  Info!   |
|          |           |
|______|_______|

-Peace out
Title: Re: [XP] Quest Log System
Post by: game_guy on December 01, 2009, 06:51:54 AM
@Eternal: I may do that
@Franny: You can use it but if you sell it I get a free copy.
Title: Re: [XP] Quest Log System
Post by: Mr_Wiggles on December 01, 2009, 07:56:51 AM
i wounder if you could make it to where theres multiple parts to a mission, ie
kill 3 dragons, report to mr wiggles, give item to little girl. - idk lol

or

optional parts ie
collect 3 apples, give them to granny "or" sell them

or

like more detailed status of a mission ie
mission - find the lost sword and report to Lt mark
status:
found sword - completed
reported - incomplete
reward - not recived
or
mission - kill three knights and recive the holly grale then report to sister karen
status:
killed knights - completed
found grale - completed
talk to sister karen - incomplete
reward - not recived


just a few ideas
Title: Re: [XP] Quest Log System
Post by: game_guy on December 02, 2009, 02:24:14 AM
I plan on adding the multiple parts, and Im making it more compatible
Title: Re: [XP] Quest Log System
Post by: uncleiroh13 on December 19, 2009, 11:32:35 PM
Um im confused with this part here where do i find these?

CONFIG REWARD
CONFIG LOCATION
Title: Re: [XP] Quest Log System
Post by: game_guy on January 02, 2010, 07:16:24 PM
scroll down until you see a commented line that says CONFIG REWARD or CONFIG LOCATION
Title: Re: [XP] Quest Log System
Post by: xetjsin on January 13, 2010, 10:19:56 PM
Hi, sorry to bother, I really like this script and want to use it in my game, but was wondering something

I'm wanting to get rid of the Save option in the menu alltogether, and was wanting to replace it with "Quest" or "Log", could someone tell me how I'd do this?
Title: Re: [XP] Quest Log System
Post by: Eternal on January 17, 2010, 01:13:53 PM
Go to line 24 and replace "Save" with whatever you'd like the name on the list to be (just remember to put " around it)

Then replace line 150 through 160 with the following:

when 4  # save
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Quest.new

 Here's the default menu with the changes and including the save disabled part taken out (basically the things above)

Spoiler for:
Code: [Select]
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Quest Log"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @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
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(4)
    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
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @playtime_window.update
    @steps_window.update
    @gold_window.update
    @status_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  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
      when 4  # save
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Quest.new
      when 5  # 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
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 1  # skill
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # 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 skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end
Title: Re: [XP] Quest Log System
Post by: game_guy on January 31, 2010, 03:13:08 AM
updated, this is a lot more compatible now with more scripts
Title: Re: [XP] Quest Log System
Post by: DerVVulfman on February 11, 2010, 05:25:05 AM
'Ello.  I was asked to take a look at this and I found a problem.

You see, if you access the Scene_Quest routine before you add any quests (like in your demo), you run into an error that will make the system crash.  You see, when you don't have any loaded quests, the routine tries to pass an empty array of quests into Window_Command.  Without commands, the system crashes.

You could add a default 'No Quests' command to the list of your quests if the quest array is empty, and make sure hitting the no quest option takes you out of the routine or something.

 :zwink: -DerVV
Title: Re: [XP] Quest Log System
Post by: meiko_suzuki on March 27, 2010, 11:21:59 PM
Great script game guy, but I was just wondering, is it possible to remove quests from the quest log?  ??? Or did I just miss that entirely in your excellent description?

Thanks,
-Meiko
Title: Re: [XP] Quest Log System
Post by: game_guy on March 28, 2010, 04:32:07 AM
Quest.take(id)
Title: Re: [XP] Quest Log System
Post by: Adrien on March 29, 2010, 02:01:19 PM
I always seem to find some incompatibility with your scripts compared to mind....

anyways: (https://rmrk.net/proxy.php?request=http%3A%2F%2Ffc06.deviantart.net%2Ffs71%2Ff%2F2010%2F088%2F5%2F9%2Fqwer56789iol_by_CreatedThoughts.png&hash=b60bd827e5ec432f08065f590ca683f344a73517)

This is caused when using: $scene = Scene_Quest.new

Main Script I am using is the Spanish to English translation of FF12's battle system
Title: Re: [XP] Quest Log System
Post by: Mr_Wiggles on March 29, 2010, 08:42:55 PM
Well i know that this script will crash if there are no quests in the Quest menu.
Title: Re: [XP] Quest Log System
Post by: game_guy on March 30, 2010, 01:01:59 AM
sorry I just don't have the time to fix that small mistake.

But do know this, I plan on re-making the quest system (3rd time now) that way you will get no errors at all and it'll look much nicer.
Title: Re: [XP] Quest Log System
Post by: Mr_Wiggles on March 30, 2010, 03:16:00 AM
well you don't have to rebuild each time, you can just improve on what you have, which this second build is better then your first I must say.

i fixed it by adding this to line 188 "@quests = [""] if @quests == []"
Title: Re: [XP] Quest Log System
Post by: game_guy on April 02, 2010, 02:17:13 AM
I know, I'm just not happy with the design.
Title: Re: [XP] Quest Log System
Post by: Mr_Wiggles on April 02, 2010, 02:28:36 AM
I like it, but if you have visions of something better, then I can't wait to see it.
Title: Re: [XP] Quest Log System
Post by: lekiller on June 05, 2010, 01:57:05 PM
Hello game_guy.
I really love your script, its very easy to use and usefull, but i have one question:
How can i sort list of quests by process of quest?
I mean: uncompleted quests will be at the top, completed in bottom.
Sorry for my bad english.
BTW: i have remaked your script that i have there: in progress, completed, failed (red font) so i want to sort them (quests) in that queue:
In progress
Completed
Failed
THX for reply and THX for this really extremely nice script.
Title: Re: [XP] Quest Log System
Post by: game_guy on June 06, 2010, 03:09:49 AM
Well when I get to remaking it I might add that feature. I really haven't done much in RMXP lately but I'll see if I can get back into it.
Title: Re: [XP] Quest Log System
Post by: lekiller on June 06, 2010, 07:24:24 AM
Well, I'm looking forward to it. I hope you will update your script soon, because you are making the best scripts. Like item storage, very useful. Thx a lot  :lol:
Title: Re: [XP] Quest Log System
Post by: outlandish on June 10, 2010, 05:15:51 PM
Great job on this Game_Guy! This is my favorite quest log script. There's others that have more features, but the missions aren't as easy to set up. Yours is so easy to customize. I also added in support for the mission arrows script so that when you select a mission in the quest log, it will show direction arrows to help you find the mission location as long as the location name is the same as the current map name. So far it seems to work really well. Thanks for the great work :D
Title: Re: [XP] Quest Log System
Post by: game_guy on June 10, 2010, 06:48:27 PM
Haha thanks! I'm remaking it and missions are going to have parts.
Get the Apples
Part 1: Collect 5 Apples
Part 2: Return them to Ms. Biggy
Title: Re: [XP] Quest Log System
Post by: lekiller on June 11, 2010, 09:15:19 AM
Wow  :D That will be nice, but one thing, keep it simple, thats why lot of people <3 your script.
Title: Re: [XP] Quest Log System
Post by: game_guy on July 03, 2010, 09:40:03 PM
Okay I lost my main computer. Little brother poured soda all over the tower while I was hanging with some friends. So much for mom watching him >__>

Anyways I've gotta restart on all my progress I made. Heres what I plan to add:
Thats all I can remember for now. Look for the update =)
Title: Re: [XP] Quest Log System
Post by: Demonaci on July 07, 2010, 01:10:13 AM
man game_guy I love you script I been trying to make one my own but have no idea what i am doing :D i cant wait until the new verison comes out cause of the end game thing but lets have some fun
Title: Re: [XP] Quest Log System
Post by: Wrinkle on August 26, 2010, 05:23:31 PM
I love your script and it's been working for me for the most while, but now that I got to 4 and 5 quests it won't work.
I keep getting an error "Script 'Quest Log' line 263: SyntaxError occurred." It won't let me go to the title screen but if i take out just the quest descriptions i can get to the title screen. Can anybody help.

thats line 262 and 263
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 480, 32, "Quest:")

and thats the descriptions
    when 1 then return "Go North of Alae Forest and gain entrance to Mount Alae (Ryan is required for this quest)."
    when 2 then return "Go back to the Underground Sanctum and tell the rest what happened."
    when 3 then return "Go to Mine Town find some Tobacco to make smokes for Ben, Shawn, and Girv so you can play as them again."
    when 4 then return "Go to the Glacier River and find the Ice Sword (Ben is required for this quest)."
    when 5 then return "Go to the Desert Of Alae and find the Lightning Sword (Dustin is required for this quest).
    end
    return ""

i'm not good with scripting if someone can help me that would be great.
Title: Re: [XP] Quest Log System
Post by: Wrinkle on August 26, 2010, 06:18:11 PM
never mind im an idiot, i found the problem i was missing a "
Title: Re: [XP] Quest Log System
Post by: Lethrface on January 28, 2012, 07:26:29 PM
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):

Code: [Select]
        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):

Code: [Select]
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).

Code: [Select]
#===============================================================================
# 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.

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F5MRf9.png&hash=7deb8fec424d5cb7c86460b4ec29f8809184c7e6)

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! :P