Main Menu
  • Welcome to The RPG Maker Resource Kit.

Quest Log

Started by Rune, June 16, 2007, 08:40:43 PM

0 Members and 1 Guest are viewing this topic.

Rune

My latest script :D
Instructions are inside the script, if anyone needs any help with it, you know where I am ;)

[spoiler=It resides here]#================================
#                        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
[/spoiler]

[spoiler=Screenies]
Before Quest Start

Quest Incomplete

Quest Complete

[/spoiler]

That's it, and enjoy kiddies ;)
Sincerely,
Your conscience.


Rune

#2
Ah! I forgot that >.< Be right back

[EDIT]
There you go :D
Sincerely,
Your conscience.

Polraudio

Hey nice even the most simplest scripts are cool.
using variables? after i seen how you used them maybe i might learn off of that to make my Juke better. Im just learning lots this week

Rune

Lol, I tried editing your Juke so that you couldn't play certain tunes until certain points in the game, by changing variables :D
Didn't work though... :(
Sincerely,
Your conscience.

Polraudio

i will find a way to make that happen if it means death. LOL JK
but i will find a way tho

Kokowam

Nice script, Rune! It may be less flashy than that other guy's, but this is easier to handle.

Rune

Thanks :D
Holy Sh-... I just saw the time, g-night my good friends, see you in about 7-8 hours :D
Sincerely,
Your conscience.

zzzdude

New to the forums, hi.

Now, I have been looking for a quest log script since I can't script at all.

I found this:
http://shadowdestiny.byethost14.com/forums/index.php?s=&showtopic=85

But if you read my LATER post, it says I had an error with the script.

So, two questions:
1. Is this your script.
2. What can I do to fix it? (if its not yours, I will get yours    :D)
Huge sig is huuuuge.

modern algebra

It's nice. Does it have descriptions as well? I.e. Can there be multiple parts of one quest? like: Find the key and return it, then go to the warehouse with him and kill the raiders

There are a couple quest logs out there so I'd suggest you add some things to make yours special. Either way it is a good, simple script.

Rune

Quote from: zzzdude on July 09, 2007, 01:02:41 PM
New to the forums, hi.

Now, I have been looking for a quest log script since I can't script at all.

I found this:
http://shadowdestiny.byethost14.com/forums/index.php?s=&showtopic=85

But if you read my LATER post, it says I had an error with the script.

So, two questions:
1. Is this your script.
2. What can I do to fix it? (if its not yours, I will get yours    :D)


The one on the link or the one in this thread?
Thread - Yes
Link - No, this is the only quest log script I have made

If I can get the link to work, i'll certainly try to fix your problem ;) (if the owner doesn't)

Quote from: modern algebra on July 09, 2007, 02:37:17 PM
It's nice. Does it have descriptions as well? I.e. Can there be multiple parts of one quest? like: Find the key and return it, then go to the warehouse with him and kill the raiders

There are a couple quest logs out there so I'd suggest you add some things to make yours special. Either way it is a good, simple script.

You could do that by fiddling with a few variables here and there :) (If anyone needs help with this, just either post or PM me ;) ), or if youre thinking about calling a window that gives you instructions and whether you've done them or not... i'm pretty sure you could do that with a bit of work.

And i'll see what I could do to make this better than the other quest log scripts :P (Ideas anyone?)
Sincerely,
Your conscience.

zzzdude

Oh, I see.

I will just remove the one I got froom the link, and put yours in    :D
Huge sig is huuuuge.

zzzdude

Using your script, I had this error:
script 'main' line 14: NoMethodError occured.
undefined method `main' for scene_questpage1: class

What did I do wrong?
Huge sig is huuuuge.

Rune

Post your main script
Sincerely,
Your conscience.

modern algebra

Are you using PK Rune? I just looked through ans saw $defaultfontsize. That is going to cause errors for anyone not using PKE.

Rune

Yeah, I am :-\ should I change it to say something else?
Sincerely,
Your conscience.

modern algebra

well, put in a failsafe. something like:

if $defaultfontsize != nil
  self.contents.font.size = $defaultfontsize
  self.contents.font.name = $defaultfontname
end


With regular version, those variables aren't defined, so they will get an error there. Normally, I don't bother setting a font size and name. I think it defaults to 22, Arial. The benefit to doing it that way is that you only have to change the values of those two variables in order to change the font name and size everywhere, and you won't have to run through all your scripts.

Rune

Right, will try that later, i'm not on RMXP atm :P
Sincerely,
Your conscience.

subzero

you think you could put in a demo?



Rune

Um... yeah, once i'm less busy :D
Sincerely,
Your conscience.

subzero

Ok cool.
and Thanks



zzzdude

terribly sorry, went to california, had my lappy break        D:
I will post the main script in a minute
Huge sig is huuuuge.