RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VXA] Quest Journal 1.0.3

0 Members and 3 Guests are viewing this topic.

*
Rep:
Level 82
What other scripts are you using? I have no idea what Z01 is referring to, and it's not something that's in the Quest Journal. It sounds like some kind of CMS script seeing as the default Scenes aren't throwing up any errors, only Scene_Quests.

As a starting point, try changing Scene_Quests to Scene_Quest. In Quest Journal, the Quest isn't pluralised, so that might be the cause. If it's not that either, then there's something else that I'm not sure about without some info on what Z01 is.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

**
Rep: +0/-0Level 51
RMRK Junior
I did some fiddling around and it look like not entering the code line for the quest worked (and some trimming of scripts that I didn't didn't need). I feel so stupid now. Sorry.   :-[

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, I am glad it all worked out.

**
Rep: +0/-0Level 48
RMRK Junior
Hey, I was wondering if anybody could help me.

I'm trying to use this script along with Pacman's Menu augmenter, found here: http://rmrk.net/index.php/topic,46355.0.html

Problem is, when I load his script into the game, I cannot get a Quest icon to pop back up inside the main menu (via esc.) I can still hit Q in the game to access the quest window, but I'm trying to figure out how to have it so that the new main menu will display the Quests as an option.

Any help with this matter would be much appreciated. I'm rather terrible with scripting, so I'm losing my mind trying to figure out how to make everything work.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Hmm, this sounds familiar. I think you can find the solution here: http://rmrk.net/index.php/topic,45009.msg536382.html#msg536382

That was for adding the Monster Catalogue to Pacman's script, but these scripts both work the same for adding to the menu, so all you need to do is use a different method. See also: http://rmrk.net/index.php/topic,45009.msg536482.html#msg536482

If you need further assistance, I can try to provide more tailored guidance for this script specifically.

**
Rep: +0/-0Level 48
RMRK Junior
I looked around at your other responses within that thread, and custom tailored the issue myself. Thank you very much for all your assistance! The system works perfectly now! :D

**
Rep: +0/-0Level 46
RMRK Junior
I love your script.

I'm writing a custom shop script and I want certain items to be displayed only when a specific quest is met:
Code: [Select]
module Common
class Shop
def self.by_quest(shop_type, purchase_only = false)
      case shop_type
      when :items
        if quest_complete?(7) # <<<<<<<<<<<<<<<<< crash here: Script 'Game_interpreter' line 1411: NoMethodError occured.
          show(:general_all, purchase_only)
        elsif quest_complete?(4)
          show(:general_advanced, purchase_only)
        else
          show(:general_basic, purchase_only)
        end
....
"Script 'Game_interpreter' line 1411: NoMethodError occured."

It works in scripts in events as well as outside of my module. But not inside of it. I did a ctrl+f to search for your "quest_completed?" definition but it's not there at all. How do I call quest_complete?(x) and objective_complete?(x,y) and such from another module?

Thanks in advance.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
The following check would do it:

Code: [Select]
$game_party.quests.revealed?(7) && $game_party.quests[7].status?(:complete)

**
Rep: +0/-0Level 46
RMRK Junior
Thanks. Your 'support times' are incredibly fast. Keep up the good work!

**
Rep: +0/-0Level 46
RMRK Junior
No sorry this is no good.
Code: [Select]
$game_party.quests[7].status?(:complete)
will also reveal the quest (7,0) as an unwanted side-effect.

I tested it with a script in an event and indeed it does reveal the quest:
Code: [Select]
if $game_party.quests[7].status?(:complete)
 p 'complete'
else
 p 'not complete'
end

ofcourse i could manually hide it again after using that line in an if-statement but that is kind of bad imo.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Yes, that is why the code I shared was:

Code: [Select]
$game_party.quests.revealed?(7) && $game_party.quests[7].status?(:complete)

Both parts of that expression are necessary in order to avoid the problem you have encountered. The first part checks whether the quest has been revealed, and if it hasn't been, then it won't check the second part and so it won't accidentally reveal the quest.
« Last Edit: January 12, 2013, 06:39:18 PM by modern algebra »

**
Rep: +0/-0Level 46
RMRK Junior
Oh sorry I misunderstood.

Could I be a pain one more time and ask what the code is for checking it for an objective like (7,1) (for example) through a script?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
No worries!  ;D

For checking an objective, you again need to have the revealed check, and the entire code is:

Code: [Select]
$game_party.quests.revealed?(x) && $game_party.quests[x].objective_status?(:complete, y)

Where x is the ID of the quest and y is the ID of the objective. So, for your example, it is:

Code: [Select]
$game_party.quests.revealed?(7) && $game_party.quests[7].objective_status?(:complete, 1)

(keeping in mind that 1 is the second objective, with 0 being the first).

Also, if you want to check if more than one objective is complete, you can just insert it immediately after the 1. So, if you wanted to check if objectives 0, 1, and 3 are complete, it would be:

Code: [Select]
$game_party.quests.revealed?(7) && $game_party.quests[7].objective_status?(:complete, 0, 1, 3)

**
Rep: +0/-0Level 46
RMRK Junior
And again many thanks. That works perfectly. In case anyone else would ever need it, add this to your custom class:
Code: [Select]
    def self.quest_complete?(q_id)
      return $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].status?(:complete)
    end
   
    def self.objective_complete?(q_id, *obj_id)
        $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:complete, *obj_id)
    end

**
Rep: +0/-0Level 46
RMRK Junior
I'm learning Ruby. I started like 2 weeks ago so my code might be 'noobish'. Today I felt brave and attempted to create an addon for your script to make it easier to debug my game.
It actually works  :o, but there were a few things that I couldn't figure out. (I'm sorry if I ask too many questions)

 Problems:
 - How do I retrieve a list of all objectives? The problem is that the user may
   have his objective id's as follow: 0,1,2,100,1000,434334,etc...
   For now I just used a placeholder "@@quests"
 - I also need to retrieve them without making them visible.
 - How do I retrieve the list of objectives that belong to a specific quest_id
   without revealing anything.

Code: [Select]
#==============================================================================
# Version 1.00
#
# About:
# A quick debug manager for turning on/off quests/objectives and/or revealing/
# concealing them.
#
# Instructions:
# Place below "Modern Algebra's Quest Journal" but above "? Main Process".
# Call like this: SceneManager.call(Scene_QJ_Debug).
# Or Press Q in the quest window to open the debug window
#
# Requires:
# - Modern Algebra's Quest Journal
# - RPG Maker VX Ace
#
# Written by Napoleon (My very first addon!).
#
# Version History:
# 1.00 (16-1-2013)
#   - First Release
#==============================================================================


#==============================================================================
# ? Quest Journal - Debug Addon - Singleton instance
#------------------------------------------------------------------------------
#  Singleton instance for the QJ debug scene
#==============================================================================
module Quest_Journal
  module Utility
################################################################################
# CONFIG START
################################################################################
    # When set to true (default) then you can Press [Q] (default) in the quest menu to open the debug menu.
    # When set to false this addon can only be manually called.       
    DEBUG_MENU_ENABLED = true
   
    # Key for opening the debug menu
    DEBUG_MENU_KEY = :L
   
    # The first quest id, usually 0
    FIRST_QUEST = 0
   
    # The maximum quest id to check. This must be equal or higher than your highest quest id
    MAX_QUEST = 1000

    # Quest text color when completed (in debug menu only)
    QUEST_COMPLETE_COLOR = 3 # 3 = lightgreen
################################################################################   
# CONFIG END
################################################################################
    # Samples:
      # Utility.quest_data(1,:objectives)
      # Utility.quest_data(1,:name)
    # Possible symbols: :line, :level, :name, :description, :objectives, :rewards
    def self.quest_data(q_id, symbol)   
      return QuestData.setup_quest(q_id)[symbol]
    end
   
    # Fills the @@quests variable with all used quest id's.
    def self.set_quest_data
      result = []
      array_idx = 0
      for i in FIRST_QUEST..MAX_QUEST
        if quest_data(i,:name) != nil
          result[array_idx] = i
          array_idx +=1
        end
      end
      return result
    end   
   
    #Utility.quests
    @@quests = set_quest_data
    # static getter
    def self.quests
      @@quests
    end 
   
    #Utility.quest_complete?()
    def self.quest_complete?(q_id)
      return $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].status?(:complete)
    end   

    #Utility.reset_quest()
    def self.reset_quest(q_id)
      $game_party.quests.delete_quest(q_id)
      $game_party.quests.setup_quest(q_id)
    end   
    #Utility.objective_complete?(,)
    def self.objective_complete?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:complete, *obj_id)
    end
    #Utility.objective_revealed?(,)
    def self.objective_revealed?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:revealed, *obj_id)
    end
    #Utility.objective_concealed?(,)
    def self.objective_concealed?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:concealed, *obj_id)
    end         
    #Utility.objective_failed?(,)
    def self.objective_failed?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:failed, *obj_id)
    end   
    #Utility.complete_objective(,)
    def self.complete_objective(q_id, obj_id)
      $game_party.quests[q_id].complete_objective(obj_id)
    end
    #Utility.complete_quest(,)
    def self.complete_quest(q_id)
      obj_count = QuestData.setup_quest(q_id)[:objectives].length
      for i in 0..obj_count-1
          complete_objective(q_id,i)
      end
    end   
  end # Utility
 
  #==============================================================================
  # ? Quest Journal - Debug Addon - Quest window (left window)
  #------------------------------------------------------------------------------
  #  This window contains the list of all quests
  #==============================================================================
  class Window_Quests < Window_Selectable
    include Quest_Journal
    #--------------------------------------------------------------------------
    # * Class Variable
    #--------------------------------------------------------------------------
    @@last_top_row = 0                      # For saving first line
    @@last_index   = 0                      # For saving cursor position
    @@sel_quest_id = 1
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    attr_reader   :right_window             # Right window
    attr_reader   :sel_quest_id             #   
    #--------------------------------------------------------------------------
    # * Object Initialization
    #--------------------------------------------------------------------------
    def initialize(x, y)
      super(x, y, window_width, window_height)
      @sel_quest_id = Utility.quests[0]
      refresh
      self.top_row = @@last_top_row
      select(@@last_index)
      activate
    end
    #--------------------------------------------------------------------------
    # * Get Window Width
    #--------------------------------------------------------------------------
    def window_width
      return 164
    end
    #--------------------------------------------------------------------------
    # * Get Window Height
    #--------------------------------------------------------------------------
    def window_height
      Graphics.height
    end
    #--------------------------------------------------------------------------
    # * Get Number of Items
    #--------------------------------------------------------------------------
    def item_max
      Utility.quests.length || 0
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    def update
      super     
      if active && Input.trigger?(:L)
        q_id = Utility.quests[index]
        if Utility.quest_complete?(q_id)
          Utility.reset_quest(q_id)
        else
          Utility.complete_quest(q_id)
        end
        Sound.play_ok
        redraw_current_item
        @right_window.refresh
      end
     
      return unless @right_window
      @sel_quest_id = Utility.quests[index]
      @right_window.refresh_me
    end
    #--------------------------------------------------------------------------
    # * Refresh
    #--------------------------------------------------------------------------
    def refresh
      create_contents
      draw_all_items
    end
    #--------------------------------------------------------------------------
    # * Draw Item
    #--------------------------------------------------------------------------
    def draw_item(index)
      quest_id = Utility.quests[index]
      if Utility.quest_complete?(quest_id)
        change_color(text_color(Utility::QUEST_COMPLETE_COLOR))
      end 

      text = sprintf("%02d: #{$game_party.quests[quest_id].name} ", quest_id )
      text_rect = item_rect_for_text(index)
      text_rect.x+=24
     
      draw_text(text_rect, text)
      change_color(normal_color)
      draw_icon($game_party.quests[quest_id].icon_index, text_rect.x-24, text_rect.y, true)       
    end
    #--------------------------------------------------------------------------
    # * Processing When Cancel Button Is Pressed
    #--------------------------------------------------------------------------
    def process_cancel
      super
      @@last_top_row = top_row
      @@last_index = index
    end
    #--------------------------------------------------------------------------
    # * Set Right Window
    #--------------------------------------------------------------------------
    def right_window=(right_window)
      @right_window = right_window
      update
    end
  end

  #==============================================================================
  # ? Quest Journal - Debug Addon - Objective window (right window)
  #------------------------------------------------------------------------------
  #  This window contains the list of all objectives for the selected quest
  #==============================================================================
  #==============================================================================
  # ** Objective Window
  #------------------------------------------------------------------------------
  #  Displays the objectives for the currently selected quest (if any)
  #==============================================================================
  class Window_Objectives < Window_Selectable
    include Quest_Journal
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    # None
    #--------------------------------------------------------------------------
    # * Private Instance Variables
    #--------------------------------------------------------------------------   
    # The previously selected quest id (in the left window)
    @previous_quest_id
   
    # The text colors for the objective status
    @@OBJ_COLORS = {
      'revealed' => 1, # blue
      'completed' => 3, # green
      'failed' => 18, # red
      'concealed' => 0 # white
    }
    #--------------------------------------------------------------------------
    # * Object Initialization
    #-------------------------------------------------------------------------
    def initialize(x, y, width, left_window)
      @left_window = left_window
      super(x, y, width, fitting_height(10))     
      refresh
    end
    #--------------------------------------------------------------------------
    # * Get Number of Items
    #--------------------------------------------------------------------------
    def item_max
      return QuestData.setup_quest(sel_q_id)[:objectives].length
    end
    #--------------------------------------------------------------------------
    # * Refresh
    #--------------------------------------------------------------------------
    def refresh
      contents.clear
      draw_all_items
    end
    #--------------------------------------------------------------------------
    # * Selected Quest ID
    #--------------------------------------------------------------------------
    def sel_q_id
      return @left_window.sel_quest_id
    end 
    #--------------------------------------------------------------------------
    # * Draw Item
    #-------------------------------------------------------------------------- 
    def draw_item(index)   
      if sel_q_id == nil then return end
     
      obj_id = index # store currently selected objective_id in a more meaningful variable name
      item_text = sprintf("Obj. %0d: #{$game_party.quests[sel_q_id].objectives[obj_id]}",obj_id)
      id_width = text_size(item_text).width
      status = Utility.objective_complete?(sel_q_id,obj_id) ? "[X]" : "[ ]"   
     
      # objective item color
      if Utility.objective_failed?(sel_q_id,index)
        change_color(text_color(@@OBJ_COLORS['failed']))
      elsif Utility.objective_concealed?(sel_q_id,index)
        change_color(text_color(@@OBJ_COLORS['concealed']))
      elsif Utility.objective_complete?(sel_q_id,index)             
        change_color(text_color(@@OBJ_COLORS['completed']))     
      elsif Utility.objective_revealed?(sel_q_id,index)
        change_color(text_color(@@OBJ_COLORS['revealed']))               
      end
     
      # draw text
      text_rect = item_rect_for_text(index)
      status_rect = item_rect_for_text(index)
      text_rect.width -= 30
      draw_text(text_rect, item_text)     
      # draw status
      status_rect.x+= 5
      draw_text(status_rect, status, 2)   
      change_color(normal_color) # reset text color
    end
    #--------------------------------------------------------------------------
    # * Refresh
    #--------------------------------------------------------------------------
    def refresh_me
      if sel_q_id != @previous_quest_id then refresh end
      @previous_quest_id = sel_q_id
    end
    #--------------------------------------------------------------------------
    # * redraw_current_items (redraws both windows current items)
    #--------------------------------------------------------------------------
    def redraw_current_items
      redraw_current_item
      @left_window.redraw_current_item
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    def update
      super
     
      if Input.trigger?(:C)
        if Utility.objective_complete?(sel_q_id,index)
          $game_party.quests[sel_q_id].uncomplete_objective(index)
        else
          Utility.complete_objective(sel_q_id,index)
        end
        redraw_current_items
        Sound.play_ok
      end
     
      if Input.trigger?(:L)
        if Utility.objective_complete?(sel_q_id,index)
          $game_party.quests[sel_q_id].fail_objective(index)
          #p 'now failed'
        elsif Utility.objective_failed?(sel_q_id,index)
          $game_party.quests[sel_q_id].unfail_objective(index)
          $game_party.quests[sel_q_id].reveal_objective(index)
          #p 'now revealed'
        elsif Utility.objective_revealed?(sel_q_id,index)
          $game_party.quests[sel_q_id].conceal_objective(index)
          #p 'now concealed'
        else # it's ONLY revealed
          $game_party.quests[sel_q_id].complete_objective(index)
          #p 'now completed'
        end
        redraw_current_items
        Sound.play_cursor
      end     
    end
   
  end # end of right window class

end # end of module
#==============================================================================
# ? Quest Journal - Debug Addon - Scene
#------------------------------------------------------------------------------
#  The scene that contains the debug menu
#==============================================================================
class Scene_QJ_Debug < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    super
    create_left_window
    create_right_window
    create_help_window
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
  end
  #--------------------------------------------------------------------------
  # * Create Left Window
  #--------------------------------------------------------------------------
  def create_left_window
    @left_window = Quest_Journal::Window_Quests.new(0, 0)
    @left_window.set_handler(:ok,     method(:on_left_ok))
    @left_window.set_handler(:cancel, method(:return_scene))
  end
  #--------------------------------------------------------------------------
  # * Create Right Window
  #--------------------------------------------------------------------------
  def create_right_window
    wx = @left_window.width
    ww = Graphics.width - wx
    @right_window = Quest_Journal::Window_Objectives.new(wx, 0, ww, @left_window)
    @right_window.set_handler(:cancel, method(:on_right_cancel))
    @left_window.right_window = @right_window
  end
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    wx = @right_window.x
    wy = @right_window.height
    ww = @right_window.width
    wh = Graphics.height - wy
    @help_window = Window_Base.new(wx, wy, ww, wh)
    refresh_help_window(:left)
  end
  #--------------------------------------------------------------------------
  # * Left [OK]
  #--------------------------------------------------------------------------
  def on_left_ok
    refresh_help_window(:right)
    @right_window.activate
    @right_window.select(0)
  end
  #--------------------------------------------------------------------------
  # * Right [Cancel]
  #--------------------------------------------------------------------------
  def on_right_cancel
    @left_window.activate
    @right_window.unselect
    refresh_help_window(:left)
  end
  #--------------------------------------------------------------------------
  # * Refresh Help Window
  #--------------------------------------------------------------------------
  def refresh_help_window(window)
    if window == :left
      help_text = "C (Enter) : Select Quest.\n" +
                  "L (Q) : Complete / Reset"
    else
      help_text = "C (Enter) : Complete / Reset\n" +
                  "L (Q) : Completed [green]\nFailed [red]\nRevealed [blue]\nConcealed [white]"
    end
    @help_window.contents.clear
    @help_window.draw_text_ex(4, 0, help_text)
  end
end # Scene

#==============================================================================
# Overwrite Algebra's Window_QuestList update method so it can call this addon's scene
#==============================================================================
class Window_QuestList < Window_Selectable
  def update
    super
    if Quest_Journal::Utility::DEBUG_MENU_ENABLED && Input.trigger?(Quest_Journal::Utility::DEBUG_MENU_KEY)
      SceneManager.return
      SceneManager.call(Scene_QJ_Debug)
    end
  end
end
#==============================================================================
#
# ? End of File
#
#==============================================================================
« Last Edit: January 16, 2013, 02:12:01 PM by napoleon »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I suppose you'd have to do the following:

Code: [Select]
QuestData.setup_quest(id)[:objectives].compact

**
Rep: +0/-0Level 46
RMRK Junior
Thanks. The hardest part is to access all these quests and objectives without revealing them. But I have it all solved now except this one little thing. The code below will reset and conceal the quest. But after it's concealed it can never be revealed anymore... Not even through your reveal_objective(x,y). It stays concealed permanently until I restart the game. I tried another 'dirty' work-around by concealing all objectives but that won't work either. I'm all out of idea's.
Code: [Select]
    # Do not use outcommented version below. It counts as manual conceal and thus is not automatically revealed when calling revea_objective(x,y) for this quest... I think..
    #Utility.conceal_quest()
    #def self.conceal_quest(q_id)
    #  $game_party.quests[q_id].concealed = true
    #end
   
    #Utility.reset_quest()
    # Note that objective ID's may not have gaps. They must be numbered starting from 0 without any gaps in between.
    def self.reset_quest(q_id)
      $game_party.quests.delete_quest(q_id)
      $game_party.quests.setup_quest(q_id)
     
      # ARGH doesn't work. The quest itself will remain revealed after all objectives have been concealed.
      obj_count = QuestData.setup_quest(q_id)[:objectives].length
      for obj_id in 0..obj_count-1
          $game_party.quests[q_id].conceal_objective(obj_id)
      end
    end

Full code in case it matters and any1 cares for going through that bulk:
Code: [Select]
#==============================================================================
# Version 1.00
#
# About:
# A quick debug manager for turning on/off quests/objectives and/or revealing/
# concealing them.
#
# Instructions:
# Place below "Modern Algebra's Quest Journal" but above "? Main Process".
# Call like this: SceneManager.call(Scene_QJ_Debug).
# Or Press Q in the quest window to open the debug window
#
# Requires:
# - Modern Algebra's Quest Journal
# - RPG Maker VX Ace
#
# Written by Napoleon (My very first addon!).
#
# Version History:
# 1.00 (16-1-2013)
#   - First Release
#==============================================================================


#==============================================================================
# ? Quest Journal - Debug Addon - Singleton instance
#------------------------------------------------------------------------------
#  Singleton instance for the QJ debug scene
#==============================================================================
module Quest_Journal
  module Utility
################################################################################
# CONFIG START
################################################################################
    # When set to true (default) then you can Press [Q] (default) in the quest menu to open the debug menu.
    # When set to false this addon can only be manually called.       
    DEBUG_MENU_ENABLED = true
   
    # Key for opening the debug menu
    DEBUG_MENU_KEY = :L
   
    # Key for completing/resetting an entire quest (left window)
    COMPLETE_RESET_QUEST_KEY = :R
   
    # The first quest id, usually 0
    FIRST_QUEST = 0
   
    # The maximum quest id to check. This must be equal or higher than your highest quest id
    MAX_QUEST = 1000

    # Quest text color when completed (in debug menu only)
    QUEST_COMPLETE_COLOR = 3 # 3 = lightgreen
   
    # The text status colors
    OBJ_COLORS = {
      'revealed' => 1, # blue
      'completed' => 3, # green
      'failed' => 18, # red
      'concealed' => 0 # white
    }   
################################################################################   
# CONFIG END
################################################################################
    # Samples:
      # Utility.quest_data(1,:objectives)
      # Utility.quest_data(1,:name)
    # Possible symbols: :line, :level, :name, :description, :objectives, :rewards
    def self.quest_data(q_id, symbol)   
      return QuestData.setup_quest(q_id)[symbol]
    end
   
    # Returns an array with all used (=non-empty) quest id's.
    def self.set_quest_data
      result = []
      array_idx = 0
      for i in FIRST_QUEST..MAX_QUEST
        if quest_data(i,:name) != nil
          result[array_idx] = i
          array_idx +=1
        end
      end
      return result
    end   
   
    #Utility.quests
    @@quests = set_quest_data
    # static getter
    def self.quests
      @@quests
    end 
   
    #Utility.quest_complete?()
    def self.quest_complete?(q_id)
      return $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].status?(:complete)
    end   
    #Utility.quest_revealed?()
    def self.quest_revealed?(q_id)
      return $game_party.quests.revealed?(q_id)
    end   
    #Utility.quest_failed?()
    def self.quest_failed?(q_id)
      return $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].status?(:failed)
    end   
    #Utility.quest_concealed?()
    def self.quest_concealed?(q_id)
      return !$game_party.quests.revealed?(q_id)
    end       
   
    #Utility.objective_complete?(,)
    def self.objective_complete?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:complete, *obj_id)
    end
    #Utility.objective_revealed?(,)
    def self.objective_revealed?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:revealed, *obj_id)
    end
    #Utility.objective_concealed?(,)
    def self.objective_concealed?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:concealed, *obj_id)
    end         
    #Utility.objective_failed?(,)
    def self.objective_failed?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:failed, *obj_id)
    end   
    #Utility.complete_objective(,)
    def self.complete_objective(q_id, obj_id)
      $game_party.quests[q_id].complete_objective(obj_id)
    end
    #Utility.complete_quest(,)
    # Completes all objectives for the specified quest
    # Note that objective ID's may not have gaps. They must be numbered starting from 0 without any gaps in between.
    def self.complete_quest(q_id)
      obj_count = QuestData.setup_quest(q_id)[:objectives].length
      for i in 0..obj_count-1
          complete_objective(q_id,i)
      end
    end   
    #Utility.conceal_quest()
    def self.conceal_quest(q_id)
      $game_party.quests[q_id].concealed = true
    end
    #Utility.reset_quest()
    def self.reset_quest(q_id)
      $game_party.quests.delete_quest(q_id)
      $game_party.quests.setup_quest(q_id)
      conceal_quest(q_id)
    end
  end # Utility
 
  #==============================================================================
  # ? Quest Journal - Debug Addon - Quest window (left window)
  #------------------------------------------------------------------------------
  #  This window contains the list of all quests
  #==============================================================================
  class Window_Quests < Window_Selectable
    include Quest_Journal
    #--------------------------------------------------------------------------
    # * Class Variable
    #--------------------------------------------------------------------------
    @@last_top_row = 0                      # For saving first line
    @@last_index   = 0                      # For saving cursor position
    @@sel_quest_id = 1
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    attr_reader   :right_window             # Right window
    attr_reader   :sel_quest_id             #   
    #--------------------------------------------------------------------------
    # * Object Initialization
    #--------------------------------------------------------------------------
    def initialize(x, y)
      super(x, y, window_width, window_height)
      @sel_quest_id = Utility.quests[0]
      refresh
      self.top_row = @@last_top_row
      select(@@last_index)
      activate
    end
    #--------------------------------------------------------------------------
    # * Get Window Width
    #--------------------------------------------------------------------------
    def window_width
      return 164
    end
    #--------------------------------------------------------------------------
    # * Get Window Height
    #--------------------------------------------------------------------------
    def window_height
      Graphics.height
    end
    #--------------------------------------------------------------------------
    # * Get Number of Items
    #--------------------------------------------------------------------------
    def item_max
      Utility.quests.length || 0
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    def update
      super
      if active && Input.trigger?(Utility::COMPLETE_RESET_QUEST_KEY)
        q_id = Utility.quests[index]
        if Utility.quest_complete?(q_id)
          Utility.reset_quest(q_id)
        else
          Utility.complete_quest(q_id)
        end
        Sound.play_ok
        redraw_current_item
        @right_window.refresh
      end
     
      return unless @right_window
      @sel_quest_id = Utility.quests[index]
      @right_window.refresh_me
    end
    #--------------------------------------------------------------------------
    # * Refresh
    #--------------------------------------------------------------------------
    def refresh
      create_contents
      draw_all_items
    end
    #--------------------------------------------------------------------------
    # * Draw Item
    #--------------------------------------------------------------------------
    def draw_item(index)
      quest_id = Utility.quests[index]
     
      # quest item color
      if Utility.quest_failed?(quest_id)
        change_color(text_color(Utility::OBJ_COLORS['failed']))
      elsif Utility.quest_concealed?(quest_id)
        change_color(text_color(Utility::OBJ_COLORS['concealed']))
      elsif Utility.quest_complete?(quest_id)             
        change_color(text_color(Utility::OBJ_COLORS['completed']))     
      elsif Utility.quest_revealed?(quest_id)
        change_color(text_color(Utility::OBJ_COLORS['revealed']))               
      end

      text = sprintf("%02d: #{QuestData.setup_quest(quest_id)[:name]} ", quest_id )
     
      text_rect = item_rect_for_text(index)
      text_rect.x+=24
     
      draw_text(text_rect, text)
      change_color(normal_color)
      draw_icon(QuestData.setup_quest(quest_id)[:icon_index], text_rect.x-24, text_rect.y, true)
    end
    #--------------------------------------------------------------------------
    # * Processing When Cancel Button Is Pressed
    #--------------------------------------------------------------------------
    def process_cancel
      super
      @@last_top_row = top_row
      @@last_index = index
    end
    #--------------------------------------------------------------------------
    # * Set Right Window
    #--------------------------------------------------------------------------
    def right_window=(right_window)
      @right_window = right_window
      update
    end
  end

  #==============================================================================
  # ? Quest Journal - Debug Addon - Objective window (right window)
  #------------------------------------------------------------------------------
  #  This window contains the list of all objectives for the selected quest
  #==============================================================================
  #==============================================================================
  # ** Objective Window
  #------------------------------------------------------------------------------
  #  Displays the objectives for the currently selected quest (if any)
  #==============================================================================
  class Window_Objectives < Window_Selectable
    include Quest_Journal
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    # None
    #--------------------------------------------------------------------------
    # * Private Instance Variables
    #--------------------------------------------------------------------------   
    # The previously selected quest id (in the left window)
    @previous_quest_id
   

    #--------------------------------------------------------------------------
    # * Object Initialization
    #-------------------------------------------------------------------------
    def initialize(x, y, width, left_window)
      @left_window = left_window
      super(x, y, width, fitting_height(10))     
      refresh
    end
    #--------------------------------------------------------------------------
    # * Get Number of Items
    #--------------------------------------------------------------------------
    def item_max
      return QuestData.setup_quest(sel_q_id)[:objectives].length
    end
    #--------------------------------------------------------------------------
    # * Refresh
    #--------------------------------------------------------------------------
    def refresh
      contents.clear
      draw_all_items
    end
    #--------------------------------------------------------------------------
    # * Selected Quest ID
    #--------------------------------------------------------------------------
    def sel_q_id
      return @left_window.sel_quest_id
    end 
    #--------------------------------------------------------------------------
    # * Draw Item
    #-------------------------------------------------------------------------- 
    def draw_item(index)   
      if sel_q_id == nil then return end
     
      obj_id = index # store currently selected objective_id in a more meaningful variable name
      item_text = sprintf("Obj. %0d: #{QuestData.setup_quest(sel_q_id)[:objectives][index]}",obj_id)
      id_width = text_size(item_text).width
      status = Utility.objective_complete?(sel_q_id,obj_id) ? "[X]" : "[ ]"   
     
      # objective item color
      if Utility.objective_failed?(sel_q_id,index)
        change_color(text_color(Utility::OBJ_COLORS['failed']))
      elsif Utility.objective_concealed?(sel_q_id,index)
        change_color(text_color(Utility::OBJ_COLORS['concealed']))
      elsif Utility.objective_complete?(sel_q_id,index)             
        change_color(text_color(Utility::OBJ_COLORS['completed']))     
      elsif Utility.objective_revealed?(sel_q_id,index)
        change_color(text_color(Utility::OBJ_COLORS['revealed']))               
      end
     
      # draw text
      text_rect = item_rect_for_text(index)
      status_rect = item_rect_for_text(index)
      text_rect.width -= 30
      draw_text(text_rect, item_text)     
      # draw status
      status_rect.x+= 5
      draw_text(status_rect, status, 2)   
      change_color(normal_color) # reset text color
    end
    #--------------------------------------------------------------------------
    # * Refresh
    #--------------------------------------------------------------------------
    def refresh_me
      if sel_q_id != @previous_quest_id then refresh end
      @previous_quest_id = sel_q_id
    end
    #--------------------------------------------------------------------------
    # * redraw_current_items (redraws both windows current items)
    #--------------------------------------------------------------------------
    def redraw_current_items
      redraw_current_item
      @left_window.redraw_current_item
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    def update
      super
     
      if Input.trigger?(:C)
        if Utility.objective_complete?(sel_q_id,index)
          $game_party.quests[sel_q_id].uncomplete_objective(index)
        else
          Utility.complete_objective(sel_q_id,index)
        end
        redraw_current_items
        Sound.play_ok
      end
     
      if active && Input.trigger?(:L)
        if Utility.objective_complete?(sel_q_id,index)
          $game_party.quests[sel_q_id].fail_objective(index)
          #p 'now failed'
        elsif Utility.objective_failed?(sel_q_id,index)
          $game_party.quests[sel_q_id].unfail_objective(index)
          $game_party.quests[sel_q_id].reveal_objective(index)
          #p 'now revealed'
        elsif Utility.objective_revealed?(sel_q_id,index)
          $game_party.quests[sel_q_id].conceal_objective(index)
          #p 'now concealed'
        else # it's ONLY revealed
          $game_party.quests[sel_q_id].complete_objective(index)
          #p 'now completed'
        end
        redraw_current_items
        Sound.play_cursor
      end     
    end
   
  end # end of right window class

end # end of module
#==============================================================================
# ? Quest Journal - Debug Addon - Scene
#------------------------------------------------------------------------------
#  The scene that contains the debug menu
#==============================================================================
class Scene_QJ_Debug < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    super
    create_left_window
    create_right_window
    create_help_window
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
  end
  #--------------------------------------------------------------------------
  # * Create Left Window
  #--------------------------------------------------------------------------
  def create_left_window
    @left_window = Quest_Journal::Window_Quests.new(0, 0)
    @left_window.set_handler(:ok,     method(:on_left_ok))
    @left_window.set_handler(:cancel, method(:return_scene))
  end
  #--------------------------------------------------------------------------
  # * Create Right Window
  #--------------------------------------------------------------------------
  def create_right_window
    wx = @left_window.width
    ww = Graphics.width - wx
    @right_window = Quest_Journal::Window_Objectives.new(wx, 0, ww, @left_window)
    @right_window.set_handler(:cancel, method(:on_right_cancel))
    @left_window.right_window = @right_window
  end
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    wx = @right_window.x
    wy = @right_window.height
    ww = @right_window.width
    wh = Graphics.height - wy
    @help_window = Window_Base.new(wx, wy, ww, wh)
    refresh_help_window(:left)
  end
  #--------------------------------------------------------------------------
  # * Left [OK]
  #--------------------------------------------------------------------------
  def on_left_ok
    refresh_help_window(:right)
    @right_window.activate
    @right_window.select(0)
  end
  #--------------------------------------------------------------------------
  # * Right [Cancel]
  #--------------------------------------------------------------------------
  def on_right_cancel
    @left_window.activate
    @right_window.unselect
    refresh_help_window(:left)
  end
  #--------------------------------------------------------------------------
  # * Refresh Help Window
  #--------------------------------------------------------------------------
  def refresh_help_window(window)
    if window == :left
      help_text = "C (Enter) : Select Quest.\n" +
                  "R (W) : Complete / Reset+Conceal"
    else
      help_text = "C (Enter) : Complete / Reset\n" +
                  "L (Q) : Completed [green]\nFailed [red]\nRevealed [blue]\nConcealed [white]"
    end
    @help_window.contents.clear
    @help_window.draw_text_ex(4, 0, help_text)
  end
end # Scene

#==============================================================================
# Overwrite Algebra's Window_QuestList update method so it can call this addon's scene
#==============================================================================
class Window_QuestList < Window_Selectable
  def update
    super
    if Quest_Journal::Utility::DEBUG_MENU_ENABLED && Input.trigger?(Quest_Journal::Utility::DEBUG_MENU_KEY)
      SceneManager.return
      SceneManager.call(Scene_QJ_Debug)
    end
  end
end
#==============================================================================
#
# ? End of File
#
#==============================================================================

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I'm not sure what you mean. You should be able to conceal and reveal quests with the code:

Code: [Select]
$game_party.quests[id].concealed = true/false

Setting it to true conceals the quest and setting it to false reveals it. I believe that when you do that, it will show up again.

Also that code:

Code: [Select]
QuestData.setup_quest(id)

will give you access to all of the quest data without revealing anything, not just objectives.

**
Rep: +0/-0Level 46
RMRK Junior
I know I did a "p QuestData.setup_quest(q_id)" to check out what's inside of it. It does not contain objective id's. But as long as the user configures his objective id's in a sequential manner it should be fine.
In fact, I just noticed that your script crashes if the user does not use a sequential objective-id-list. for Example:
Code: [Select]
      q[:objectives][0]     = "Meet your colleague"
      q[:objectives][1]     = "Travel to Castle"
      q[:objectives][2]     = "Don't steal the panties"
      q[:objectives][3]     = "Pass your exam"
      q[:objectives][4]     = "Celebrate your new rank"
      #q[:objectives][5]     = "Steal the panties!" <<< removed because it does not fit in my game
      #q[:objectives][6]     = "Steal the panties! Part 2" <<< removed because it does not fit in my game
      q[:objectives][7]     = "Go ZzzzZzz" # <<<<< skipped id 5 and 6. Will cause crash at some point.
This will crash your application when objective 7 is revealed. My addon won't crash but will display 2 empty rows. However, your documentation did not read that this was not allowed (or did I miss that?).
Because my events on the map check for certain objective id's to be completed (like a rock that is not removed until you 'Passed your exam'). When I for some reason decide to remove objective 2 because stealing panties doesn't fit in my story then I have to fill in a dummy objective in order for your script not to crash. And if I would just shift the higher objective-id's one value lower then I would have to check ALL of my maps to make sure that they don't use any of those objective id's and if they do update those too.
It would have been nice if an objective would have another parameter (weight) or something for sorting them so that you never have any gaps.
I'm sorry if I'm totally wrong.


About the concealing:
Code: [Select]
$game_party.quests[id].concealed = true
Yes it does conceal the quest. But the problem is that when I complete/fail/update an objective after I concealed the quest then Quest Journal does not automatically reveal the quest anymore . It stays concealed no matter what until I manually call:
Code: [Select]
$game_party.quests[id].concealed = false

The quest should just return to it's concealed state like when the game started. The above code is some kind of hard-conceal that sticks on it. That's not what I need. I just need to reset the quest and conceal it again (as if it was never revealed/used at all during this game-run).

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, the only way to do that is:

Code: [Select]
      $game_party.quests.delete_quest(q_id)

That should make it as if the quest was never revealed, without setting the hard conceal. But I guess I am asking why it's necessary to access the quest through the Game_Quests class when you can retrieve any relevant data from the QuestData.setup_quest(q_id)?



I'm unable to recreate the non-sequential IDs error in my test project. I could see that error occurring if the game tried to reveal an objective that was set to nil, but I'm not sure why it would happen otherwise if you tried to reveal an objective that was not set to nil but which was non-sequential. Could you maybe recreate the error in a demo and show it to me?


As for showing the blank spaces, you can prevent that by using the #compact method. Ie:

Code: [Select]
QuestData.setup_quest(id)[:objectives].compact

If you want to retrieve the IDs, then you'd need the non-compacted array of course, but the objectives array is arranged in such a way that the ID of the objective is its position in the array.

**
Rep: +0/-0Level 46
RMRK Junior
You are right, it happened because objective_complete(x,y) was called on a nil objective.
No it wasn't revealed by me, I just needed to reset and conceal a quest even if it was revealed by the user or by some event or whatever reason.
I got it all working now :). Many thanks again.

Here is the new version:
Code: [Select]
#==============================================================================
# Version 1.00
#
# About:
# A quick debug manager for completing/failing/revealing/concealing quests and
# objectives.
#
# Instructions:
# Place below "Modern Algebra's Quest Journal" but above "? Main Process".
# Call like this: SceneManager.call(Scene_QJ_Debug).
# Or Press Q (default) in the quest window to open the debug window.
#
# Requires:
# - Modern Algebra's Quest Journal 1.0.3
# - RPG Maker VX Ace
#
# Written by Napoleon (My very first addon!).
# Special thanks to Modern Algebra for answering my questions.
#
# Terms of Use:
# Credits are appreciated but not required. You may repost this as well as long
# as you do not claim this as your own work.
#
# Version History:
# 1.00 (17-1-2013)
#   - First Release
#==============================================================================


#==============================================================================
# ? Quest Journal - Debug Addon - Singleton instance
#------------------------------------------------------------------------------
#  Singleton instance for the QJ debug scene
#==============================================================================
module Quest_Journal
  module Utility
################################################################################
# CONFIG START
################################################################################
    # When set to true (default) then you can Press [Q] (default) in the quest menu to open the debug menu.
    # When set to false this addon can only be manually called.       
    DEBUG_MENU_ENABLED = true
   
    # Key for opening the debug menu from the quest journal. Use a nil value to disable this.
    DEBUG_MENU_KEY = QuestData::MAP_BUTTON # Should be [Q] by default
   
    # Key for completing/resetting an entire quest (left window)
    COMPLETE_RESET_QUEST_KEY = QuestData::MAP_BUTTON # Should be [Q] by default
   
    # Key for opening the debug menu directly from the map. Use a nil value to disable this.
    MAP_KEY = nil
   
    # When set to true then the debug menu will be shown if the Quest Journal has no quests and would have otherwise just played a 'buzzer sound'.
    SHOW_WHEN_NO_QUESTS = true
   
    # The first quest id, usually 0
    FIRST_QUEST = 0
   
    # When set to false then the map is shown after closing the debug menu even if it was opened through the Quest Journal's menu.
    RETURN_TO_QUEST_MENU = true
   
    # The maximum quest id to check. This must be equal or higher than your highest quest id
    MAX_QUEST = 1000

    # Quest text color when completed (in debug menu only)
    QUEST_COMPLETE_COLOR = 3 # 3 = lightgreen
   
    # The text status colors
    COLORS = {
      'revealed' => 1, # blue
      'completed' => 3, # green
      'failed' => 18, # red
      'concealed' => 0 # white
    }   
################################################################################   
# CONFIG END
################################################################################
    # Samples:
      # Utility.quest_data(1,:objectives)
      # Utility.quest_data(1,:name)
    # Possible symbols: :line, :level, :name, :description, :objectives, :rewards
    def self.quest_data(q_id, symbol)   
      return QuestData.setup_quest(q_id)[symbol]
    end
   
    # Returns an array with all used (=non-empty) quest id's.
    def self.set_quest_data
      result = []
      array_idx = 0
      for i in FIRST_QUEST..MAX_QUEST
        if quest_data(i,:name) != nil
          result[array_idx] = i
          array_idx +=1
        end
      end
      return result
    end   
   
    #Utility.quests
    @@quests = set_quest_data
    # static getter
    def self.quests
      @@quests
    end 
   
    #Utility.quest_complete?()
    def self.quest_complete?(q_id)
      return $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].status?(:complete)
    end   
    #Utility.quest_revealed?()
    def self.quest_revealed?(q_id)
      return $game_party.quests.revealed?(q_id)
    end   
    #Utility.quest_failed?()
    def self.quest_failed?(q_id)
      return $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].status?(:failed)
    end   
    #Utility.quest_concealed?()
    def self.quest_concealed?(q_id)
      return !$game_party.quests.revealed?(q_id)
    end       
   
    #Utility.objective_complete?(,)
    def self.objective_complete?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:complete, *obj_id)
    end
    #Utility.objective_revealed?(,)
    def self.objective_revealed?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:revealed, *obj_id)
    end
    #Utility.objective_concealed?(,)
    def self.objective_concealed?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:concealed, *obj_id)
    end         
    #Utility.objective_failed?(,)
    def self.objective_failed?(q_id, *obj_id)
      $game_party.quests.revealed?(q_id) && $game_party.quests[q_id].objective_status?(:failed, *obj_id)
    end   
    #Utility.complete_objective(,)
    def self.complete_objective(q_id, obj_id)
      $game_party.quests[q_id].complete_objective(obj_id)
    end
    #Utility.complete_quest(,)
    # Completes all objectives for the specified quest
    # Note that objective ID's may not have gaps. They must be numbered starting from 0 without any gaps in between.
    def self.complete_quest(q_id)
      obj_count = QuestData.setup_quest(q_id)[:objectives].compact.length
      for i in 0..obj_count-1
          complete_objective(q_id,i)
      end
    end   
   
    #Utility.reset_quest()
    def self.reset_quest(q_id)
      $game_party.quests.delete_quest(q_id)
    end
  end # Utility
 
  #==============================================================================
  # ? Quest Journal - Debug Addon - Quest window (left window)
  #------------------------------------------------------------------------------
  #  This window contains the list of all quests
  #==============================================================================
  class Window_Quests < Window_Selectable
    include Quest_Journal
    #--------------------------------------------------------------------------
    # * Class Variable
    #--------------------------------------------------------------------------
    @@last_top_row = 0                      # For saving first line
    @@last_index   = 0                      # For saving cursor position
    @@sel_quest_id = 1                      # The current selected quest id
    @@is_first_update                       # Determines if this window had it's first update called.
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    attr_reader   :right_window             # Right window
    attr_reader   :sel_quest_id             #   
    #--------------------------------------------------------------------------
    # * Object Initialization
    #--------------------------------------------------------------------------
    def initialize(x, y)
      @@is_first_update = true
      super(x, y, window_width, window_height)
      @sel_quest_id = Utility.quests[0]
      refresh
      self.top_row = @@last_top_row
      select(@@last_index)
      activate
    end
    #--------------------------------------------------------------------------
    # * Get Window Width
    #--------------------------------------------------------------------------
    def window_width
      return 164
    end
    #--------------------------------------------------------------------------
    # * Get Window Height
    #--------------------------------------------------------------------------
    def window_height
      Graphics.height
    end
    #--------------------------------------------------------------------------
    # * Get Number of Items
    #--------------------------------------------------------------------------
    def item_max
      Utility.quests.length || 0
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    def update     
      super
      if active && Input.trigger?(Utility::COMPLETE_RESET_QUEST_KEY) && !@@is_first_update
        q_id = Utility.quests[index]
        if Utility.quest_complete?(q_id)
          Utility.reset_quest(q_id)
        else
          Utility.complete_quest(q_id)
        end
        Sound.play_ok
        redraw_current_item
        @right_window.refresh
      end
     
      if !Input.press?(:L) then @@is_first_update = false end

      return unless @right_window
      @sel_quest_id = Utility.quests[index]
      @right_window.refresh_me
    end
    #--------------------------------------------------------------------------
    # * Refresh
    #--------------------------------------------------------------------------
    def refresh
      create_contents
      draw_all_items
    end
    #--------------------------------------------------------------------------
    # * Draw Item
    #--------------------------------------------------------------------------
    def draw_item(index)
      quest_id = Utility.quests[index]
     
      # quest item color
      if Utility.quest_failed?(quest_id)
        change_color(text_color(Utility::COLORS['failed']))
      elsif Utility.quest_concealed?(quest_id)
        change_color(text_color(Utility::COLORS['concealed']))
      elsif Utility.quest_complete?(quest_id)             
        change_color(text_color(Utility::COLORS['completed']))     
      elsif Utility.quest_revealed?(quest_id)
        change_color(text_color(Utility::COLORS['revealed']))               
      end

      text = sprintf("%02d: #{QuestData.setup_quest(quest_id)[:name]} ", quest_id )
      text_rect = item_rect_for_text(index)
      text_rect.x+=24
     
      draw_text(text_rect, text)
      change_color(normal_color)
      draw_icon(QuestData.setup_quest(quest_id)[:icon_index], text_rect.x-24, text_rect.y, true)
    end
    #--------------------------------------------------------------------------
    # * Processing When Cancel Button Is Pressed
    #--------------------------------------------------------------------------
    def process_cancel
      super
      @@last_top_row = top_row
      @@last_index = index
    end
    #--------------------------------------------------------------------------
    # * Set Right Window
    #--------------------------------------------------------------------------
    def right_window=(right_window)
      @right_window = right_window
      update
    end
  end

  #==============================================================================
  # ? Quest Journal - Debug Addon - Objective window (right window)
  #------------------------------------------------------------------------------
  #  This window contains the list of all objectives for the selected quest
  #==============================================================================
  #==============================================================================
  # ** Objective Window
  #------------------------------------------------------------------------------
  #  Displays the objectives for the currently selected quest (if any)
  #==============================================================================
  class Window_Objectives < Window_Selectable
    include Quest_Journal
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    # None
    #--------------------------------------------------------------------------
    # * Private Instance Variables
    #--------------------------------------------------------------------------   
    # The previously selected quest id (in the left window)
    @previous_quest_id
   

    #--------------------------------------------------------------------------
    # * Object Initialization
    #-------------------------------------------------------------------------
    def initialize(x, y, width, left_window)
      @left_window = left_window
      super(x, y, width, fitting_height(10))     
      refresh
    end
    #--------------------------------------------------------------------------
    # * Get Number of Items
    #--------------------------------------------------------------------------
    def item_max
      return QuestData.setup_quest(sel_q_id)[:objectives].length
    end
    #--------------------------------------------------------------------------
    # * Refresh
    #--------------------------------------------------------------------------
    def refresh
      contents.clear
      draw_all_items
    end
    #--------------------------------------------------------------------------
    # * Selected Quest ID
    #--------------------------------------------------------------------------
    def sel_q_id
      return @left_window.sel_quest_id
    end 
    #--------------------------------------------------------------------------
    # * Draw Item
    #-------------------------------------------------------------------------- 
    def draw_item(index)   
      if sel_q_id == nil then return end
     
      obj_id = index # store currently selected objective_id in a more meaningful variable name
      item_text = sprintf("Obj. %0d: #{QuestData.setup_quest(sel_q_id)[:objectives][index]}",obj_id)
      id_width = text_size(item_text).width
      status = Utility.objective_complete?(sel_q_id,obj_id) ? "[X]" : "[ ]"   
     
      # objective item color
      if Utility.objective_failed?(sel_q_id,index)
        change_color(text_color(Utility::COLORS['failed']))
      elsif Utility.objective_concealed?(sel_q_id,index)
        change_color(text_color(Utility::COLORS['concealed']))
      elsif Utility.objective_complete?(sel_q_id,index)             
        change_color(text_color(Utility::COLORS['completed']))     
      elsif Utility.objective_revealed?(sel_q_id,index)
        change_color(text_color(Utility::COLORS['revealed']))               
      end
     
      # draw text
      text_rect = item_rect_for_text(index)
      status_rect = item_rect_for_text(index)
      text_rect.width -= 30
      draw_text(text_rect, item_text)     
      # draw status
      status_rect.x+= 5
      draw_text(status_rect, status, 2)   
      change_color(normal_color) # reset text color
    end
    #--------------------------------------------------------------------------
    # * Refresh
    #--------------------------------------------------------------------------
    def refresh_me
      if sel_q_id != @previous_quest_id then refresh end
      @previous_quest_id = sel_q_id
    end
    #--------------------------------------------------------------------------
    # * redraw_current_items (redraws both windows current items)
    #--------------------------------------------------------------------------
    def redraw_current_items
      redraw_current_item
      @left_window.redraw_current_item
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    def update
      super
     
      if Input.trigger?(:C)
        if Utility.objective_complete?(sel_q_id,index)
          $game_party.quests[sel_q_id].uncomplete_objective(index)
        else
          Utility.complete_objective(sel_q_id,index)
        end
        redraw_current_items
        Sound.play_ok
      end
     
      if active && Input.trigger?(:L)
        if Utility.objective_complete?(sel_q_id,index)
          $game_party.quests[sel_q_id].fail_objective(index)
          #p 'now failed'
        elsif Utility.objective_failed?(sel_q_id,index)
          $game_party.quests[sel_q_id].unfail_objective(index)
          $game_party.quests[sel_q_id].reveal_objective(index)
          #p 'now revealed'
        elsif Utility.objective_revealed?(sel_q_id,index)
          $game_party.quests[sel_q_id].conceal_objective(index)
          #p 'now concealed'
        else # it's ONLY revealed
          $game_party.quests[sel_q_id].complete_objective(index)
          #p 'now completed'
        end
        redraw_current_items
        Sound.play_cursor
      end     
    end
   
  end # end of right window class

end # end of module
#==============================================================================
# ? Quest Journal - Debug Addon - Scene
#------------------------------------------------------------------------------
#  The scene that contains the debug menu
#==============================================================================
class Scene_QJ_Debug < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    super
    create_left_window
    create_right_window
    create_help_window
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
  end
  #--------------------------------------------------------------------------
  # * Create Left Window
  #--------------------------------------------------------------------------
  def create_left_window
    @left_window = Quest_Journal::Window_Quests.new(0, 0)
    @left_window.set_handler(:ok,     method(:on_left_ok))
    @left_window.set_handler(:cancel, method(:return_scene))
  end
  #--------------------------------------------------------------------------
  # * Create Right Window
  #--------------------------------------------------------------------------
  def create_right_window
    wx = @left_window.width
    ww = Graphics.width - wx
    @right_window = Quest_Journal::Window_Objectives.new(wx, 0, ww, @left_window)
    @right_window.set_handler(:cancel, method(:on_right_cancel))
    @left_window.right_window = @right_window
  end
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    wx = @right_window.x
    wy = @right_window.height
    ww = @right_window.width
    wh = Graphics.height - wy
    @help_window = Window_Base.new(wx, wy, ww, wh)
    refresh_help_window(:left)
  end
  #--------------------------------------------------------------------------
  # * Left [OK]
  #--------------------------------------------------------------------------
  def on_left_ok
    refresh_help_window(:right)
    @right_window.activate
    @right_window.select(0)
  end
  #--------------------------------------------------------------------------
  # * Right [Cancel]
  #--------------------------------------------------------------------------
  def on_right_cancel
    @left_window.activate
    @right_window.unselect
    refresh_help_window(:left)
  end
  #--------------------------------------------------------------------------
  # * Refresh Help Window
  #--------------------------------------------------------------------------
  def refresh_help_window(window)
    if window == :left
      help_text = "C (Enter) : Select Quest.\n" +
                  "#{Quest_Journal::Utility::COMPLETE_RESET_QUEST_KEY} (Q) : Complete / Reset+Conceal."
    else
      help_text = "C (Enter) : Complete / Reset\n" +
                  "L (Q) : Completed [green]\nFailed [red]\nRevealed [blue]\nConcealed [white]"
    end
    @help_window.contents.clear
    @help_window.draw_text_ex(4, 0, help_text)
  end
end # Scene

#==============================================================================
# Overwrite Algebra's Window_QuestList update method so it can call this addon's scene
#==============================================================================
class Window_QuestList < Window_Selectable
  def update
    super
    if Quest_Journal::Utility::DEBUG_MENU_ENABLED && Quest_Journal::Utility::DEBUG_MENU_KEY != nil && Input.trigger?(Quest_Journal::Utility::DEBUG_MENU_KEY)
      SceneManager.return if !Quest_Journal::Utility::RETURN_TO_QUEST_MENU
      SceneManager.call(Scene_QJ_Debug)
    end
  end
end
#==============================================================================
# Call this addon directly from the worldmap
#==============================================================================
class Scene_Map 
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Call Quest Journal
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def update_call_quest_journal
    if $game_map.interpreter.running?
      @quest_journal_calling = false
    else     
      if Input.trigger?(QuestData::MAP_BUTTON)
        if $game_system.quest_access_disabled || $game_party.quests.list.empty?
          Quest_Journal::Utility::DEBUG_MENU_ENABLED && Quest_Journal::Utility::SHOW_WHEN_NO_QUESTS ?
            SceneManager.call(Scene_QJ_Debug) : Sound.play_buzzer
        else
          @quest_journal_calling = true
        end
      end 
      if !@quest_journal_calling && Quest_Journal::Utility::DEBUG_MENU_ENABLED && Quest_Journal::Utility::MAP_KEY != nil && Input.trigger?(Quest_Journal::Utility::MAP_KEY) && $game_system.quest_map_access && !scene_changing?
        SceneManager.call(Scene_QJ_Debug)
      else
        call_quest_journal if @quest_journal_calling && !$game_player.moving?
      end
    end
  end
end
#==============================================================================
#
# ? End of File
#
#==============================================================================

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
No problem! I am happy that I could assist you.

I haven't looked at the code itself in any detail, but I would recommend that you disable the ability to call the debug scene unless $TEST is true. $TEST is a global variable which is true in test play and false when playing the game ordinarily.

Anyway, the debug menu is a great idea and I am sure other people will find it very helpful. You should give it its own topic!
« Last Edit: January 18, 2013, 01:38:56 AM by modern algebra »

**
Rep: +0/-0Level 46
RMRK Junior
Done and done :).
http://rmrk.net/index.php/topic,47539.0.html

My code probably isn't the best. Only been doing Ruby/RGSS for less than 3 weeks now and I'm sure that this code could be shortened by like 300%. But it works and doesn't conflict with other scripts.
« Last Edit: January 18, 2013, 12:28:15 PM by napoleon »

**
Rep: +0/-0Level 63
Yuri Queen
I'm having a bothersome issue. I called reveal_objective(1, 0) and get an interpreter error "string cannot be coerced into fixnum". Frustratingly, since it's pointing me to Game_Interpreter 1411 and not the quest script I'm having trouble locating whatever customization mistake I made. So I'm nowhere when it comes to fixing this myself.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Can you screenshot the event in question for me? Just the page with the script command that is being bothersome.