Main Menu
  • Welcome to The RPG Maker Resource Kit.

[XP] Quest Log System

Started by game_guy, June 01, 2009, 12:29:27 AM

0 Members and 1 Guest are viewing this topic.

game_guy

Quest Log System
Authors: game_guy
Version: 3.0
Type: Mission Logger
Key Term: Misc System


Introduction

A script that keeps track of quests you obtain and complete.


Features


  • Marks quest names with a yellow color if they're completed
  • Easy to setup one quest
  • Be able to use a fairly long description
  • Be able to display a picture
  • Easy to add and complete a quest
  • More compatible than earlier versions


Screenshots
[spoiler][/spoiler]


Demo

Mediafire


Script

[SPOILER]
#===============================================================================
# Quest Log System
# Author game_guy
# Version 3.0
#-------------------------------------------------------------------------------
# Intro:
# A script that keeps track of quests you obtain and complete.
#
# Features:
# Marks quest names with a yellow color if they're completed
# Easy to setup one quest
# Be able to use a fairly long description
# Be able to display a picture
# Easy to add and complete a quest
# More compatible than earlier versions
#
# Instructions:
# Scroll down a bit until you see # Being Config. Follow the instructions there.
# Scroll below that and you'll see Begin Quest Setup. Follow the steps there.
#
# Script Calls:
# Quest.add(id) ~ Adds the quest(id) to the parties quests.
# Quest.take(id) ~ Takes the quest(id) from the party.
# Quest.complete(id) ~ Makes the quest(id) completed.
# Quest.completed?(id) ~ Returns true if the quest(id) is completed.
# Quest.has?(id) ~ Returns true if the party has quest(id).
# $scene = Scene_Quest.new ~ Opens the quest menu.
#
# Credits:
# game_guy ~ for making it
# Beta Testers ~ Sally and Landith
# Blizzard ~ Small piece of code I borrowed from his bestiary
#===============================================================================
module GameGuy
 #==================================================
 # Begin Config
 # UsePicture ~ true means it'll show pictures in
 #              the quests, false it wont.
 #==================================================
 UsePicture   = false
 
 def self.qreward(id)
   case id
   #==================================================
   # Quest Reward
   # Use when x then return "Reward"
   # x = id, Reward = reward in quotes
   #==================================================
   when 1 then return "100 Gold"
   when 2 then return "3 Potions"
   when 3 then return "Strength Ring"
   end
   return "????"
 end
 
 def self.qpicture(id)
   case id
   #==================================================
   # Quest Picture
   # Use when x then return "picture"
   # x = id, picture = picutre name in quotes
   #==================================================
   when 1 then return "ghost"
   end
   return nil
 end
 
 def self.qname(id)
   case id
   #==================================================
   # Quest Name
   # Use when x then return "name"
   # x = id, name = quest name in quotes
   #==================================================
   when 1 then return "Village Hunt"
   when 2 then return "Pay Tab"
   when 3 then return "Hunting Knife"
   end
   return ""
 end
 
 def self.qlocation(id)
   case id
   #==================================================
   # Quest Location
   # Use when x then return "location"
   # x = id, location = location in quotes
   #==================================================
   when 1 then return "Arton Woods"
   when 2 then return "Eeka"
   when 3 then return "Eeka"
   end
   return "????"
 end
 
 def self.qdescription(id)
   case id
   #==================================================
   # Quest Description
   # Use when x then return "description"
   # x = id, description = quest description in quotes
   #==================================================
   when 1 then return "Extremely LOOOOOOOOOOONNNNNNGGGGGGGG quest description as you can see this goes on for awhile. :P:P:P:P:P"
   when 2 then return "Bring gold to Jarns Defense to pay her tab."
   when 3 then return "Go get Kip a hunting knife from Eeka."
   end
   return ""
 end
 
end

module Quest
 
 def self.add(id)
   $game_party.add_quest(id)
 end
 
 def self.take(id)
   $game_party.take_quest(id)
 end
 
 def self.complete(id)
   $game_party.complete(id)
 end
 
 def self.completed?(id)
   return $game_party.completed?(id)
 end
 
 def self.has?(id)
   return $game_party.has_quest?(id)
 end
 
end
 
class Game_Party
 
 attr_accessor :quests
 attr_accessor :completed
 
 alias gg_quests_lat initialize
 def initialize
   @quests = []
   @completed = []
   gg_quests_lat
 end
 
 def add_quest(id)
   unless @quests.include?(id)
     @quests.push(id)
   end
 end
 
 def completed?(id)
   return @completed.include?(id)
 end
 
 def complete(id)
   unless @completed.include?(id)
     if @quests.include?(id)
       @completed.push(id)
     end
   end
 end
 
 def has_quest?(id)
   return @quests.include?(id)
 end
 
 def take_quest(id)
   @quests.delete(id)
   @completed.delete(id)
 end
 
end
class Scene_Quest
 def main
   @quests = []
   for i in $game_party.quests
     @quests.push(GameGuy.qname(i))
   end
   @map = Spriteset_Map.new
   @quests2 = []
   for i in $game_party.quests
     @quests2.push(i)
   end
   @quests_window = Window_Command.new(160, @quests)
   @quests_window.height = 480
   @quests_window.back_opacity = 110
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   @quests_window.dispose
   @quest_info.dispose if @quest_info != nil
   @map.dispose
 end
 def update
   @quests_window.update
   if @quests_window.active
     update_quests
     return
   end
   if @quest_info != nil
     update_info
     return
   end
 end
 def update_quests
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Menu.new
     return
   end
   if Input.trigger?(Input::C)
     $game_system.se_play($data_system.decision_se)
     @quest_info = Window_QuestInfo.new(@quests2[@quests_window.index])
     @quest_info.back_opacity = 110
     @quests_window.active = false
     return
   end
 end
 def update_info
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     @quests_window.active = true
     @quest_info.dispose
     @quest_info = nil
     return
   end
 end
end
class Window_QuestInfo < Window_Base
 def initialize(quest)
   super(160, 0, 480, 480)
   self.contents = Bitmap.new(width - 32, height - 32)
   @quest = quest
   refresh
 end
 def refresh
   self.contents.clear
   if GameGuy::UsePicture
     pic = GameGuy.qpicture(@quest)
     bitmap = RPG::Cache.picture(GameGuy.qpicture(@quest)) if pic != nil
     rect = Rect.new(0, 0, bitmap.width, bitmap.height) if pic != nil
     self.contents.blt(480-bitmap.width-32, 0, bitmap, rect) if pic != nil
   end
   self.contents.font.color = system_color
   self.contents.draw_text(0, 0, 480, 32, "Quest:")
   self.contents.font.color = normal_color
   self.contents.draw_text(0, 32, 480, 32, GameGuy.qname(@quest))
   self.contents.font.color = system_color
   self.contents.draw_text(0, 64, 480, 32, "Reward:")
   self.contents.font.color = normal_color
   self.contents.draw_text(0, 96, 480, 32, GameGuy.qreward(@quest))
   self.contents.font.color = system_color
   self.contents.draw_text(0, 128, 480, 32, "Location:")
   self.contents.font.color = normal_color
   self.contents.draw_text(0, 160, 480, 32, GameGuy.qlocation(@quest))
   self.contents.font.color = system_color
   self.contents.draw_text(0, 192, 480, 32, "Completion:")
   self.contents.font.color = normal_color
   if $game_party.completed.include?(@quest)
     self.contents.font.color = crisis_color
     self.contents.draw_text(0, 224, 480, 32, "Completed")
   else
     self.contents.font.color = normal_color
     self.contents.draw_text(0, 224, 480, 32, "In Progress")
   end
   self.contents.font.color = system_color
   self.contents.draw_text(0, 256, 480, 32, "Description:")
   self.contents.font.color = normal_color
   text = self.contents.slice_text(GameGuy.qdescription(@quest), 460)
   text.each_index {|i|
       self.contents.draw_text(0, 288 + i*32, 460, 32, text[i])}
 end
end
class Bitmap
 
 def slice_text(text, width)
   words = text.split(' ')
   return words if words.size == 1
   result, current_text = [], words.shift
   words.each_index {|i|
       if self.text_size("#{current_text} #{words[i]}").width > width
         result.push(current_text)
         current_text = words[i]
       else
         current_text = "#{current_text} #{words[i]}"
       end
       result.push(current_text) if i >= words.size - 1}
   return result
 end
 
end
[/SPOILER]


Instructions

In the script.


Compatibility

Not tested with SDK.
Works with all of my scripts and blizzard's scripts. (Tested with most add-ons and all of his scripts)


Credits and Thanks


  • game_guy ~ Making it
  • Beta Testers ~ Sally and Landith


Author's Notes

Enjoy and give credits

modern algebra

I like that you use items here to track the quests. I'm not sure I like the design of the script. It seems kind of plain. Anyway, nice work on this game guy.

game_guy

thanks, if you can whip up some sort of image on how I can make it look I'll change it. I had to make the thing so large because the window was displaying the quest info and the info was the item description.

modern algebra

Well, my #1 suggestion without adding features to the script would be to set the info in a window in the quest screen, rather than giving it such a big window. ALl of that information can fit in the half-screen gap in the Quest selection screen, aside from the description, and with that I would suggest you just break it into lines. Rather, than draw it in one long line, calculate and make it into another line if it goes over. That's what I did for the quest system I made for VX.

Anyway, it's just a preference thing for me. You certainly don't need to take a suggestion from me. It's fine as is.

game_guy

Could you help me with making the text be in a paragraph please? I cant figure out how to make it go to a new line if its too long

modern algebra

I actually wrote a scripting too to help with that a long time ago: http://rmrk.net/index.php/topic,22215.0.html

game_guy

Mind if I include the script in my next version? That way it'll be easier to see the text and be able to have more of a description. Thanks in advance!

modern algebra

Nah, of course you can include it. That's what it's there for :)

Buland

#8
Amazing new script! Finally a Quest Log for XP!   :D

I can't wait for the next version to come by!

P.S. How many quests can this deal with?

game_guy

Ah shit I forgot to update the script here sorry guys :(

Ok I updated the post and this can have as many quests as you have items. I think the max items are 999 so you can have a total of 999 quests but of course you'll have regular items taking away at least 100-200 so that leaves you with 799-899 quests.


Buland

That's more than enough for me! :D

SeMcDun

Hey Game_Guy, nice work!

I have a little problem with it though :( seeing as I have little knowledge of the scripting language in use I don't know how to fix what seems to be wrong.

I pasted the code into my game and left it exactly the way it was to see how it worked at first and used an event to call item_id 34 like it already was. I made the item and away I went. The problem however was when I tried to click on a quest to get more info about the quest it comes up with this:


Script "Quest Log" line 292: NoMethodError occurred.

undefined method "new for #<Game_Item:0x33f2128
@completed = false>

:( any help would be greatly appreciated.

Thanks.

game_guy


happyhibisci

Hey, this is a really nice script.  Clever too :)

Could you include a little more instruction though?  I would like to know if it's possible to change the reward after you complete a quest.  For example, when you receive a quest, I would like the "reward" to display "? ? ? ?" but after you complete the quest and receive a reward, I want it to say "3000 Gold" or something.  So is it possible to change it mid-game?

Also, I don't really understand how to use "$quest.quest(item id) > 0" as a condition branch.  I want someone to say 3 different things depending on the status of a Quest: Before you accept the quest, during the quest, and once the quest is completed.  How do I do that?

Thanks for any help, I appreciate it.  This script is awesome.

eps5000

This seems like an awsome script, however i wish that you could have written it to pull info from a .txt or .ini file, much more room to write description and specifics that way... Thx for the script, ill b sure to cite you!
The things we do for pizza!

tidloc

Quote from: eps5000 on September 15, 2009, 07:55:55 PM
This seems like an awsome script, however i wish that you could have written it to pull info from a .txt or .ini file, much more room to write description and specifics that way... Thx for the script, ill b sure to cite you!

That shouldn't be a problem.
If you're intrested in that kind of script, i could make it.
Just tell me what features shall be realised and it will be done over the next weekend :D
PM or better e-mail me ^^
[...]And they feared him.
He understands that cruelty arises from opportunity![...]

Smooth

#16
Nice script.. im using it for my game.

EDIT: it would be nice if you could use diferent icons depending in the quest just like in your archievment script(Gold,Silver or Bronze Type missions) according to the importance.. and uuhmm how do i change the the color of the text for "incomplete" and "complete"?? Yellow doesnt fit for a complete mission xD

EDIT2: Nevermind, made a little research and found out :)

Frzanny

Hi, I'm new to RPG maker and everything, but i tried out your script and it was great. I was looking to make a game with my friend, i was just wondering if we could use your quest system in the game if we decided to sell the game. If we did, we would say it was made by you, not us.

Thanks, Frzanny

Eternal

@Frzanny: You should probably PM him personally. If he doesn't answer, try PM'ing on another of the websites he's active on.

@Game_guy: Love it, and I'm probably going to use it, but let me come with a suggestion: Do so that when you select a quest it appears in the empty area instead of covering the whole screen. Example:

_______________
|______________|
|          |           |
|          |           |
| Quest | Quest  |
|  List!  |  Info!   |
|          |           |
|______|_______|

-Peace out

game_guy

@Eternal: I may do that
@Franny: You can use it but if you sell it I get a free copy.

Mr_Wiggles

i wounder if you could make it to where theres multiple parts to a mission, ie
kill 3 dragons, report to mr wiggles, give item to little girl. - idk lol

or

optional parts ie
collect 3 apples, give them to granny "or" sell them

or

like more detailed status of a mission ie
mission - find the lost sword and report to Lt mark
status:
found sword - completed
reported - incomplete
reward - not recived
or
mission - kill three knights and recive the holly grale then report to sister karen
status:
killed knights - completed
found grale - completed
talk to sister karen - incomplete
reward - not recived


just a few ideas
[spoiler]
METALFRESH is a paint contractor that specializes in refinishing metal and vinyl siding. We paint metal buildings as well as siding on homes.

We also

    Refinish decks
    Do custom interior painting
    Strip wallpaper
    Refinish cedar siding
    Metal front doors and sidelights
    Metal garage and service doors
    Grained fiberglass doors

    If your structure is *RUSTED *FADED *CHALKING *IN NEED OF COLOR CHANGE, we can fix it with a guarentee!

northern Illinois and southern Wisconsin.

http://metalfreshcoatings.com

[/spoiler]

game_guy

I plan on adding the multiple parts, and Im making it more compatible

uncleiroh13

Um im confused with this part here where do i find these?

CONFIG REWARD
CONFIG LOCATION

game_guy

scroll down until you see a commented line that says CONFIG REWARD or CONFIG LOCATION

xetjsin

Hi, sorry to bother, I really like this script and want to use it in my game, but was wondering something

I'm wanting to get rid of the Save option in the menu alltogether, and was wanting to replace it with "Quest" or "Log", could someone tell me how I'd do this?