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.

Help on a script

Status
Not open for further replies.
I have this script made by rune that i edited to look better then it was but i don't know were and how do i need to put the quests that i want. Here's the script to see maybe someone have used it:

Code:
#================================
#                        Quest Log Screen
#                               By Rune
#================================
# Introduction - This script calls a screen that keeps
# track of all your quests using variables.
#================================
# Instructions - Thoughout script
#================================
# To call - $scene = Scene_QuestPage1
#================================
# To start a quest, set it's variable to 1, to end it,
# set it to 2. Any Quest variables at 0 haven't been
# started or discovered
#================================

#++++++++++++++++++++++++++++++++
# Windows
#++++++++++++++++++++++++++++++++

class Window_QuestPage1 < Window_Base
  def initialize
    super(0, 64, 530, 350)#0 64 560 350
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fonttype
    self.contents.font.size = $fontsize
    refresh
  end
#================================
# Here's where you edit what each Quest is and which
# variables turn each one on. Add Quests as you please.
#================================
  def refresh
    self.contents.clear
#================================
# Set variable and "Quest Start" number
#================================
    if $game_variables[51] >= 1
#================================
# Set Quest objective, whenever a new quest is added,
# add 32 to the second number
#================================
      self.contents.draw_text(0, 0, 528, 32, "Quest 1")
    end
#================================
# And repeat until all quests are set
#================================
    if $game_variables[52] >= 1
      self.contents.draw_text(0, 32, 528, 32, "Quest 2")
    end
  end
end
#-----------------------------------------------------------------
class Window_QuestPage2 < Window_Base
  def initialize
    super(0, 64, 560, 350)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fonttype
    self.contents.font.size = $fontsize
    refresh
  end
#================================
# Same here, set variables for Page 2 of the Quest Log
# Do NOT repeat Quests
#================================
  def refresh
    self.contents.clear
    if $game_variables[76] >= 1
      self.contents.draw_text(0, 0, 528, 32, "Quest 3")
    end
    if $game_variables[77] >= 1
      self.contents.draw_text(0, 32, 528, 32, "Quest 4")
    end
  end
end
#-----------------------------------------------------------------
class Window_Quest < Window_Base
  def initialize
    super(0, 0, 530, 64)#560 64
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fonttype
    self.contents.font.size = $fontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Decide what is placed at the top of the screen
#================================
    self.contents.draw_text(0, 0, 496, 32, "Quest Log", 1)
  end
end
#-----------------------------------------------------------------
class Window_Next < Window_Base
  def initialize
    super(0, 416, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fonttype
    self.contents.font.size = $fontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Edit the color of the "Next Page" at the bottom of the
# screen  (r, g, b)
#================================
    self.contents.draw_text(480, 0, 128, 32, "Next Page -->")
  end
end
#-----------------------------------------------------------------
class Window_Complete< Window_Base
  def initialize
    super(530, 0, 110, 64)#560 0 80 64
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fonttype
    self.contents.font.size = $fontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Edit the color of the "Complete?" text in the window
# (r, g, b)
#================================
    self.contents.draw_text(15, 0, 50, 32, "Completed ?", 1)#48 32
  end
end
#-----------------------------------------------------------------
class Window_Prev < Window_Base
  def initialize
    super(0, 416, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fonttype
    self.contents.font.size = $fontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Edit the color of the "Next Page" at the bottom of the
# screen  (r, g, b)
#================================
    self.contents.draw_text(0, 0, 128, 32, "<-- Prev Page")
  end
end
#-----------------------------------------------------------------
class Window_YN1 < Window_Base
  def initialize
    super(530, 64, 110, 350)#560 64 80 350
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fonttype
    self.contents.font.size = $fontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Set a variable to 2 to end it's quest
#================================
# If Quest is complete
#================================
    if $game_variables[51] == 2
      self.contents.draw_text(0, 0, 42, 32, "YES", 1)
#================================
# If Quest isn't started
#================================
    elsif $game_variables[51] == 0
      self.contents.draw_text(0, 0, 42, 32, "")
#================================
# If Quest is started but incomplete
#================================
    elsif $game_variables[51] == 1
      self.contents.draw_text(0, 0, 42, 32, "NO", 1)
    end
    
    if $game_variables[52] == 2
      self.contents.draw_text(0, 32, 42, 32, "YES", 1)
    elsif $game_variables[52] == 0
      self.contents.draw_text(0, 32, 42, 32, "")
    elsif $game_variables[52] == 1
      self.contents.draw_text(0, 32, 42, 32, "NO", 1)
    end
    
  end
end
#-----------------------------------------------------------------
class Window_YN2 < Window_Base
  def initialize
    super(560, 64, 80, 350)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fonttype
    self.contents.font.size = $fontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Set a variable to 2 to end it's quest
#================================
# If Quest is complete
#================================
    if $game_variables[76] == 2
      self.contents.draw_text(0, 0, 42, 32, "YES", 1)
#================================
# If Quest isn't started
#================================
    elsif $game_variables[76] == 0
      self.contents.draw_text(0, 0, 42, 32, "")
#================================
# If Quest is started but incomplete
#================================
    elsif $game_variables[76] == 1
      self.contents.draw_text(0, 0, 42, 32, "NO", 1)
    end
    
    if $game_variables[77] == 2
      self.contents.draw_text(0, 32, 42, 32, "YES", 1)
    elsif $game_variables[77] == 0
      self.contents.draw_text(0, 32, 42, 32, "")
    elsif $game_variables[77] == 1
      self.contents.draw_text(0, 32, 42, 32, "NO", 1)
    end
    
  end
end
#-----------------------------------------------------------------

#++++++++++++++++++++++++++++++++
# Pages
#++++++++++++++++++++++++++++++++

class Scene_QuestPage1
  def main
    @top_window = Window_Quest.new
    @quest_window = Window_QuestPage1.new
    @next_window = Window_Next.new
    @comp_window = Window_Complete.new
    @check_window = Window_YN1.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @top_window.dispose
    @quest_window.dispose
    @next_window.dispose
    @comp_window.dispose
    @check_window.dispose
  end
  def update
    @top_window.update
    @quest_window.update
    @next_window.update
    @comp_window.update
    @check_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
    end
    if Input.trigger?(Input::R)
      $game_system.se_play($data_system.decision_se)
      $scene = Scene_QuestPage2.new
    end
  end
end
#-----------------------------------------------------------------
#-----------------------------------------------------------------
#-----------------------------------------------------------------
class Scene_QuestPage2
  def main
    @top_window = Window_Quest.new
    @quest_window = Window_QuestPage2.new
    @next_window = Window_Prev.new
    @comp_window = Window_Complete.new
    @check_window = Window_YN2.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @top_window.dispose
    @quest_window.dispose
    @next_window.dispose
    @comp_window.dispose
    @check_window.dispose
  end
  def update
    @top_window.update
    @quest_window.update
    @next_window.update
    @comp_window.update
    @check_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
    end
    if Input.trigger?(Input::L)
      $game_system.se_play($data_system.decision_se)
      $scene = Scene_QuestPage1.new
    end
  end
end
 
This doesn't work at all for me, it keeps trying to convert from nil to an integer for the fontsize which leads me to believe that in your editing perhaps you deleted the initial font size variable?

If you post a working script then maybe i can help you!
 
But the script works for me the only problem is that i don't know how to put quests in it.
But if you want the script how it was here:
Code:
#================================
#                        Quest Log Screen
#                               By Rune
#================================
# Introduction - This script calls a screen that keeps
# track of all your quests using variables.
#================================
# Instructions - Thoughout script
#================================
# To call - $scene = Scene_QuestPage1
#================================
# To start a quest, set it's variable to 1, to end it,
# set it to 2. Any Quest variables at 0 haven't been
# started or discovered
#================================

#++++++++++++++++++++++++++++++++
# Windows
#++++++++++++++++++++++++++++++++

class Window_QuestPage1 < Window_Base
  def initialize
    super(0, 64, 560, 350)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    refresh
  end
#================================
# Here's where you edit what each Quest is and which
# variables turn each one on. Add Quests as you please.
#================================
  def refresh
    self.contents.clear
#================================
# Set variable and "Quest Start" number
#================================
    if $game_variables[51] >= 1
#================================
# Set Quest objective, whenever a new quest is added,
# add 32 to the second number
#================================
      self.contents.draw_text(0, 0, 528, 32, "Quest 1")
    end
#================================
# And repeat until all quests are set
#================================
    if $game_variables[52] >= 1
      self.contents.draw_text(0, 32, 528, 32, "Quest 2")
    end
  end
end
#-----------------------------------------------------------------
class Window_QuestPage2 < Window_Base
  def initialize
    super(0, 64, 560, 350)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    refresh
  end
#================================
# Same here, set variables for Page 2 of the Quest Log
# Do NOT repeat Quests
#================================
  def refresh
    self.contents.clear
    if $game_variables[76] >= 1
      self.contents.draw_text(0, 0, 528, 32, "Quest 3")
    end
    if $game_variables[77] >= 1
      self.contents.draw_text(0, 32, 528, 32, "Quest 4")
    end
  end
end
#-----------------------------------------------------------------
class Window_Quest < Window_Base
  def initialize
    super(0, 0, 560, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Edit the color of the "Quest Log" at the top of the
# screen  (r, g, b)
#================================
    self.contents.font.color = Color.new(0, 255, 160)
#================================
# Decide what is placed at the top of the screen
#================================
    self.contents.draw_text(0, 0, 496, 32, "Quest Log", 1)
  end
end
#-----------------------------------------------------------------
class Window_Next < Window_Base
  def initialize
    super(0, 416, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Edit the color of the "Next Page" at the bottom of the
# screen  (r, g, b)
#================================
    self.contents.font.color = Color.new(0, 255, 160)
    self.contents.draw_text(480, 0, 128, 32, "Next Page -->")
  end
end
#-----------------------------------------------------------------
class Window_Complete< Window_Base
  def initialize
    super(560, 0, 80, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Edit the color of the "Complete?" text in the window
# (r, g, b)
#================================
    self.contents.font.color = Color.new(0, 255, 160)
    self.contents.draw_text(0, 0, 48, 32, "Complete?", 1)
  end
end
#-----------------------------------------------------------------
class Window_Prev < Window_Base
  def initialize
    super(0, 416, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Edit the color of the "Next Page" at the bottom of the
# screen  (r, g, b)
#================================
    self.contents.font.color = Color.new(0, 255, 160)
    self.contents.draw_text(0, 0, 128, 32, "<-- Prev Page")
  end
end
#-----------------------------------------------------------------
class Window_YN1 < Window_Base
  def initialize
    super(560, 64, 80, 350)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Set a variable to 2 to end it's quest
#================================
# If Quest is complete
#================================
    if $game_variables[51] == 2
      self.contents.draw_text(0, 0, 42, 32, "YES", 1)
#================================
# If Quest isn't started
#================================
    elsif $game_variables[51] == 0
      self.contents.draw_text(0, 0, 42, 32, "")
#================================
# If Quest is started but incomplete
#================================
    elsif $game_variables[51] == 1
      self.contents.draw_text(0, 0, 42, 32, "NO", 1)
    end
    
    if $game_variables[52] == 2
      self.contents.draw_text(0, 32, 42, 32, "YES", 1)
    elsif $game_variables[52] == 0
      self.contents.draw_text(0, 32, 42, 32, "")
    elsif $game_variables[52] == 1
      self.contents.draw_text(0, 32, 42, 32, "NO", 1)
    end
    
  end
end
#-----------------------------------------------------------------
class Window_YN2 < Window_Base
  def initialize
    super(560, 64, 80, 350)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
    refresh
  end
  def refresh
    self.contents.clear
#================================
# Set a variable to 2 to end it's quest
#================================
# If Quest is complete
#================================
    if $game_variables[76] == 2
      self.contents.draw_text(0, 0, 42, 32, "YES", 1)
#================================
# If Quest isn't started
#================================
    elsif $game_variables[76] == 0
      self.contents.draw_text(0, 0, 42, 32, "")
#================================
# If Quest is started but incomplete
#================================
    elsif $game_variables[76] == 1
      self.contents.draw_text(0, 0, 42, 32, "NO", 1)
    end
    
    if $game_variables[77] == 2
      self.contents.draw_text(0, 32, 42, 32, "YES", 1)
    elsif $game_variables[77] == 0
      self.contents.draw_text(0, 32, 42, 32, "")
    elsif $game_variables[77] == 1
      self.contents.draw_text(0, 32, 42, 32, "NO", 1)
    end
    
  end
end
#-----------------------------------------------------------------

#++++++++++++++++++++++++++++++++
# Pages
#++++++++++++++++++++++++++++++++

class Scene_QuestPage1
  def main
    @top_window = Window_Quest.new
    @quest_window = Window_QuestPage1.new
    @next_window = Window_Next.new
    @comp_window = Window_Complete.new
    @check_window = Window_YN1.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @top_window.dispose
    @quest_window.dispose
    @next_window.dispose
    @comp_window.dispose
    @check_window.dispose
  end
  def update
    @top_window.update
    @quest_window.update
    @next_window.update
    @comp_window.update
    @check_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
    end
    if Input.trigger?(Input::R)
      $game_system.se_play($data_system.decision_se)
      $scene = Scene_QuestPage2.new
    end
  end
end
#-----------------------------------------------------------------
#-----------------------------------------------------------------
#-----------------------------------------------------------------
class Scene_QuestPage2
  def main
    @top_window = Window_Quest.new
    @quest_window = Window_QuestPage2.new
    @next_window = Window_Prev.new
    @comp_window = Window_Complete.new
    @check_window = Window_YN2.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @top_window.dispose
    @quest_window.dispose
    @next_window.dispose
    @comp_window.dispose
    @check_window.dispose
  end
  def update
    @top_window.update
    @quest_window.update
    @next_window.update
    @comp_window.update
    @check_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
    end
    if Input.trigger?(Input::L)
      $game_system.se_play($data_system.decision_se)
      $scene = Scene_QuestPage1.new
    end
  end
end
 
Status
Not open for further replies.

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