Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Quests Page

Hey everyone!  I'm back with another script request.  Actually, this requests comes in two parts which should result in the desired results once fully completed.  Okay, here we go:


1) I need to create a "Quests" page in the menu that will say the name of the quest on the far right.  On the left, should be the
word(s) "------" , "Active" , and "Complete".  Which word is displayed should, of course, be based on whether one has started (Active), not started (------), or completed (Complete) the quest.  In-game, I would like each word to be activated by variables
(0= ------  1= Active    2= Complete).  For the purpose of showing me how to do this, make the quest "Shopkeeper's Quest" and the variable [0001].


2) For this to work, I need an option on the main menu page under "Status" that will open the "Quests" page. 

That's it for this request.  I would also appreciate instructions on how to put this into the script because it seems rather complicated (I've tried to do this myself, but it will not work for me).  Anyhow, thanks in advance for the help! :thumb:
 
Try this out. It's just a modification of Lambchop's Super Simple Journal script...

Add these 3 scripts right above 'Main'
(right-click on main, select 'Insert')

Code:
#==============================================================================
# ** Scene_Menu_Journal
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#  Added Journal Option
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Quests"
    s6 = "Save"
    s7 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(4)
    end
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 252
    # Make steps window
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 334
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 1  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # journal
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to journal scene
        $scene = Scene_Journal.new
      when 5  # save
        # If saving is forbidden
        if $game_system.save_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Save.new
      when 6  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
end
Code:
#==============================================================================
# ** Window_Journal
#------------------------------------------------------------------------------
#  This window displays a journal. - Lambchop
#  Modified on request. Show all quests, with (---, Active, Complete) - Brew
#==============================================================================

class Window_Journal < Window_Selectable
# ------------------------
def initialize
   super(0, 32, 460, 320) 
   @column_max = 1
   ############
   #   @offset = the first variable used to store quest status
   ############
   @offset = 0
   refresh
   self.index = 0 
### to change the windowskin for the journal
#   self.windowskin = RPG::Cache.windowskin("RMXP4life_Wood.png")
###
 end


#--------------------------------------------------------------------------
# * Draw the contents of the item window
#--------------------------------------------------------------------------
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end 
   
   ############
   # populate your journal with entries. Each entry must match its variable number!
   ############
   @data = [] 
   @data[1] = "Shopkeeper's Quest"
   @data[2] = "Kill Chicken"
   @data[3] = "Make cow eat"
   @data[4] = "Sniff the Glove"
   @data[5] = "Jump off a bridge after your friends"
   @data[6] = "Help Man"
   @data[7] = "Kill Chicken"
   @data[8] = "Make cow eat"
   @data[9] = "Sniff the Glove"
   @data[10] = "Jump off a bridge after your friends"
   
   # variables
   @journal_height = (@data.size - 1)*32   # y coord of entire journal (# of entries - 1) * 32
   @n = 0                     # y coord for each entry
   @item_max = 0              # max items to display
   
   # draw the bitmap. the text will appear on this bitmap
   self.contents = Bitmap.new(width - 32, height+@journal_height)
      
   for i in 1..(@data.size - 1)
       draw_item(i)
       @item_max += 1
   end         
  
 end
   
#--------------------------------------------------------------------------
# * Draw an individual item in the window
#     index : Index of the item to be drawn
#--------------------------------------------------------------------------

 def draw_item(index)
      item = @data[index]
      rect = Rect.new(10, @n, 640, 32)
      self.contents.fill_rect(rect, Color.new(0,0,0,0))        
      if $game_variables[index + @offset] == 0
        self.contents.draw_text(10, @n, 240, 32, "------", 0)
      end
      if $game_variables[index + @offset] == 1
        self.contents.draw_text(10, @n, 100, 32, "Active", 0)
      end
      if $game_variables[index + @offset] == 2
        self.contents.draw_text(10, @n, 240, 32, "Complete", 0)
      end
      self.contents.draw_text(100, @n, 360, 32, item, 0)
      @n += 32
      
 end

end
Code:
#==============================================================================
# â–  Scene_Journal
#------------------------------------------------------------------------------
#  This class contains the window for the journal that can be 
#   accessed from the main menu.
#==============================================================================

class Scene_Journal
  #--------------------------------------------------------------------------
  # â—
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top