Version 1.0
by Atoria (aka coolmariners98)
Introduction
Some of you may remember this script from a long time ago labeled as the Ultimate Quest Scene. This is basically the same thing and I am the same author so don't go ranting about how this script was made by someone else. I just wanted to update my first script for the VX interface.
Features
* Doesn't use any switches
* Can handle and unlimited number of quests
* Can hold up to 8 objectives per quest
* Each time an objective is completed the quest updates
* Quests appear in the menu only after you get the quest, instead of there just being a list of all quests or you can now have all of them be displayed the choice is up to you
* Keeps track of how much money, exp, completed, found, etc
* Has a nice GUI in Quest_Data
I also added some new things, while moving some stuff around as well
* You can define either quest NPCs or non-quest NPCs (quest NPCs will have a golden exclamation point over their head)
* Text wrap was added for quest info, so feel free to type a massive paragraph and it will parse it just fine
Screenshots
Demo
http://www.megaupload.com/?d=10EEPYKN
Scripts
Code:
Â
#=======================================
# ** Scene_Quests
# ** Created by coolmariners98 (Atoria)
#------------------------------------------------------------------------------
# Â Please do not copy and distribute claiming to have created this.
# Â I would like full credit, even though this script is kind of crappy.
#=======================================
class Scene_Quests
 # * Object Initialization
 def initialize(quest_index = 0)
  @quest_index = quest_index
 end
Â
 def main
  @command_window = Window_Qmand.new(160, $quest.questname) # actually makes window
  @command_window.index = @quest_index
 Â
  # while loop determines what to show
  tmp = 1
  tmp2 = 10
  tmp3 = 0
  $quest.totalfound = 0
  $quest.moneyearned = 0
  $quest.expearned = 0
  $quest.rpearned = 0
  while (tmp3 < $quest.totalquests)
   if $quest.showdisabledquests == true and $quest.qupdate[tmp] == false
    @command_window.disable_item(tmp3)
   else
    $quest.totalfound += 1
   end
   if $quest.handin[tmp3] == true
    @command_window.finished(tmp3)
    $quest.moneyearned += $quest.goldreward[tmp3]
    $quest.expearned += $quest.expreward[tmp3]
    $quest.rpearned += $quest.rpreward[tmp3]
    $quest.totalcompleted += 1
   end
   tmp += 10
   tmp2 += 10
   tmp3 +=1
  end
  Â
  # Make quest status window
  @qs_window = Quest_Status.new
  @qs_window.x = 0
  @qs_window.y = 300
Â
  # Make quest info window
  @qi_window = Quest_Info.new
  @qi_window.x = 160
  @qi_window.y = 0
  Â
  # Make quest window
  @status_window = Quest.new
  @status_window.x = 160
  @status_window.y = 180
  Graphics.transition
  # Main loop
  loop do
   # Update game screen
   Graphics.update
   # Update input information
   Input.update
   # Frame update
   update
   # Abort loop if screen is changed
   if $scene != self
    break
   end
  end
  Graphics.freeze
  # Dispose of windows
  @command_window.dispose
  @status_window.dispose
  @qs_window.dispose
  @qi_window.dispose
 end
 def update
  @command_window.update
  @status_window.update
  if @command_window.active
   update_command
   return
  end
  if @status_window.active
   update_status
   return
  end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (when command window is active)
 #--------------------------------------------------------------------------
 def update_command
  # If B button was pressed
  if Input.trigger?(Input::B)
   # Play cancel SE
   Sound.play_cancel
   # Switch to map screen
   $scene = Scene_Map.new
   return
  end
  # If C button was pressed
  if Input.trigger?(Input::C)
   index = @command_window.index
   #pattern on switch is index * 10 + 1
   if $quest.qupdate[index * 10 + 1] == false
    Sound.play_buzzer
    return
   else
    $quest.whichquest = index
    Sound.play_decision   Â
    @status_window.dispose
    @status_window = Quest.new
    @status_window.x = 160
    @status_window.y = 180
    @status_window.update
   end
   return
  end
 end
Â
end
Â
#=======================================
# ** Quest_Status
# ** Created by coolmariners98
#------------------------------------------------------------------------------
# Â This displays what has been done so far in your quests (upper middle window)
#=======================================
class Quest_Status < Window_Base
 def initialize
  super(0, 0, 160, 117)
  self.contents = Bitmap.new(width - 32, height - 32)
  refresh
 end
 def refresh
  self.contents.clear
  self.contents.font.color = normal_color
  self.contents.draw_text(0, -10, 150, 32, "Total Quests: " + $quest.totalfound.to_s)
  self.contents.font.color = system_color
  self.contents.draw_text(0, 8, 150, 32, "Total Complete: " + $quest.totalcompleted.to_s)
  self.contents.font.color = normal_color
  self.contents.draw_text(0, 26, 150, 32, "Money: " + $quest.moneyearned.to_s)
  self.contents.font.color = system_color
  self.contents.draw_text(0, 44, 150, 32, "Exp: " + $quest.expearned.to_s)
  self.contents.font.color = normal_color
  self.contents.draw_text(0, 62, 150, 32, "RP: " + $quest.rpearned.to_s)
 end
end
Â
#=======================================
# ** Quest_Info
# ** Created by coolmariners98
#------------------------------------------------------------------------------
# Â This displays all the quest information in the upper right window
#=======================================
class Quest_Info < Window_Base
 def initialize
  super(0, 0, 385, 180)
  self.contents = Bitmap.new(width - 32, height - 32)
  refresh
 end
 def refresh
  self.contents.clear
  self.contents.font.color = text_color(14)
  self.contents.draw_text(0, -10, 380, 32, "Quest Information")
  self.contents.font.color = normal_color
  if $quest.totalfound != 0
   self.contents.draw_wrap_text(0, 20, 350, 16, $quest.preinfo[$quest.whichquest])
  end
 end
end
Â
#=======================================
# ** Quest
# ** Created by coolmariners98
#------------------------------------------------------------------------------
# Â This displays all the quest information in the bottom right window
#=======================================
class Quest < Window_Selectable
 def initialize
  super(0, 0, 385, 237)
  self.contents = Bitmap.new(width - 32, height - 32)
  refresh
  self.active = false
  self.index = -1
 end
 def refresh
  self.contents.clear
  if $quest.totalfound != 0
   bitmap = Cache.character($quest.charspriteN[$quest.whichquest])
   sign = $quest.charspriteN[$quest.whichquest][/^[\!\$]./]
   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 = $quest.charspriteI[$quest.whichquest]
   src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
   self.contents.blt(19 - cw / 2, 57 - ch, bitmap, src_rect)
   if $quest.qupdate[(($quest.whichquest * 10) + 10)]
    bitmap2 = Cache.picture("complete.png")
    src_rect2 = Rect.new(0, 0, bitmap2.width, bitmap2.height)
    self.contents.blt(300, 10, bitmap2, src_rect2)
   end
   self.contents.font.color = system_color
   self.contents.draw_text(50, 0, 385, 45, "Name: " + $quest.charname[$quest.whichquest])
   self.contents.font.color = normal_color
   self.contents.draw_text(50, 0, 385, 80, "Location: " + $quest.location[$quest.whichquest])
   self.contents.font.color = system_color
   self.contents.draw_text(50, 0, 385, 115, "Reward: " + $quest.textreward[$quest.whichquest])
   self.contents.font.color = normal_color
   self.contents.draw_text(0, 0, 435, 175, "Quest Objectives:")
   temp = $quest.whichquest
   script = (temp * 8)
   easy = 0
   switch = 2
   switch2 = (temp * 10) + 2
   while (switch < 10)
    if $quest.objs[script] == " "
     $quest.qupdate[switch2] = true
    end
    if $quest.qupdate[switch2]
     self.contents.font.color = text_color(7)
     self.contents.draw_text(0, 0, 435, 210 + (easy * 35), $quest.objs[script])
    else
     self.contents.font.color = normal_color
     self.contents.draw_text(0, 0, 435, 210 + (easy * 35), $quest.objs[script])
    end
    easy += 1
    script += 1
    switch += 1
    switch2 += 1
   end
Â
  end
 end
 def update_cursor_rect
  if @index < 0
   self.cursor_rect.empty
  else
   self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
  end
 end
end
#=======================================
# ** Window_Qmand
# ** Created by coolmariners98
#------------------------------------------------------------------------------
# Â This displays all the quest information in the bottom right window
#=======================================
class Window_Qmand < Window_Selectable
 def initialize(width, commands)
  super(0, 0, width, 300)
  @item_max = commands.size
  @commands = commands
  self.contents = Bitmap.new(width - 32, @item_max * 32)
  refresh
  self.index = 0
 end
 def refresh
  self.contents.clear
  for i in 0...@item_max
   draw_item(i, normal_color, true)
  end
 end
 def draw_item(index, color, enabled = true)
  self.contents.font.color = color
  rect = item_rect(index)
  rect.x += 4
  rect.width -= 8
  self.contents.clear_rect(rect)
  self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  self.contents.font.color.alpha = enabled ? 255 : 128
  self.contents.draw_text(rect, @commands[index])
 end
 def disable_item(index)
  draw_item(index, text_color(7), true)
 end
 def delete_item(index)
  rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
  self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
 end
 def finished(index)
  draw_item(index, text_color(3), true)
 end
end
Â
#==============================================================================
#==============================================================================
#==============================================================================
# ** DON'T TOUCH BELOW HERE UNLESS YOU KNOW WHAT YOU'RE DOING
#==============================================================================
#==============================================================================
#==============================================================================
#==============================================================================
# ** Event Text Display
#==============================================================================
# Created By: Ãص¹
# Modified By: SephirothSpawn
# Modified By: Meâ„¢
# Modified By: Atoria
# Version 2.1
# 2006-03-04
#==============================================================================
# * Instructions :
#
# Â ~ Creating Event With Text Display
# Â - Put a Comment on the Page With
# Â [CD____]
# Â - Place Text to Be Displayed in the Blank
#------------------------------------------------------------------------------
# * Customization :
#
# Â ~ NPC Event Colors
# Â - Event_Color = Color
#
# Â ~ Player Event Color
# Â - Player_Color = Color
#
# Â ~ Player Text
# Â - Player_Text = text_display *
#
# Â ~ text_display
# Â - 'Name', 'Class', 'Level', 'Hp', 'Sp'
#==============================================================================
Â
#==============================================================================
# ** Game_Character
#==============================================================================
Â
class Game_Character
 #--------------------------------------------------------------------------
 # * Dispaly Text Color (Event & Player)
 #--------------------------------------------------------------------------
 Event_Color = Color.new(0, 0, 200)
 Player_Color = Color.new(200, 0, 0)
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :text_display
 attr_accessor :isQuest
 attr_accessor :foundQuest
 attr_accessor :doneQuest
 attr_accessor :bounce
 attr_accessor :bounceFlip
Â
end
Â
#==============================================================================
# ** Game_Event
#==============================================================================
Â
class Game_Event < Game_Character
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias seph_characterdisplay_gevent_refresh refresh
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
  # Original Refresh Method
  seph_characterdisplay_gevent_refresh
  # Checks to see if display text
  # If the name contains CD, it takes the rest of the name as the text
  @bounce = 0
  @bounceFlip = false
  unless @list.nil?
   for i in [email=0...@list.size]0...@list.size[/email] # for all the commands in event
    if @list.code == 108 # if it is a comment
     @list.parameters[0].dup.gsub!(/\[[Cc][Dd](.+?)\]/) do
      @text_display = [$1, Event_Color]
      @isQuest = false
     end
     @list.parameters[0].dup.gsub!(/\[[Qq][Dd](.+?)\]/) do
      @text_display = [$1, Event_Color]
      @isQuest = true
     end
    end
   end
  end
  @text_display = nil if @erased
 end
end
Â
#==============================================================================
# ** Game_Player
#==============================================================================
Â
class Game_Player < Game_Character
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias seph_characterdisplay_gplayer_refresh refresh
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
  # Original Refresh Method
  seph_characterdisplay_gplayer_refresh
  # Creates Text Display
  @text_display = ["Hero", Player_Color]
 end
end
Â
#==============================================================================
# ** Sprite_Character
#==============================================================================
Â
class Sprite_Character < Sprite_Base
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias seph_characterdisplay_scharacter_update update
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
  # Original update Method
  seph_characterdisplay_scharacter_update
  # Character Display Update Method
  update_display_text
  unless @character.bounce.nil?
   if @character.bounce < -2
    @character.bounceFlip = true
   end
   if @character.bounce > 2
    @character.bounceFlip = false
   end
   if @character.bounceFlip
    @character.bounce = @character.bounce + 0.2
   else
    @character.bounce = @character.bounce - 0.2
   end
  end
 end
 #--------------------------------------------------------------------------
 # * Create Display Sprite
 #--------------------------------------------------------------------------
 def create_display_sprite(args)
  Font.default_size = 12
  Font.default_name = "Verdana"
  # Creates Display Bitmap
  bitmap = Bitmap.new(160, 24)
  bitmap2 = Bitmap.new(160, 24)
  # Changes Font Color
  bitmap.font.color = args[1]
  # Draws Text
  if @character.isQuest
   bitmap2 = Cache.picture("quest.png")
   @_quest_display = Sprite.new(self.viewport)
   @_quest_display.bitmap = bitmap2
   @_quest_display.ox = 8
   @_quest_display.oy = 40
   @_quest_display.x = self.x
   @_quest_display.y = self.y - self.oy / 2 - 24
   @_quest_display.z = 30001
   @_quest_display.visible = self.visible #true
  end
  bitmap.draw_text(0, 0, 160, 24, args[0], 1)
  # Creates Display Text Sprite
  @_text_display = Sprite.new(self.viewport)
  @_text_display.bitmap = bitmap
  @_text_display.ox = 80
  @_text_display.oy = 12
  @_text_display.x = self.x
  @_text_display.y = self.y - self.oy / 2 - 24
  @_text_display.z = 30001
  @_text_display.visible = self.visible #true
 end
 #--------------------------------------------------------------------------
 # * Dispose Display Sprite
 #--------------------------------------------------------------------------
 def dispose_display_text
  unless @_text_display.nil?
   @_text_display.dispose
  end
  #reset font colors
  Font.default_size = 14
  Font.default_name = "Verdana"
 end
 #--------------------------------------------------------------------------
 # * Dispose Quest Sprite
 #--------------------------------------------------------------------------
 def dispose_quest_text
  unless @_quest_display.nil?
   @_quest_display.dispose
  end
  #reset font colors
  Font.default_size = 14
  Font.default_name = "Verdana"
 end
 #--------------------------------------------------------------------------
 # * Update Display Sprite
 #--------------------------------------------------------------------------
 def update_display_text
  unless @character.text_display.nil?
   if @_text_display.nil?
    create_display_sprite(@character.text_display)
   end
  Â
  switch = ($quest.whichquest * 10) + 2
  if $quest.qupdate[switch]
   if $quest.qupdate[switch + 1]
    if $quest.qupdate[switch + 2]
     if $quest.qupdate[switch + 3]
      if $quest.qupdate[switch + 4]
       if $quest.qupdate[switch + 5]
        if $quest.qupdate[switch + 6]
         if $quest.qupdate[switch + 7]
          $quest.qupdate[switch + 8] = true
         end
        end
       end
      end
     end
    end
   end
  end
  Â
  Â
  Â
   @_text_display.x = self.x
   @_text_display.y = self.y - self.oy / 2 - 24
   if @character.isQuest   Â
    @_quest_display.x = self.x
    @_quest_display.y = self.y - self.oy / 2 - 24 + @character.bounce
   end
  else
   unless @_text_display.nil?
    dispose_display_text
   end
   unless @_quest_display.nil?
    dispose_quest_text
   end
  end
  #reset font colors
  Font.default_size = 14
  Font.default_name = "Verdana"
 end
end
Â
Â
Â
   #C[RRBBGG] Changes the Color (RR,BB,GG)
   #C[N] Changes to color back to normal
   #I[] Changes the font to Italics
   #B[] Changes the font to Bold
   #T[] A Tab
   #N[] New Line
#==============================================================================
# ** Bitmap
#------------------------------------------------------------------------------
# Â Additions add a draw wrap text method which draws word wrapped text
# Â Text Automattically goes to the next line if the text can not fit on the line
#==============================================================================
class Bitmap
 def draw_wrap_text(x,y,width, height, text)
  array = text.split
  for i in array
   word = i + ' '
   word_width = text_size(word).width
   if x + word_width > width
    y += height
    x = 0
   end
   self.draw_text(x, y, 350, height, word)
   x += word_width
  end
 end
end
Â
Code:
Â
#=======================================
# ** Scene_Quests
# ** Created by coolmariners98
#------------------------------------------------------------------------------
# Â Please do not copy and distribute claiming to have created this.
# Â I would like full credit, even though this script is kind of crappy.
#=======================================
Â
class Quest_Data
 attr_accessor :totalquests, :totalfound, :moneyearned, :expearned, :rpearned, :totalcompleted,
       :showdisabledquests, :shownondisabledquests, :preinfo, :charsprite, :questname,
       :charname, :location, :textreward, :goldreward, :expreward, :rpreward, :objs,
       :whichquest, :qupdate, :charspriteN, :charspriteI, :whichicon, :handin
 def initialize
  # ========DO NOT CHANGE======
  @preinfo = []
  @charspriteN = []
  @charspriteI = []
  @questname = []
  @charname = []
  @location = []
  @textreward = []
  @goldreward = []
  @expreward = []
  @rpreward = []
  @handin = []
  @objs = []
  @totalfound = 0
  @moneyearned = 0
  @expearned = 0
  @rpearned = 0
  @totalcompleted = 0
  @whichquest = 0
  @icon = []
  @whichicon = 0
  @qupdate = []
  for i in 0...5000
   @qupdate = false
  end
  for k in 0...500
   @handin[k] = false
  end
  # =========================
 Â
  # kinda big things
  @showdisabledquests = true # displays all the quests, but they are disabled
  @totalquests = 2 # initialize the total number of quests you created
Â
  # Quest 0 information
  @preinfo.push("Don't get distracted by the cool names and exclamation marks over npc's heads. You are here to see the quest log so now you must!") # info that will show
  @questname.push("Understanding") # the name of quest
  @charspriteN.push("Monster.png") # the name of the character file
  @charspriteI[0] = 0 # the index of the character 0,1,2,3
  @charname.push("Ghoul") # the name of the character who gave the quest
  @location.push("World Map") # the location of quest
  @textreward.push("1 Gold and 10 Experience") # the text representation of the reward
  @goldreward[0] = 1 # the actual amount of gold reward
  @expreward[0] = 10 # the actual amount of exp reward
  @rpreward[0] = 1 # the actual amount of rp reward
  @objs.push("  - Go talk to Flamey") # quest objective 1
  @objs.push("  - Go talk to Skele") # quest objective 2
  @objs.push(" ") # quest objective 3
  @objs.push(" ") # quest objective 4
  @objs.push(" ") # quest objective 5
  @objs.push(" ") # quest objective 6
  @objs.push(" ") # quest objective 7
  @objs.push(" ") # quest objective 8 Â
Â
  # Quest 1 information
  @preinfo.push("The priestess who was tending to the animals has accidently let them loose all over the area. Help her catch her cat, her dog, and her sheep, so that she doesn't get in trouble.") # info that will show
  @questname.push("The Chase") # the name of quest
  @charspriteN.push("People2.png") # the name of the character file
  @charspriteI[1] = 1 # the index of the character 0,1,2,3
  @charname.push("Vania") # the name of the character who gave the quest
  @location.push("World Map") # the location of quest
  @textreward.push("1000 Gold and 200 Experience") # the text representation of the reward
  @goldreward[1] = 1000 # the actual amount of gold reward
  @expreward[1] = 200 # the actual amount of exp reward
  @rpreward[1] = 100 # the actual amount of rp reward
  @objs.push("  - You must go and find the sheep") # quest objective 1
  @objs.push("  - You must go and find the cat") # quest objective 2
  @objs.push("  - You must go and find the dog") # quest objective 3
  @objs.push(" ") # quest objective 4
  @objs.push(" ") # quest objective 5
  @objs.push(" ") # quest objective 6
  @objs.push(" ") # quest objective 7
  @objs.push(" ") # quest objective 8
 Â
 end
end
Â
Code:
Â
$scene = Scene_Quests.new
Â
Code:
Â
$quest = Quest_Data.new
Â
Instructions
This script is actually a little difficult to use, so make sure you read these instructions carefully.
To use this script as is all you need to edit is the Quest Data
- qupdate is the bulk of this code, it updates your quest information
- qupdate[1, 11, 21, 31, 41, etc] = setting to true will make quests 1, 2, 3, 4, 5, available aka they show up in the menu
- qupdate[10, 20, 30, 40, etc] = you use these to check to see if quests 1, 2, 3, 4 are finished they are updated automatically so it's often just used by the quest giver event (demo shows best)
- qupdate[2-9, 12-19, 22-29, etc] = setting to true will update the objectives in each quest so qupdate[12] = true will make the first objective in quest 2 be completed
- handin is important as well and is to be used when a quest is handed in to the quest giver
- handin[0, 1, 2, 3, etc] = setting to true will completely end quests 1, 2, 3, 4, and update the quest journal
- The rest of the data that needs to be filled in is pretty self explanatory any questions can be posted below
Credits and Thanks
Event Text Display by ???
Author's Notes
None at the moment
Terms and Conditions
You can use this script as long as I am credited.