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.
Quest Journal v. 2.1

0 Members and 3 Guests are viewing this topic.

**
Rep: +0/-0Level 81
You will die with honor...
I've redone the quest using the reveal objective and the other quest commands. (plus a variable)
With an error as a result what does it mean this time?

*
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, it means a method was called and an argument that had to be passed to it wasn't. Since there's no line number, then that means it happened while running a call script? If so, show me what you have in the call script where that error happens.

(If I had to take a guess though, I would say it might be that a line was split into two when putting it in, so you have something like:
Code: [Select]
$game_party.quests[1].reveal_objective
(0)

a line like that would cause an error - if that is the problem, you can fix it by splitting it at a better point, like the following:

Code: [Select]
q = $game_party.quests[1]
q.reveal_objective (0)
)

**
Rep: +0/-0Level 82
Hrmph.
Hello! First off, awesome script! I love the way the menu works, and with GameGuy's app it makes it so easy to edit quests! So thanks to both of you!

Right now I'm trying to get it to work with Syvkal's Ring Menu. I got the menu to come up, display the menu choice, and pull up the quest menu scene when it's selected. Your script is working perfectly, but for some reason when I try to exit the quest menu and go back to the ring menu, it crashes.

 didn't modify your script other than taking out the scene_menu section since I'm using a different menu

And here's the modified version of Syvkal's Ring Menu.
Spoiler for:
#==============================================================================
# ** Ring Menu
#-------------------------------------------------------------------------------
# by Syvkal
# Version 1.0
# 06-23-08
#==============================================================================
 
  #===================================================#
  #  **  C O N F I G U R A T I O N   S Y S T E M  **  #
  #===================================================#
 
 # Amount of frames for Startup Animation
 STARTUP_FRAMES = 20
 # Amount of frames for Movement Animation
 MOVING_FRAMES = 15
 # Radius of the Menu Ring
 RING_R = 75
 # Disabled icon to display when disabled
 ICON_DISABLE= Cache::picture('Icon_Disable')
 
  #===================================================#
  #  **     E N D   C O N F I G U R A T I O N     **  #
  #===================================================#
 
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  Edited to add Ring Menu
#==============================================================================
 
class Scene_Menu < Scene_Base
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias initialize_original initialize
 alias start_selection_original start_actor_selection
 alias end_selection_original end_actor_selection
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize(menu_index = 0, move = true)
   @move = move
   initialize_original(menu_index)
 end
 #--------------------------------------------------------------------------
 # * Start processing
 #--------------------------------------------------------------------------
 def start
   super
   create_menu_background
   create_command_window
   @gold_window = Window_Gold.new(0, 360)
   @location_window = Window_location.new(0, 0)
 end
 #--------------------------------------------------------------------------
 # * Termination Processing
 #--------------------------------------------------------------------------
 def terminate
   super
   dispose_menu_background
   @command_window.dispose
   @gold_window.dispose
   @status_window.dispose if @status_window
   @location_window.dispose
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   super
   update_menu_background
   @command_window.update
   @gold_window.update
   @status_window.update if @status_window
   @location_window.update
   if @command_window.active
     update_command_selection
   elsif @status_window.active
     update_actor_selection
   end
 end
 #--------------------------------------------------------------------------
 # * Create Command Window
 #--------------------------------------------------------------------------
 def create_command_window
   s1 = Vocab::item     ;  s2 = Vocab::skill
   s3 = Vocab::equip    ;  s4 = Vocab::status
   s5 = "Save Game"     ;  s6 = "Load Game"
   s7 = Vocab::Quest    ;  s8 = Vocab::game_end
   c1 = Cache::picture('Icon_Items');  c2 = Cache::picture('Icon_Skills')
   c3 = Cache::picture('Icon_Equip');  c4 = Cache::picture('Icon_Status')
   c5 = Cache::picture('Icon_Save');  c6 = Cache::picture('Icon_Load')
   c7 = Cache::picture('Icon_Quest'); c8 = Cache::picture('Icon_End')
   @command_window = Window_RingMenu.new(232, 164, [s1, s2, s3, s4, s5, s6, s7, s8], [c1, c2, c3, c4, c5, c6, c7, c8], @move, @menu_index)
   if $game_party.members.size == 0
     @command_window.disable_item(0)
     @command_window.disable_item(1)
     @command_window.disable_item(2)
     @command_window.disable_item(3)
   end
   if $game_system.save_disabled
     @command_window.disable_item(4)
   end
 end
 #--------------------------------------------------------------------------
 # * Create Command Window
 #--------------------------------------------------------------------------
 def create_status_window
   names = []
   chars = []
   for i in 0...$game_party.members.size
     names = $game_party.members.name
     chars = $game_party.members
   end
   @status_window = Window_RingMenu.new(255, 200, names, chars, true, $game_party.last_actor_index, true)
 end
 #--------------------------------------------------------------------------
 # * Update Command Selection
 #--------------------------------------------------------------------------
 def update_command_selection
   if Input.trigger?(Input::B)
     Sound.play_cancel
     $scene = Scene_Map.new
   elsif Input.trigger?(Input::C)
     if $game_party.members.size == 0 and @command_window.index < 4
       Sound.play_buzzer
       return
     elsif $game_system.save_disabled and @command_window.index == 4
       Sound.play_buzzer
       return
     end
     Sound.play_decision
     case @command_window.index
     when 0      # Item
       $scene = Scene_Item.new
     when 1      # Skill
       $scene = Scene_Skill.new
     when 2      # Equipment
       $scene = Scene_Equip.new
     when 3      # Status
       $scene = Scene_Status.new
     when 4      # Save
       $scene = Scene_File.new(true, false, false)
     when 5      # Load
       $scene = Scene_File.new(false, false, false)
     when 6      # Quest
       $scene = Scene_Quest.new
     when 7      # End Game
       $scene = Scene_End.new
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Start Actor Selection
 #--------------------------------------------------------------------------
 def start_actor_selection
   @command_window.active = false
   @command_window.visible = false
   create_status_window
   if $game_party.last_actor_index < @status_window.item_max
     @status_window.index = $game_party.last_actor_index
   else
     @status_window.index = 0
   end
 end
 #--------------------------------------------------------------------------
 # * End Actor Selection
 #--------------------------------------------------------------------------
 def end_actor_selection
   @command_window.active = true
   @command_window.visible = true
   @status_window.dispose if @status_window
   @status_window = nil
 end
end
 
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  Edited to return to the menu properly when loading
#==============================================================================
 
class Scene_File
 alias return_scene_original return_scene
 def return_scene
   if @from_title
     $scene = Scene_Title.new
   elsif @from_event
     $scene = Scene_Map.new
   else
     if @saving
       $scene = Scene_Menu.new(4)
     else
       $scene = Scene_Menu.new(5)
     end
   end
 end
end
 
#==============================================================================
# ** Scene_End
#------------------------------------------------------------------------------
#  Edited to return to the menu properly due to loading being added
#==============================================================================
 
class Scene_End
 alias return_scene_original return_scene
 def return_scene
   $scene = Scene_Menu.new(6)
 end
end
 
#==============================================================================
# ** Window_Location
#------------------------------------------------------------------------------
#  This class shows the current map name.
#==============================================================================
 
class Window_location < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize(x, y)
   super(x, y, 160, (WLH*2) + 32)
   self.contents = Bitmap.new(width - 32, height - 32)
   refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   $maps = load_data("Data/MapInfos.rvdata")
   @map_id = $game_map.map_id
   @currmap = $maps[@map_id].name
   self.contents.font.color = system_color
   self.contents.draw_text(0, -4, 128, 32, "Location :")
   self.contents.font.color = normal_color
   self.contents.draw_text(0, -4+WLH, 128, 32, @currmap, 1)
 end
end
 
#==============================================================================
# ** Window_RingMenu
#------------------------------------------------------------------------------
#  This Window creates a Ring Menu system
#==============================================================================
 
class Window_RingMenu < Window_Base
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :index
 attr_reader   :item_max
 #--------------------------------------------------------------------------
 # * Refresh Setup
 #--------------------------------------------------------------------------
 START = 1
 WAIT  = 2
 MOVER = 3
 MOVEL = 4
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize(center_x, center_y, commands, items, move = true, index = 0, character = false)
   super(0, 0, 544, 416)
   self.contents = Bitmap.new(width-32, height-32)
   self.opacity = 0
   @move = move
   @char = character
   @startup = STARTUP_FRAMES
   @commands = commands
   @item_max = commands.size
   @index = index
   @items = items
   @disabled = []
   for i in 0...commands.size-1
     @disabled = false
   end
   @cx = center_x
   @cy = center_y
   start_setup
   refresh
 end
 #--------------------------------------------------------------------------
 # * Start Setup
 #--------------------------------------------------------------------------
 def start_setup
   @mode = START
   @steps = @startup
 end
 #--------------------------------------------------------------------------
 # * Disable index
 #     index : item number
 #--------------------------------------------------------------------------
 def disable_item(index)
   @disabled[index] = true
 end
 #--------------------------------------------------------------------------
 # * Determines if is moving
 #--------------------------------------------------------------------------
 def animation?
   return @mode != WAIT
 end
 #--------------------------------------------------------------------------
 # * Determine if cursor is moveable
 #--------------------------------------------------------------------------
 def cursor_movable?
   return false if (not visible or not active)
   return false if (@opening or @closing)
   return false if animation?
   return true
 end
 #--------------------------------------------------------------------------
 # * Move cursor right
 #--------------------------------------------------------------------------
 def cursor_right
   @index -= 1
   @index = @items.size - 1 if @index < 0
   @mode = MOVER
   @steps = MOVING_FRAMES
 end
 #--------------------------------------------------------------------------
 # * Move cursor left
 #--------------------------------------------------------------------------
 def cursor_left
   @index += 1
   @index = 0 if @index >= @items.size
   @mode = MOVEL
   @steps = MOVING_FRAMES
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   super
   if self.active
     if cursor_movable?
       last_index = @index
       if Input.repeat?(Input::DOWN) or Input.repeat?(Input::RIGHT)
         cursor_right
       end
       if Input.repeat?(Input::UP) or Input.repeat?(Input::LEFT)
         cursor_left
       end
       if @index != last_index
         Sound.play_cursor
       end
     end
     refresh
   end
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh   
   self.contents.clear
   case @mode
   when START
     refresh_start
   when WAIT
     refresh_wait
   when MOVER
     refresh_move(1)
   when MOVEL
     refresh_move(0)
   end
   rect = Rect.new(18, 196, self.contents.width-32, 32)
   self.contents.draw_text(rect, @commands[@index], 1)
 end
 #--------------------------------------------------------------------------
 # * Refresh Start Period
 #--------------------------------------------------------------------------
 def refresh_start
   d1 = 2.0 * Math::PI / @item_max
   d2 = 1.0 * Math::PI / @startup
   for i in 0...@item_max
     j = i - @index
     if @move
       r = RING_R - 1.0 * RING_R * @steps / @startup
       d = d1 * j + d2 * @steps
     else
       r = RING_R
       d = d1 * j
     end
     x = @cx + ( r * Math.sin( d ) ).to_i
     y = @cy - ( r * Math.cos( d ) ).to_i
     draw_item(x, y, i)
   end
   @steps -= 1
   if @steps < 1
     @mode = WAIT
   end
 end
 #--------------------------------------------------------------------------
 # * Refresh Wait Period
 #--------------------------------------------------------------------------
 def refresh_wait
   d = 2.0 * Math::PI / @item_max
   for i in 0...@item_max
     j = i - @index
     x = @cx + ( RING_R * Math.sin( d * j ) ).to_i
     y = @cy - ( RING_R * Math.cos( d * j ) ).to_i
     draw_item(x, y, i)
   end
 end
 #--------------------------------------------------------------------------
 # * Refresh Movement Period
 #--------------------------------------------------------------------------
 def refresh_move( mode )
   d1 = 2.0 * Math::PI / @item_max
   d2 = d1 / MOVING_FRAMES
   d2 *= -1 if mode != 0
   for i in 0...@item_max
     j = i - @index
     d = d1 * j + d2 * @steps
     x = @cx + ( RING_R * Math.sin( d ) ).to_i
     y = @cy - ( RING_R * Math.cos( d ) ).to_i
     draw_item(x, y, i)
   end
   @steps -= 1
   if @steps < 1
     @mode = WAIT
   end
 end
 #--------------------------------------------------------------------------
 # * Draw Item
 #     x     : draw spot x-coordinate
 #     y     : draw spot y-coordinate
 #     index : item number
 #--------------------------------------------------------------------------
 def draw_item(x, y, index)
   if @char
     if @index == index
       draw_character(@items[index].character_name, @items[index].character_index , x, y)
       if @mode == WAIT
         #draw_actor_hp_ring(@items[index], @cx, @cy-16, 50, 6, 84, 270, true)
         #draw_actor_mp_ring(@items[index], @cx, @cy-16, 50, 6, 84, 180, false)
         #draw_actor_exp_ring(@items[index], @cx, @cy-16, 50, 6, 155, 12, false)
       end
     else
       draw_character(@items[index].character_name, @items[index].character_index , x, y, false)
     end
   else
     rect = Rect.new(0, 0, @items[index].width, @items[index].height)
     if @index == index
       self.contents.blt( x, y, @items[index], rect )
       if @disabled[@index]
         self.contents.blt( x, y, ICON_DISABLE, rect )
       end
     else
       self.contents.blt( x, y, @items[index], rect, 128 )
     end
   end
 end
end
 
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  Edited to allow disabled character icons
#==============================================================================
 
class Window_Base < Window
 #--------------------------------------------------------------------------
 # * Draw Character Graphic
 #--------------------------------------------------------------------------
 def draw_character(character_name, character_index, x, y, enabled = true)
   return if character_name == nil
   bitmap = Cache.character(character_name)
   sign = character_name[/^[\!\$]./]
   if sign != nil and sign.include?('$')
     cw = bitmap.width / 3
     ch = bitmap.height / 4
   else
     cw = bitmap.width / 12
     ch = bitmap.height / 8
   end
   n = character_index
   src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
   self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, enabled ? 255 : 128)
 end
end


The Ring Menu crashes on line 430 with a TypeError.

'String can't be coerced into Fixnum'

Line 430 reads "j = i - @index"
« Last Edit: September 19, 2010, 04:26:17 AM by fthmdg »
Currently working on :: The Empire

And check the forums!

*
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, firstly, use a code box when posting scripts because BBCode corrupts the script. Secondly, line 430 in the script you posted is a comment. Thirdly, that script requires a number of graphics which you didn't provide and which I have no interest in hunting down.

If I had to take a guess from what you said the error was, then this particular problem is probably the following: at around line 1030 of the Quest Journal script, there is a line like this:

Code: [Select]
        $scene = Scene_Menu.new ('Quest')

It relies on a code in Scene_Menu which converts that into an integer; with a custom menu, that may or may not happen. I'm guessing it doesn't in this case. Just change it to whatever index the Quest Journal is in your menu, so:

Code: [Select]
        $scene = Scene_Menu.new (6)

**
Rep: +0/-0Level 82
Hrmph.
Sorry about that. And yeah, 430 was commented out because it was raising an error, and I was trying a few things out.

I already got some help though, but thanks
Currently working on :: The Empire

And check the forums!

*
Rep: +0/-0Level 74
RMRK Junior
I'm having problems with this MAJOR NOOB!

I used the custom thing by cool man and i made an event that states: call script, "$game_party.quests[Save the girl].reveal_objective (Find some rope)" When my quest is name = "Save the girl"
      description = "You happened along a pit that held a female voice, it called for help."
      icon_index = 79
      objectives[0] = "Find some rope"
      objectives[1] = "Climb down the pit"
      objectives[2] = "Investigate the voice"
      prime = []
      prime.push(0)
      prime.push(1)
      prime.push(2)
   
in the script

Did I do something wrong? Please help with easy steps
 :-[

 

*
Rep: +0/-0Level 74
RMRK Junior
Sorry, I forgot to put that my error was called "Syntax error occurred while running script" but it wont show me where


I looked at the above section about the argument, adjusted my call script, and now it working, thx for the script
« Last Edit: October 29, 2010, 12:54:14 AM by shadowlink97 »

**
Rep: +0/-0Level 74
RMRK Junior
I'm trying to creat a few repeatable quests for some NPCs but I'm having trouble. Basically for alchemy for example.. I go out and collect different types of herbs and turn them into an alchemy vendor to craft potions for me.

If you could guide me through it, I would appreciate it.

***
Rep:
Level 84
---> LOL <---
I has a question

You know after you give the reward for the quest, if you continue to talk to said person all they may say is "thank you". Well I have some on who gives you choices after.

SO:

- Say thank you if reward is given
 -- show choices after some text.

But its stuck in a loop. Every time I talk to them it says "Thank you" and then it shows some text and then the choices.

How would I get them to say "thank you" only upon giving you the reward, and then every time you talk to them after that it just go straight to the text and then choices?

Hope that made sense


*
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
Just use a self-switch and a conditional branch. So, have the event something like this:

@>Conditional Branch: Self Switch [A] == OFF
    @>Text: Thank You
    @>Control Self Switch: [A] is ON
  :  Branch End
@>The rest of the stuff you want to put

*
Rep: +0/-0Level 73
RMRK Junior
#        $game_party.quests[quest_id].reveal_objective (objective_id)
#        $game_party.quests[quest_id].conceal_objective (objective_id)
#        $game_party.quests[quest_id].complete_objective (objective_id)
#        $game_party.quests[quest_id].uncomplete_objective (objective_id)
#        $game_party.quests[quest_id].fail_objective (objective_id)
#        $game_party.quests[quest_id].unfail_objective (objective_id)
#        $game_party.quests[quest_id].complete?
#        $game_party.quests[quest_id].failed?
#        $game_party.quests[quest_id].reward_given = true/false
#        $game_party.quests[quest_id].concealed = true/false
#        $game_party.quests.remove (quest_id)

***
Rep:
Level 81
Monster Hunter
Added a little extra to your script hope you don't mind , locations!
 

2nd part:
Code: [Select]
#==============================================================================
# ** Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new instance variable - quests
#    aliased method - initialize
#==============================================================================

class Game_Party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_reader   :quests
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_qst_jrnl_party_init_quests initialize
  def initialize
    # Run Original Method
    modalg_qst_jrnl_party_init_quests
    # Initialize @quests
    @quests = Game_Quests.new
  end
end

#==============================================================================
# ** Game_Quests
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This class handles Quests. It is a wrapper for the built-in class "Hash".
# The instance of this class is accessed by $game_party.quests
#==============================================================================

class Game_Quests
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize
    @data = {}
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Quest
  #    quest_id : the ID of the quest
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def [] (quest_id)
    @data[quest_id] = ModAlg_QuestData::Quest.new (quest_id) if @data[quest_id] == nil
    return @data[quest_id]
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Quest List
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def list
    quest_list = @data.values
    quest_list.each { |i| quest_list.delete (i) if i.concealed }
    return quest_list
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Completed Quest List
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def completed_list
    complete_quests = []
    list.each { |i| complete_quests.push (i) if i.complete? }
    return complete_quests
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Failed Quest List
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def failed_list
    failed_quests = []
    list.each { |i| failed_quests.push (i) if i.failed? }
    return failed_quests
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Active Quest List
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def active_list
    return list - failed_list - completed_list
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Revealed?
  #    quest_id : the ID of a checked quest
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def revealed? (quest_id)
    return @data[quest_id] != nil
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Remove Quest
  #    quest_id : the ID of a checked quest
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def remove (quest_id)
    @data.delete (quest_id)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Clear
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def clear
    @data.clear
  end
end

#==============================================================================
# ** Window_Command
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new instance variable - disabled_commands
#    aliased method - initialize, draw_item
#==============================================================================

class Window_Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variable
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_reader :disabled_commands
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Initialize
  #     width      : window width
  #     commands   : command string array
  #     column_max : digit count (if 2 or more, horizontal selection)
  #     row_max    : row count (0: match command count)
  #     spacing    : blank space when items are arrange horizontally
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_quest_jrnl_intlz initialize
  def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
    # Initialize new instance variable
    @disabled_commands = []
    # Run Original Method
    modalg_quest_jrnl_intlz (width, commands, column_max, row_max, spacing)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Item
  #     index   : item number
  #     enabled : enabled flag. When false, draw semi-transparently
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_quest_jrnl_itm_drw draw_item
  def draw_item (index, enabled = true)
    # Run Original Method
    modalg_quest_jrnl_itm_drw (index, enabled)
    enabled ? @disabled_commands.delete (index) : @disabled_commands.push (index)
  end
end

#==============================================================================
# ** Window_Message
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliaed method - convert_special_characters
#==============================================================================

class Window_Message
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Convert Special Characters
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_quest_jrnl_spec_char_convert convert_special_characters
  def convert_special_characters
    @text.gsub! (/\\NQ\[(\d+)\]/i) { $game_party.quests[$1.to_i] } # Name Quest
    # Run Original Method
    modalg_quest_jrnl_spec_char_convert
  end
end

#==============================================================================
# ** Window_QuestLabel
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This window signifies that this is a quest list
#==============================================================================

class Window_QuestLabel < Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize
    super (0, 0, 160 + WLH, 32 + WLH)
    create_contents
    contents.font.color = system_color
    contents.draw_text (0, 0, contents.width, WLH, ModAlg_QuestData::QUESTS_LABEL, 1)
  end
end

#==============================================================================
# ** Window_QuestCategory
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This window displays which category is being viewed
#==============================================================================

class Window_QuestCategory < Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize
    super (0, WLH + 32, 160 + WLH, 64)
    create_contents
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Refresh
  #    category_index : icon to highlight -
  #                       0 => All, 1 => Active, 2 => Complete, 3 => Failed
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def refresh (category_index = 0)
    contents.clear
    # Retrieve Icon Bitmaps
    bitmap = Cache.system("Iconset")
    icon_index = ModAlg_QuestData::ACTIVE_QUEST_ICON
    active_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    icon_index = ModAlg_QuestData::COMPLETE_QUEST_ICON
    complete_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    icon_index = ModAlg_QuestData::FAILED_QUEST_ICON
    failed_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    # Combine the three icons for the All Icon
    all_icon = Bitmap.new (40, 32)
    all_icon.blt (0, 0, bitmap, complete_rect)
    all_icon.blt (20, 0, bitmap, failed_rect)
    all_icon.blt (8, 10, bitmap, active_rect)
    distance = (contents.width - 112) / 3
    x = 0
    # Draw the 'All' Icon onto the window
    contents.blt (x, 0, all_icon, all_icon.rect, category_index == 0 ? 255 : 128)
    x += 40 + distance
    # Draw the 'Active' Icon onto the window
    contents.blt (x, 4, bitmap, active_rect, category_index == 1 ? 255 : 128)
    x += 24 + distance
    # Draw the 'Complete' Icon onto the window
    contents.blt (x, 4, bitmap, complete_rect, category_index == 2 ? 255 : 128)
    x += 24 + distance
    # Draw the 'Failed' Icon onto the window
    contents.blt (x, 4, bitmap, failed_rect, category_index == 3 ? 255 : 128)
  end
end

#==============================================================================
# ** Window_QuestList
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This window displays the list of quests
#==============================================================================

class Window_QuestList < Window_Selectable
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize (category_index = 0, index = 0)
    super (0, 64 + (WLH + 32), 160 + WLH, Graphics.height - 64 - 2*(WLH + 32))
    @data = []
    @column_max = 1
    refresh (category_index)
    self.index = index
    self.active = true
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Quest
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def quest
    return @data[self.index]
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Refresh
  #    category_index : List to show -
  #                       0 => All, 1 => Active, 2 => Complete, 3 => Failed
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def refresh (category_index = 0)
    font = Font.new
    @data.clear
    self.index = 0
    # Get the quest list to be drawn
    case category_index
    when 0
      @data = $game_party.quests.list
    when 1
      @data = $game_party.quests.active_list
      font.color = text_color (ModAlg_QuestData::ACTIVE_COLOUR)
    when 2
      @data = $game_party.quests.completed_list
      font.color = text_color (ModAlg_QuestData::COMPLETE_COLOUR)
    when 3
      @data = $game_party.quests.failed_list
      font.color = text_color (ModAlg_QuestData::FAILED_COLOUR)
    end
    @item_max = @data.size
    unless contents == nil
      # Clear Contents
      contents.clear
      return if @data.empty?
      contents.dispose
    end
    # Create Contents
    self.contents = Bitmap.new (width - 32, WLH*@data.size)
    contents.font = font
    # Draw the Quest Names
    for i in 0...@data.size
      quest = @data[i]
      # If all, distinguish between quest types by colour
      if category_index == 0
        if quest.complete?
          contents.font.color = text_color (ModAlg_QuestData::COMPLETE_COLOUR)
        elsif quest.failed?
          contents.font.color = text_color (ModAlg_QuestData::FAILED_COLOUR)
        else # Active
          contents.font.color = text_color (ModAlg_QuestData::ACTIVE_COLOUR)
        end
      end
      draw_icon (quest.icon_index, 0, i*WLH)
      # Draw the name of the quest
      contents.draw_text (24, i*WLH, contents.width - 24, WLH, quest.name)
    end
  end
end

#==============================================================================
# ** Window_QuestInfo
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This window displays the information on the quest being viewed
#==============================================================================

class Window_QuestInfo < Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize
    super (160 + WLH, 0, Graphics.width - (160 + WLH), Graphics.height - (32 + WLH))
    create_contents
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Refresh
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def refresh (quest = nil)
    contents.clear
    return if quest == nil
    # Draw the name of the Quest, centred
    contents.font.color = normal_color
    contents.draw_text (0, 0, contents.width, WLH, quest.name, 1)
    # If the font has set width characters
    if contents.text_size ('w').width == contents.text_size ('i').width
      formatter = Paragrapher::Formatter_2.new
    else
      formatter = Paragrapher::Formatter.new
    end
    # Format the description
    desc_bitmap = Bitmap.new (contents.width - 16, (2.4*WLH).to_i)
    desc_bitmap.font.size -= 4
    formatted_desc = formatter.format (quest.description, desc_bitmap)
    # Draw the Description Box
    box_height = [WLH*(formatted_desc.lines.size + 1), 3*WLH].min
    rect = Rect.new (2, (1.5*WLH).to_i, contents.width - 4, box_height)
    contents.fill_rounded_rect (rect, system_color, 10)
    rect.x, rect.y = rect.x + 2, rect.y + 2
    rect.width, rect.height = rect.width - 4, rect.height - 4
    contents.fill_rounded_rect (rect, Color.new (0, 0, 0, 0), 10)
    tw = contents.text_size ('Description').width
    # Draw the description signifier
    contents.fill_rect (32, (1.5*WLH).to_i, tw + 2, 2, Color.new (0, 0, 0, 0))
    contents.font.color = system_color
    contents.draw_text (33, WLH, tw, WLH, 'Description')           
    # Paragraph Artist
    artist = Paragrapher::Artist.new
    # If bitmap is too large
    if formatted_desc.lines.size < 2
      formatted_desc.bitmap = Bitmap.new (contents.width - 16, formatted_desc.lines.size*WLH)
      formatted_desc.bitmap.font.size -= 4
    end
    bmp = artist.draw (formatted_desc)
    # Centre within the box
    y = rect.y + 4 + (rect.height - bmp.height) / 2
    contents.blt (8, y, bmp, bmp.rect)
    bmp.dispose
    y = 2*WLH + rect.height + 4
   
 ###############################################################################   
    # Format the description
    loc_bitmap = Bitmap.new (contents.width - 16, (2.4*WLH).to_i)
    loc_bitmap.font.size -= 4
    formatted_loc = formatter.format (quest.location, loc_bitmap)
    # Draw the Description Box
#~     box_height = [WLH*(formatted_loc.lines.size + 1), 3*WLH].min
#~     rect = Rect.new (2, (1.5*WLH).to_i, contents.width - 4, box_height)
#~     contents.fill_rounded_rect (rect, system_color, 10)
#~     rect.x, rect.y = rect.x + 2, rect.y + 2
#~     rect.width, rect.height = rect.width - 4, rect.height - 4
#~     contents.fill_rounded_rect (rect, Color.new (0, 0, 0, 0), 10)
#~     tw = contents.text_size ('Location').width
    # Draw the description signifier
    contents.fill_rect (32, 300, tw + 2, 2, Color.new (0, 0, 0, 0)) #(32,(1.5*WLH).to_i,
    contents.font.color = normal_color
    contents.draw_text (33, 300, tw, WLH, 'Location')
    # Paragraph Artist
    artist = Paragrapher::Artist.new
    # If bitmap is too large
    if formatted_loc.lines.size < 2
      formatted_loc.bitmap = Bitmap.new (contents.width - 16, formatted_loc.lines.size*WLH)
      formatted_loc.bitmap.font.size -= 4
    end
    bmp = artist.draw (formatted_loc)
    # Centre within the box
    y = 305 #rect.y + 4 + (rect.height - bmp.height) / 2
    x = 125
    contents.blt (x, y, bmp, bmp.rect)
    bmp.dispose
    y = 2*WLH + rect.height + 4       
   
 ###############################################################################             
       
    # Draw Objectives Signifier Text
    contents.font.color = system_color
    tw = contents.text_size ('Objectives').width
    contents.draw_text (32, y, tw, WLH, 'Objectives')
    y += WLH
    quest.revealed_objectives.each { |i|
      # Get the correct color
      contents.font.color = quest.complete_objectives.include? (i) ?
        text_color (ModAlg_QuestData::COMPLETE_COLOUR) : quest.failed_objectives.include? (i) ?
        text_color (ModAlg_QuestData::FAILED_COLOUR) : text_color (ModAlg_QuestData::ACTIVE_COLOUR)
      # Get objective
      objective = quest.objectives[i]
      # Draw Bullet
      tw = contents.text_size (ModAlg_QuestData::BULLET_CHARACTER).width
      x = 8
      contents.draw_text (x, y, tw, WLH, ModAlg_QuestData::BULLET_CHARACTER)
      x += tw + 4
      # Format the objective
      obj_bitmap = Bitmap.new (contents.width - x, 2*WLH)
      obj_bitmap.font = contents.font
      obj_bitmap.font.size -= 4
      formatted_obj = formatter.format (objective, obj_bitmap)
      # Draw Objective
      bmp = artist.draw (formatted_obj)
      contents.blt (x, y + 4, bmp, bmp.rect)
      # Modify the Y accordingly
      y += WLH*([formatted_obj.lines.size, 2].min)
    }
  end
end

#==============================================================================
# ** Scene_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased method - update
#==============================================================================

class Scene_Map < Scene_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Frame Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_quest_journal_map_upd_key_access update
  def update
    modalg_quest_journal_map_upd_key_access
    # If the quest log can be accessed by key and is not empty or disabled
    if $game_system.quest_keyaccess && !$game_system.quest_disabled && !$game_party.quests.list.empty?
      $scene = Scene_Quest.new if Input.trigger? (ModAlg_QuestData::MAPKEY_BUTTON)
    end
  end
end

#==============================================================================
# ** Scene_Menu
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased methods - initialize, create_command_window, update_command_selection
#==============================================================================

class Scene_Menu < Scene_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_quest_jrnl_init initialize
  def initialize(menu_index = 0)
    modalg_quest_jrnl_init (menu_index)
    return unless $game_system.quest_menuaccess
    if @menu_index == 'Quests'
      @menu_index = ModAlg_QuestData::MENU_INDEX
    elsif @menu_index >= ModAlg_QuestData::MENU_INDEX
      @menu_index += 1
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Command Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_quest_journal_menu_cmmnd_win_create create_command_window
  def create_command_window
    modalg_quest_journal_menu_cmmnd_win_create
    # If accessed through map, then don't add it to the menu
    return unless $game_system.quest_menuaccess
    c = @command_window.commands
    c.insert (ModAlg_QuestData::MENU_INDEX, ModAlg_QuestData::QUESTS_LABEL)
    width = @command_window.width
    disabled = @command_window.disabled_commands
    @command_window.dispose
    @command_window = Window_Command.new(width, c)
    @command_window.index = @menu_index
    # Disable all of the old commands as well
    disabled.each { |i|
      i += 1 if i >= ModAlg_QuestData::MENU_INDEX
      @command_window.draw_item (i, false)
    }
    if $game_system.quest_disabled || $game_party.quests.list.empty? # If Quest Journal disabled
      @command_window.draw_item (ModAlg_QuestData::MENU_INDEX, false)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Command Selection
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_quest_journal_menu_cmmnd_select_upd update_command_selection
  def update_command_selection
    if $game_system.quest_menuaccess
      changed = false
      if @command_window.index == ModAlg_QuestData::MENU_INDEX && Input.trigger? (Input::C)
        if $game_system.quest_disabled || $game_party.quests.list.empty? # If Quest Journal disabled
          Sound.play_buzzer
        else
          # Open Quest Window
          Sound.play_decision
          $scene = Scene_Quest.new
        end
        return
      end
      # If the command index is greater than it ought to be, make sure
      if @command_window.index > ModAlg_QuestData::MENU_INDEX
        @command_window.index = (@command_window.index - 1) % @command_window.commands.size
        changed = true
      end
    end
    modalg_quest_journal_menu_cmmnd_select_upd
    return unless $game_system.quest_menuaccess
    @command_window.index = (@command_window.index + 1) % @command_window.commands.size if changed
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Actor Selection
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_quest_jrnl_actor_selection_upd update_actor_selection
  def update_actor_selection
    changed = false
    if $game_system.quest_menuaccess && @command_window.index > ModAlg_QuestData::MENU_INDEX
      @command_window.index = (@command_window.index - 1) % @command_window.commands.size
      changed = true
    end
    modalg_quest_jrnl_actor_selection_upd
    return unless $game_system.quest_menuaccess
    @command_window.index = (@command_window.index + 1) % @command_window.commands.size if changed
  end
end

#==============================================================================
# ** Scene_Quest
#------------------------------------------------------------------------------
#  This class performs the quest screen processing.
#==============================================================================

class Scene_Quest < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(category_index = 0, quest_index = 0)
    @category_index = category_index
    @quest_index = quest_index
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    # Create Windows
    @label_window = Window_QuestLabel.new
    @category_window = Window_QuestCategory.new
    @category_window.refresh (@category_index)
    @list_window = Window_QuestList.new (@category_index, @quest_index)
    @info_window = Window_QuestInfo.new
    @info_window.refresh (@list_window.quest)
    @help_window = Window_VarySizeHelp.new
    @help_window.y = Graphics.height - @help_window.height
    @help_window.set_text ('Use Horizontal Arrow Keys to change categories', 1)
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @label_window.dispose
    @category_window.dispose
    @list_window.dispose
    @info_window.dispose
    @help_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    # Since the only possible activity is from @list_window, put it here
    @list_window.update
    if Input.trigger?(Input::B) # If Button B is pressed
      Sound.play_cancel
      $scene = Scene_Menu.new
      # If Returning to Menu
#~       if $game_system.quest_menuaccess
#~         $scene = Scene_Menu.new('Quests')
#~       else # Returning to Map
#~         $scene = Scene_Menu.new
#~       end
    elsif Input.trigger? (Input::C) # If C button is pressed
      # Open Journal (eventually)
    elsif Input.trigger? (Input::LEFT) # If Left direction pressed
      # Play Cursor SE
      Sound.play_cursor
      # Refresh Category Window
      @category_index = (@category_index - 1) % 4
      @category_window.refresh (@category_index)
      @list_window.refresh (@category_index)
      @info_window.refresh (@list_window.quest)
    elsif Input.trigger? (Input::RIGHT) # If Right direction pressed
      # Play Cursor SE
      Sound.play_cursor
      # Refresh Category Window
      @category_index = (@category_index + 1) % 4
      @category_window.refresh (@category_index)
      @list_window.refresh (@category_index)
      @info_window.refresh (@list_window.quest)
    # If scrolling through quests
    elsif Input.trigger? (Input::DOWN) || Input.trigger? (Input::UP)
      # Refresh Info Window
      @info_window.refresh (@list_window.quest)
    end
  end
end

***
Rep:
Level 81
Monster Hunter

1rst part:
Code: [Select]
#==============================================================================
#  Quest Journal
#  Version: 1.1
#  Author: modern algebra (rmrk.net)
#  Date: March 24, 2008
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Description:
#      Basically, this script is an objective based quest log that allows the
#    user to make quests and reveal them to the characters through specified
#    script calls. It is objective based, meaning that you advance the quest
#    by having the player complete objectives and you can choose when to reveal
#    these objectives and when to set them as complete or as failed. That being
#    said, this script does not build quests, it more or less gives you a
#    graphical interface for showing quest progress. It does run by script
#    call, and so read the instructions carefully if you want to use this script
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Instructions:
#      Basically, set up all of your quests in the module below. The Constants
#    section is annotated, so read the comments near them to determine what you
#    should set these constants to. As you can see, they are filled in with
#    default values currently, and so that should give you an idea of what to
#    do.
#
#      Setting up quests can be a little bit harder. You will have to set one
#    of these up for every quest that you want represented in the scene. Refer
#    to the editable region inside the class Quest for further instructions
#
#      Once they are setup, you can activate them at any time in the game by
#    this code:
#
#      $game_party.quests[quest_id]
#
#    There are several methods you can call that are of relevance. Namely:
#
#        $game_party.quests[quest_id].reveal_objective (objective_id)
#        $game_party.quests[quest_id].conceal_objective (objective_id)
#        $game_party.quests[quest_id].complete_objective (objective_id)
#        $game_party.quests[quest_id].uncomplete_objective (objective_id)
#        $game_party.quests[quest_id].fail_objective (objective_id)
#        $game_party.quests[quest_id].unfail_objective (objective_id)
#        $game_party.quests[quest_id].complete?
#        $game_party.quests[quest_id].failed?
#        $game_party.quests[quest_id].reward_given = true/false
#        $game_party.quests[quest_id].concealed = true/false
#        $game_party.quests.remove (quest_id)
#
#   
#   
#    -reveal_objective :naturally allows the specified objective to appear in the Quest Journal for browsing
#    by the user.
#    -complete_objective :notes when an objective is complete.
#    -fail_objective :notes when the player has done something that fails this
#    objective.
#    -complete? :returns true if all primary objectives have been
#    completed.
#    -failed? :returns true if any primary objective has been
#    failed.
#    -reward_given :serves the function of a switch. You should
#    essentially make the reward event look like this:
#
#      @> Conditional Branch: Script: $game_party.quests[quest_id].complete?
#        @> Conditional Branch: Script: $game_party.quests[quest_id].reward_given
#          @> ...Thank you or whatever you want the event to say once the reward has been given
#        @> Else
#          @> ...Give Reward
#          @> Script: $game_party.quests[quest_id].reward_given = true
#        @> Branch End
#      @> Branch End
#
#     Later versions of this script will have an auto-reward system and also a
#     Journal to which the player can write notes.
#
#     You can also disable access to the Quest Log at any time with the code:
#       $game_system.quest_disabled = true
#
#     And you can change how it is accessed with the codes:
#     
#       $game_system.quest_keyaccess = true / false  # ON MAP
#       $game_system.quest_menuaccess = true / false # IN MENU
#
#     Also, in a message, \nq[quest_id] will retrieve the name of a quest and
#     print it in a message
#================================================================================
# *** Quest Data
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This is the configuration class for the Quest Journal
#================================================================================

module ModAlg_QuestData
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Constants
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Editable Region
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  QUESTS_LABEL = 'Quests'        # What you want Quests to be called (eg. 'Missions')
  ACTIVE_QUEST_ICON = 149        # What icon signifies a quest is active
  COMPLETE_QUEST_ICON = 150      # What icon signifies a quest is complete
  FAILED_QUEST_ICON = 179        # What icon signifies a quest is failed
  BULLET_CHARACTER = '?'         # The character used for listing objectives
  ACTIVE_COLOUR = 0              # The colour of a quest that is active
  COMPLETE_COLOUR = 11           # The colour of a quest that is complete
  FAILED_COLOUR = 18             # The colour of a quest that is failed
  MENU_ACCESS = true             # Can the script be accessed through the menu?
  MENU_INDEX = 4                 # If above is true, where in the command window?
  KEY_ACCESS = false             # Can the quest log be accessed by a key         
  MAPKEY_BUTTON = Input::L       # If above is true, which button?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Quest Data
  #----------------------------------------------------------------------------
  #  Returns skeleton data for the quesr
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def self.quest_data (id)
    # Set class variables to corresponding arguments
    objectives = []
    name = '??????'
    description = '??????????'
    icon_index = 0
    case id
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * EDITABLE REGION
    #------------------------------------------------------------------------
    #  To set up a quest, first identify it with an ID - this can be anything
    #  as long as it is not the same as another quest, but it is important to
    #  remember this ID as it is the only way to access your quest.
    #    In any case, the format for setting up a quest is:
    #
    #      when <quest_id> # Give the quest an ID number
    #        name = '<quest_name>'
    #        description = '<quest_description>'
    #        objectives[0] = '<first_objective>'
    #        ...
    #        objectives[n] = '<nth objective>'
    #        prime = [<objective_id>, ..., <objective_id>]
    #        icon_index = <quest_icon_index>
    #
    #    Each of these values have an importance.
    #      name is the name of the quest
    #      description is a small blurb explaining the overall goal of the quest
    #      objective[0..n] are short-term goals that lead to the overall goal
    #      primes are which objectives need to be complete before the quest is
    #        considered to be complete
    #      icon_index is the icon that represents the quest
    #
    #    Note that any of the above values can be omitted without throwing an
    #    error, but for the quest to work properly you should at least set the
    #    name, description, and objectives. If you do omit these, the default
    #    values are:
    #   
    #      name = '??????'
    #      description = '??????????'
    #      objectives = []
    #      prime = [all objectives]
    #      icon_index = 0
    #
    #   If you do want to require that all objectives must be satisfied before
    #   the quest is complete, then do not bother defining it. Otherwise, be
    #   sure to set it.
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    when 1 # Fetch
      name = 'Fetch'
      description = 'Martha needs someone to play with her dog'
      objectives[0] = 'Find a stick'
      objectives[1] = 'Throw the stick to the dog'
      objectives[2] = 'Retrieve the stick from the dog'
      icon_index = 79
      location = 'Yeah it works!!'
      when 2 #clock key
        name = "Clock key"
        description ="The item shop keeper is going nuts because of his clock, he would like to turn it off, but he doesn't seem to be able to find the key."
        objectives[0] ="Find out where the key could be"
        objectives[1] ="Find something to dig"
        objectives[2] ="Dig to find the key"
        objectives[3] ="Return to the item shop keeper to hand him over the key"
        objectives[4] ="Turn of the clock for the item shop keeper"
        icon_index = 80
        prime = [0,2]
      when 3 #
#~         name = ""
#~         description =""
#~         objectives[0] =""
#~         objectives[1] =""
#~         objectives[2] =""
#~         objectives[3] =""
#~         objectives[4] =""
#~         icon_index =
#~         prime = [] 
      when 4 # Cat Retrieval
      name = 'Cat Retrieval'
      description = 'Mrs.Bunderby has lost her cat, and she has employed you to find it.'
      objectives[0] = 'Find the lost cat'
      objectives[1] = 'Find a way to get to the cat'
      objectives[2] = 'Climb the tree and retrieve the cat'
      objectives[3] = "Return a cat to Mrs. Bunderby"
      # Set prime objectives in an array based on index
      prime = [0, 2]
      icon_index = 137
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * END EDITABLE REGION
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    end
    return name, description, objectives, prime, icon_index, location
  end
 
  #============================================================================
  # ** Quest
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  #  Holds in-game data for a quest
  #============================================================================

  class Quest
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Public Instance Variables
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    attr_reader   :name                # The name of the quest
    attr_reader   :id                  # The ID in $game_party.quests
    attr_reader   :description         # A blurb explaining the quest
    attr_reader   :objectives          # An array of strings holding objectives
    attr_reader   :prime_objectives    # An array of crucial objectives
    attr_reader   :icon_index          # The Icon associated with this quest
    attr_reader   :revealed_objectives # An array of revealed objectives
    attr_reader   :complete_objectives # An array of completed objectives
    attr_reader   :failed_objectives   # An array of failed objectives
    attr_accessor :reward_given        # A switch to ensure only one reward given
    attr_accessor :concealed           # A switch to show or not show the quest
    attr_reader   :location
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Object Initialization
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def initialize (id)
      @id = id
      # Set class variables to corresponding arguments
      @name, @description, @objectives, prime, @icon_index, @location = ModAlg_QuestData.quest_data (id)
      # If no primary objectives are specified
      if prime.nil?
        # All objectives become primary
        prime = []
        for i in 0...@objectives.size
          prime.push (i)
        end
      end
      @prime_objectives = prime
      # Initialize non-public arrays
      @revealed_objectives = []
      @complete_objectives = []
      @failed_objectives = []
      @reward_given = false
      @concealed = false
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Reveal Objective
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def reveal_objective (index)
      return if index >= @objectives.size
      # Add to revealed objectives
      @revealed_objectives |= [index]
      # Sort from lowest index to highest index
      @revealed_objectives.sort!
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Conceal Objective
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def conceal_objective (index)
      @revealed_objectives.delete (index)
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Complete Objective
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def complete_objective (index)
      return if index >= @objectives.size
      # If the objective is failed, you cannot complete it.
      return if @failed_objectives.include? (index)
      # Reveal the objective if it was not previously revealed
      reveal_objective (index) unless @revealed_objectives.include? (index)
      # Add to complete objectives
      @complete_objectives |= [index]
      # Sort from lowest index to highest index
      @complete_objectives.sort!
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Uncomplete Objective
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def uncomplete_objective (index)
      @complete_objectives.delete (index)
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Fail Objective
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def fail_objective (index)
      return if index >= @objectives.size
      # Reveal the objective if it has not yet been revealed
      reveal_objective (index) unless @revealed_objectives.include? (index)
      # Add to revealed objectives
      @failed_objectives |= [index]
      # Sort from lowest index to highest index
      @failed_objectives.sort!
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Unfail Objective
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def unfail_objective (index)
      @failed_objectives.delete (index)
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Complete?
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def complete?
      # Check if all prime objectives have been completed
      return (@complete_objectives & @prime_objectives) == @prime_objectives
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Failed?
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def failed?
      # Check if any prime objectives have been failed
      return (@failed_objectives & @prime_objectives) != []
    end
  end
end

#==============================================================================
# ** Ellipse
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Stores an ellipse object.
#==============================================================================

class Ellipse
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_reader   :a # The width of the oval
  attr_reader   :b # The Height of the oval
  attr_reader   :x # the top left x position
  attr_reader   :y # the top left y position
  attr_reader   :h # The x position of the origin
  attr_reader   :k # The y position of the origin
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #     x : the top left x position
  #     y : the top left y position
  #     a : the width of oval from origin to the side
  #     b : the height of oval from origin. If nil, then a is radius of circle
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize (x, y, a, b = nil)
    @x = x
    @y = y
    @a = a
    @b = b.nil? ? a : b
    @h = x + a
    @k = y + @b
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Within?
  #    x : the x coordinate being tested
  #    y : the y coordinate being tested
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def within? (x, y)
    x_square = ((x - @h)*(x - @h)).to_f / (@a*@a)
    y_square = ((y - @k)*(y - @k)).to_f / (@b*@b)
    # If "radius" <= 1, then it must be within the ellipse
    return (x_square + y_square) <= 1
  end
end

#==============================================================================
# ** Bitmap
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This adds the methods fill_ellipse, outline_ellipse, and fill_rounded_rect
#==============================================================================

class Bitmap
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Outline Ellipse
  #    ellipse : the ellipse being drawn
  #    width   : the width of the bar
  #    colour  : the colour of the outline
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def outline_ellipse (ellipse, colour = font.color, width = 1, steps = 0)
    # For neatness, define local variables a and b to the ellipse variables
    a, b = ellipse.a, ellipse.b
    # Use Ramanujan's approximation of the Circumference of an ellipse
    steps = Math::PI*(3*(a + b) - Math.sqrt((3*a + b)*(a + 3*b))) if steps == 0
    radian_modifier = (2*Math::PI) / steps
    for i in 0...steps
      t = (radian_modifier*i) % (2*Math::PI)
      # Expressed parametrically:
      #   x = h + acos(t), y = k + bsin(t) : where t ranges from 0 to 2pi
      x = (ellipse.h + (a*Math.cos(t)))
      y = (ellipse.k + (b*Math.sin(t)))
      set_pixel (x, y, colour)
    end
    # Thicken the line
    if width > 1
      ellipse = Ellipse.new (ellipse.x + 1, ellipse.y + 1, ellipse.a - 1, ellipse.b - 1)
      outline_ellipse (ellipse, colour, width - 1, steps)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Fill Ellipse
  #    ellipse : the ellipse being drawn
  #    colour  : the colour of the outline
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def fill_ellipse (ellipse, colour = font.color, steps = 0)
    # For neatness, define local variables a and b to the ellipse variables
    a, b = ellipse.a, ellipse.b
    # Use Ramanujan's approximation of the Circumference of an ellipse
    steps = Math::PI*(3*(a + b) - Math.sqrt((3*a + b)*(a + 3*b))) if steps == 0
    radian_modifier = (2*Math::PI) / steps
    for i in 0...(steps / 2)
      t = (radian_modifier*i) % (2*Math::PI)
      # Expressed parametrically:
      #   x = h + acos(t), y = k + bsin(t) : where t ranges from 0 to 2pi
      x = ellipse.h + (a*Math.cos(t))
      y = ellipse.k - (b*Math.sin(t))
      fill_rect (x, y, 1, 2*(ellipse.k - y), colour)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Fill Rounded Rectangle
  #    rect    : the rectangle being drawn
  #    colour  : the colour of the outline
  #    w       : the number of pixels to cover by rounding
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  #  Used to fill a rectangle with rounded corners
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def fill_rounded_rect (rect, colour = font.color, w = 8)
    # Draw Body of the rectangle
    fill_rect (rect.x + w, rect.y, rect.width - 2*w, rect.height, colour)
    # Draw Left Vertical Rect
    fill_rect (rect.x, rect.y + w, w, rect.height - 2*w, colour)
    # Draw Right Vertical Rect
    x = rect.x + rect.width - w
    fill_rect (x, rect.y + w, w, rect.height - 2*w, colour)
    # Make a circle
    circle = Ellipse.new (0, 0, w)
    for i in 0...w
      for j in 0...w
        # Upper Left Corner
        set_pixel (rect.x + i, rect.y + j, colour) if circle.within? (i, j)
        # Upper Right Corner
        set_pixel (rect.x + rect.width - w + i, rect.y + j, colour) if circle.within? (i + w, j)
        # Bottom Left Corner
        set_pixel (rect.x + i, rect.y + rect.height - w + j, colour) if circle.within? (i, j + w)
        # Bottom Right Corner
        set_pixel (rect.x + rect.width - w + i, rect.y + rect.height - w + j, colour) if circle.within? (i + w, j + w)
      end
    end
  end
end

#==============================================================================
# ** Window_VarySizeHelp
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This window is the same as Window_Help, but with variable size
#==============================================================================

class Window_VarySizeHelp < Window_Help
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize (h_x = 0, h_y = 0, h_width = Graphics.width, h_height = WLH + 32)
    super ()
    self.x, self.y, self.width, self.height = h_x, h_y, h_width, h_height
    contents.dispose
    self.contents = Bitmap.new (h_width - 32, h_height - 32)
  end
end

#==============================================================================
# ** Game_System
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new instance variables - quest_disabled, quest_keyaccess
#    aliased method - initialize
#==============================================================================

class Game_System
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_accessor :quest_disabled   # Can you access quest journal at this time
  attr_accessor :quest_keyaccess  # Is it accessible by key?
  attr_accessor :quest_menuaccess # Is it accessible through the menu
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_qst_jrnl_system_init_quests initialize
  def initialize
    # Run Original Method
    modalg_qst_jrnl_system_init_quests
    # Initialize new variables
    @quest_disabled = false
    @quest_keyaccess = ModAlg_QuestData::KEY_ACCESS
    @quest_menuaccess = ModAlg_QuestData::MENU_ACCESS
  end
end

**
Rep: +0/-0Level 72
Wow, It's been a while. But Here I Am!
Ive been looking in the post for a link to the demo and I can't find it. Btw modern your scripts are god! :D but I still can't find it. Just if you can help please.

EDIT:// OMG! I am so blind. Ehh. Found the script but demo would still be good :)
« Last Edit: January 25, 2011, 05:26:27 PM by BladesOfHades »

*
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
At the very bottom of the first post, there are two links - one to the demo and one to the script. Here it is: http://rmrk.net/index.php?action=dlattach;topic=25533.0;attach=11274

It is a pretty minimal demo though. Not sure how much it helps people.

**
Rep: +0/-0Level 72
Wow, It's been a while. But Here I Am!
:D and its a RAR file THank you THank you Thank you!! You are the Best haha

**
Rep: +0/-0Level 72
Contestant - GIAW 9
is there a way to call the quest journal through an item instead of the menu
ive tried setting up common event that the item calls and the common event says this
$scene = Scene_Quest.new
but it doesn't work i keep getting this error
Script 'Window_Base' line 158:NoMethodError occured.  undefined method ' for [1]:Array
can someone please help
I have a blog now where I will be posting my scripts that I create.

My Favorite Animes:
    1. Full Metal Panic (all 3 seasons)
    2. Dragonaut the Resonance
    3. The Legend of the Legendary Heroes
    4. Spice and Wolf
    5. Rosario + Vampire

*
Rep: +0/-0Level 72
RMRK Junior
Hi Modern Algebra, I've recently downloaded this script, and the paragraph formatter as well, I've done everything perfectly and have looked at both the demo and other sites for help. I've tried finding other people with my same problem but to no avail. It seems that when I use the complete_objective command script my game crashes and an error pops up that says "Argument Error occurred while running script. Wrong number of arguments(0 for 1)."
I have tried everything, and the wierd thing is one objective does complete, but every other one doesn't. I've spent hours now trying to find something I've done wrong but nothing seems to work. i would really appreciate help i love your scripts and i would like this one to work. I see this thread is old but i wasn't sure where else to post it, thanks for your time!

*
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
Show me exactly what you put in the call script. And note that it should have an argument, so not just complete_objective, but complete_objective (a), where a is the ID of the objective you are completing.

If I had to take a guess, you have the same problem as identified and answered earlier:

Well, it means a method was called and an argument that had to be passed to it wasn't. Since there's no line number, then that means it happened while running a call script? If so, show me what you have in the call script where that error happens.

(If I had to take a guess though, I would say it might be that a line was split into two when putting it in, so you have something like:
Code: [Select]
$game_party.quests[1].reveal_objective
(0)

a line like that would cause an error - if that is the problem, you can fix it by splitting it at a better point, like the following:

Code: [Select]
q = $game_party.quests[1]
q.reveal_objective (0)
)

***
Rep:
Level 81
Monster Hunter
i'm making a nice add-on for your script , it's an quest acception window 80% done tho :p

when you talk to an NPC it opens a window that tells the details and you can choose to accept it or not :)
+ i added the location to your script (hard to find back NPC otherwise)

***
Rep:
Level 81
hey, modern algebra
if you ever update the script again, could you add a feature that lets the user set a quest that calls a common event on completion?
That would add several interesting possiblities, such as adding custom rewards or letting the player choose how he wants to progress.

*
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
Err, well given that the quest only completes due to the custom action of the game creator, I fail to see how it would serve any purpose. Ie. you can do that already by just putting the common event call in the event(s) where you finish the quest.

Besides, I don't think I'll ever update this script.

***
Rep:
Level 75
What the...?
Modern Sir, I'm getting an error.

I was trying to invent a common event journal at first, but gave up on the idea and am currently trying to put this script into my game to replace it.  I'm fairly certain I've set up the script right.  So, it must be some sort of compatability problem between this script and another one.  Here's the Error:

NoMethodError occured
undefined method 'quest' for #<Game_Party:0x9ce2e08>

And before you ask, I've taken the liberty of creating this link to where my project can be found, so you can take  a look at it.  There are many scripts in it after all, including several which customize the Menu.  I know from reading this entire topic that this can cause issues.

Here's the link:
http://www.megaupload.com/?d=QURNVWX1

IMPORTANT:
I got it temporarily set up so that you start in a place AFTER the initial intro cutscene.  This will save you some time if you wanted to playtest it.  Just make sure you F9 and turn the switch called "BadNews10" #89 ON to bring up the initializing of the JOURNAL.  What happens here are a number of quests are open upon the player starting the actual gameplay (through an Autorun event).  The event tied to the initializing is on map "HOME" in the middle along the southern wall. 

*
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, it says that it is temporarily unavailable, but if you have accurately copied out the error message then the problem is you forgot to pluralize quest.

It's $game_party.quests, not $game_party.quest

***
Rep:
Level 75
What the...?
Modern! 

Once again, you are correct.  I actually got another similar error after fixing that one.  I had made "objectives", "objective".

As always I appreciate it!  Love the script.