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.

Quest system - Quests not visible until activated

Status
Not open for further replies.
Hello everyone!

What i'm requesting here is a Quest Manager, that is to say a kind of menu that can handle the game quests/mission, display them into a list where you can select the quests you want to check, and by selecting it you see the detail and the various objectives.
The Quests shouldn't be visible until they are activated.
So here's how it should work.
At the start of the game the quest menu is empty.
There are not quests in the list.
Then you can activate Quest 1. Quest 1 appears in the list, and in a window there's the description of who assigned you the quest, where, and what are the objectives, reported in different lines.
Every time you complete a objective, that one fades out... it is not wrote anymore in White font but in light blue... or anyways a color that makes you understand that you already completed it.
In the end, you should have a command to make the mission end (indipendently from the fact that all the objectives are already completed), and all the objectives become signed as completed, aswell the questions.

A great enhancement would be if, when activated/completed a step/finished the mission, you get a picture coming from bottom of the screen to the top.
For instance you could write on the picture "Quest refreshed" "Mission complete" "New objective"... that's up to you, to how much time you want to put in making the script.

I already have this kind of system but is bugged and nobody wants to fix it cause they say it's "bad coded", here is it http://www.rmxp.org/forums/showthread.php?t=6305&highlight=quest

Here's how should be the layout of the Scene:
http://img442.imageshack.us/img442/5227/scenequestis6.th.png[/IMG]

http://img248.imageshack.us/img248/8420/scenequest2be6.th.png[/IMG]

The text i wrote in the picture is just the bug that i get with my current system.

Anybody that would be interesting in creating this please write something ^^.
Trickster already made this system, BUT it's insipred to a FFT system and it works on a much much different way...

Thanks to anybody who could try to create this system or fix the already existant one.

I'll try to repay how i can... i'm good with animations, stories and event system.
 
Please somebody help... i really can't get what doesn't work on the script i already have.
At least tell something... anything... it's half a month already withouth even a "hey ur request is shit" or anything... Bump °_°
 
The only reason no one is responding is, this request is already requested again and again, and no one responded them either. Except me, which is making one ;)

Unfortunately, the one I'll write currently is in ActionScript (Flash), not in Ruby (RMXP), and I have bigger project than my game. So, if you couldn't be patient waiting until June 2007, when my final project will be finished (hope so), and another weeks afterwards (to convert it back to Ruby), you should really ask for somebody to make one (or fix the buggy script).

Although your request is quite similar to the last request I responded...

Maybe we should make a more general Quest system, that can be used at most games...
 
That's what i'm asking, just a general Quest system, but where the quests aren't all visible from the beginning, there are already quest systems where you can see from the beginning everything, but where's the use of that?
Anyways yes i can wait to June if you really can make it in time and convert into ruby ^^
I'll release my demos withouth quest system...
I'll try what i can with pictures and reduce the quest number to the minimum possible...

The requests anyways remains..
 
Here is the copy of Prexus' old Quest Manager system:
Code:
#----------------------------------------#
# ● Quest Manager Revision by Prexus ● #
#----------------------------------------#
# Created on Friday, June 3rd            #
# Revised on Sunday, June 5th            #
# www.prexus.nearfantasticaonline.com    #
# All Rights Reserved                    #
#----------------------------------------#
# Interferance Scripts:                  #
# Quest Manager Revision uses these      #
# default classes, so make sure no other #
# scripts interfere. If they do, update  #
# them accordingly.                      #
# Game_Party                             #
# Scene_Title                            #
# Scene_Save                             #
# Scene_Load                             #
#----------------------------------------#
# New in Revision 1:                     #
# The quests look better visually, using #
# a duallist for requirements and easier #
# access to a quests status in the list. #
# Also, when a quest uses switches or    #
# variables, $game_switches/variables is #
# no longer used. This is important to   #
# note because now, you must use Call    #
# Script to change the values.           #
# Like so:                               #
# $quest_variables[id] (will return the value at id.)
# $quest_variables[id] += value (will add value to the current value of the var)
# $quest_variables[id] -= value (will subtract value from the current var)
# $quest_variables[id] /= value (will divide the current var with value)
# $quest_variables[id] *= value (will mulitple the current var by value)
# $quest_switches[id] (will return true or false based on the id)
# $quest_switches[id] = true (will set switch to true)
# $quest_switches[id] = false (will set switch to false)
# ● Thank you Mr. DJ for the idea =) ● #
#----------------------------------------#
# To use this script, simply paste it    #
# above main. It should not interfere    #
# with any other scripts unless they use #
# or change scene_load and scene_save and#
# scene_title, as they are the only      #
# default scripts that are affected.     #
# To add a quest to the database, in     #
# Call Script, put the following:        #
# ●●●●●●●●●●●●●●●●●●● #
# $quest[id] = PRX_Quest.new       Change ID to whatever you want. Just never use the same twice.
# $quest[id].name = "Enter Name Here"
# $quest[id].type = 0-3 (explained below)
# $quest[id].description = "Short Explaination of Quest"
# $quest[id].requirements = [] (An array of values, Explained Below)
# $quest[id].values = [] (An array of values, explained below)
# $quest[id].switches = [] (Array of switch IDs, explained below.)
# $quest[id].variables = [] (Array of variable IDs, explained below.)
# $quest[id].completed = Set this to true/false when the quest is done
# $quest[id].disabled = If you want the quest to appear disabled, set this to true
# ●●●●●●●●●●●●●●●●●●● #
# Important Notes about Values:
# ● .name
#   - A string value that appears in the list.
# ● .type
#   - An integer value 0-3.
#     When the value is set to 0, make sure to set .requirements to string values.
#     These will appear in the quest menu and never change.
#
#     If type is set to 1, make sure to set .requirements to string values and
#     set .variables accordingly. Also, .values needs to be set
#     appropriately as well. For example:
#     .requirements = ["Kill Two Goblins", "Find 3 Eggs"]
#     .values = [2, 3]
#     .variables = [1, 2]
#     If variable 1 is 2 or higher, the first requirement will appear green and
#     if variable 2 is 3 or higher, the second requirement will appear green.
#
#     If it is set to 2, make sure to set .requirements to string values and
#     set .switches accordingly. For example:
#     .requirements = ["Fight Orc", "Capture Flag"]
#     .switches = [1, 2]
#     If switch 1 is on, Fight Orc will appear green in the menu and if switch 2
#     is on, Capture Flag will also appear green.
#
#     If type is set to 3, make sure to set .requirements to IDs of Items from
#     the database. Then make sure .values are set appropriately.
#     For example:
#     .requirements = [1, 2, 3]
#     .values = [3, 2, 1]
#     You'd need 3 potions, 2 high potions, and 1 full potion.
# ● .description
#   - A string value that appears in the description box explaining quest.
# ● .requirements
#   - An array which if type is 0 2 or 3, will contain string values, for example
#     ["Kill the King", "Save the Princess", "Dance a Jig"]
#     If type is 1, be sure to fill it with item ids such as
#     [1, 2, 3] will return Potion, High Potion, Full Potion by default
# ● .values
#   - An array which holds integer values. If the type is 0, this field can be
#     blank as it will have no effect. If type is 1, these values correspond with
#     how much of the items in .requirements you need. For example:
#     .requirements = [1, 2, 3]
#     .values = [3, 2, 1]
#     You need 3 Potions, 2 High Potions, and 1 Full Potion.
#     If type is 1, this holds how much of each Quest Variable you need.
# ● .switches
#   - Holds integer values of the IDs of Quest_Switches. This is used if the .type
#     is set to 2.
# ● .variables
#   - Holds integer values of the IDs of Quest_Variables. This is used if the .type
#     is set to 1.
# ● .completed
#   - If true, the name will be green in the quest menu.
#     [NEW] This field will automatically update if conditions for quest are met.
# ● .disabled
#   - If true, the name will be greyed out in the quest menu.
# Note: If both completed and disabled are true, it will appear completed.
#
# If any further questions are needed refer to the RMXP.net thread.
# ●●●●●●●●●●●●●●●●●●● #

# Visual Aspects:

# New Class
#-------------------#
# ● Scene Quest ● #
#-------------------#
class Scene_Quest
 def main
   @quest = Window_Quest.new
   @desc = Window_Description.new
   @req = Window_Requirements.new
   @quest.help_window = @desc
   @quest.req_window = @req
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   Graphics.freeze
   @quest.dispose
   @desc.dispose
   @req.dispose
 end
 def update
   @quest.update
   @desc.update
   @req.update
   if Input.trigger?(Input::B)
     $scene = Scene_Map.new
   end
 end
end
# End New Class

# New Class
#--------------------#
# ● Window Quest ● #
#--------------------#
class Window_Quest < Window_Selectable
 attr_reader :req_window
 def initialize
   super(0, 0, 640, 192)
   @column_max = 2
   refresh
   self.index = 0
 end
 def quest
   return @data[self.index]
 end
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   @data = []
   for i in 0...$quest.size
     if $quest[i] != nil
       @data.push($quest[i])
     end
   end
   @item_max = @data.size
   if @item_max > 0
     self.contents = Bitmap.new(width - 32, row_max * 32)
     self.contents.font.name = $fontface
     self.contents.font.size = $fontsize
     for i in 0...@item_max
       draw_item(i)
     end
   end
 end
 def draw_item(index)
   quest = @data[index]
   text = ""
   if quest.type == 0
     self.contents.font.color = normal_color
     text = quest.name
   else
     if quest.disabled
       self.contents.font.color = disabled_color
       text += "(?) " + quest.name.to_s
     elsif quest.completed
       self.contents.font.color = Color.new(0, 255, 0, 255)
       text += "(*) " + quest.name.to_s
     else
       self.contents.font.color = Color.new(255, 0, 0, 255)
       text += "(!) " + quest.name.to_s
     end
   end
   x = 4 + index % 2 * (288 + 32)
   y = index / 2 * 32
   self.contents.draw_text(x, y, 212, 32, text, 0)
 end
 def update_help
   @help_window.set_text(self.quest == nil ? "" : self.quest.description)
   if self.quest != nil
     if @req_window != nil
       @req_window.clear_text
       for i in 0...self.quest.requirements.size
         quest = self.quest
         if quest.type == 0
           @req_window.add_text(quest.requirements[i].to_s, -1)
         elsif quest.type == 1
           quest_variable = $quest_variables[quest.variables[i]]
           if quest_variable != nil
             @req_window.add_text(quest.requirements[i].to_s, quest_variable.to_i, quest.values[i], quest.type)
           else
             @req_window.add_text("Not Found?", -1)
           end
         elsif quest.type == 2
           quest_switch = $quest_switches[quest.switches[i]]
           if quest_switch != nil
             @req_window.add_text(quest.requirements[i].to_s, quest_switch, quest.values[i], quest.type)
           else
             @req_window.add_text("Not Found?", -1)
           end
         elsif quest.type == 3
           quest_item = $data_items[quest.requirements[i]]
           if quest_item != nil
             @req_window.add_text(quest_item.name.to_s, $game_party.item_number(quest_item.id), quest.values[i], quest.type)
           else
             @req_window.add_text("Not Found?", -1)
           end
         end
       end
     end
   end
 end
 def help_window=(help_window)
   @help_window = help_window
   if self.active and @help_window != nil
     update_help
   end
 end
 def req_window=(req_window)
   @req_window = req_window
   if self.active and @req_window != nil
     update_help
   end
 end
end
# End New Class

# New Class
#---------------------------#
# ● Window Requirements ● #
#---------------------------#
class Window_Requirements < Window_Base
 def initialize
   super(0, 256, 640, 480-256)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.contents.font.name = $fontface
   self.contents.font.size = $fontsize
   @full_text = []
   @amount = []
   @amount_needed = []
   @type = []
 end
 def add_text(text, amount, amount_needed = -1, type = 0)
   @full_text.push(text)
   @amount.push(amount)
   @amount_needed.push(amount_needed)
   @type.push(type)
   show_text
 end
 def clear_text
   @full_text = []
   @amount = []
   @amount_needed = []
   @type = []
 end
 def show_text
   self.contents.clear
   self.contents.font.color = normal_color
   for i in 0...@full_text.size
     x = 4 + i % 2 * (288 + 32)
     y = i / 2 * 32
     if @type[i] == 0
       self.contents.font.color = normal_color
       self.contents.draw_text(x, y, (self.width / 2) - 40, 32, @full_text[i], 0)
     elsif @type[i] == 1 or @type[i] == 3
       if @amount[i] >= @amount_needed[i]
         self.contents.font.color = Color.new(0, 255, 0, 255)
       else
         self.contents.font.color = Color.new(255, 0, 0, 255)
       end
       self.contents.draw_text(x, y, (self.width / 2) - 40, 32, @full_text[i], 0)
       self.contents.draw_text(x, y, (self.width / 2) - 40, 32, @amount[i].to_s + "/" + @amount_needed[i].to_s, 2)
     elsif @type[i] == 2
       if @amount[i] == true
         self.contents.font.color = Color.new(0, 255, 0, 255)
       else
         self.contents.font.color = Color.new(255, 0, 0, 255)
       end
       self.contents.draw_text(x, y, (self.width / 2) - 40, 32, @full_text[i], 0)
     end
   end
   self.visible = true
 end
end
# End New Class

# New Class
#--------------------------#
# ● Window Description ● #
#--------------------------#
class Window_Description < Window_Base
 def initialize
   super(0, 192, 640, 64)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.contents.font.name = $fontface
   self.contents.font.size = $fontsize
 end
 def set_text(text, align = 0)
   if text != @text or align != @align
     self.contents.clear
     self.contents.font.color = normal_color
     self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
     @text = text
     @align = align
   end
   self.visible = true
 end
end
# End New Class

# Programming Aspects:

# New Class
#-----------------#
# ● PRX_Quest ● #
#-----------------#
class PRX_Quest
 attr_accessor :name
 attr_accessor :type
 attr_accessor :description
 attr_accessor :requirements
 attr_accessor :values
 attr_accessor :switches
 attr_accessor :variables
 attr_accessor :completed
 attr_accessor :disabled
 def initialize
   @name = ""
   @type = 0
   @description = ""
   @requirements = []
   @values = []
   @switches = []
   @switches = Array.new(5000, false)
   @variables = []
   @variables = Array.new(5000, 0)
   @completed = false
   @disabled = false
 end
end
# End New Class

# Modified Class
#-------------------#
# ● Scene Title ● #
#-------------------#
class Scene_Title
 def initialize
   $quest_switches      = Quest_Switches.new # New
   $quest_variables     = Quest_Variables.new # New
   $quest               = [] # New
 end
end
# End Modified Class

# Modified Class
#------------------#
# ● Scene Load ● #
#------------------#
class Scene_Load
 def read_save_data(file)
   characters = Marshal.load(file)
   Graphics.frame_count = Marshal.load(file)
   $game_system         = Marshal.load(file)
   $game_switches       = Marshal.load(file)
   $quest_switches      = Marshal.load(file) # New
   $game_variables      = Marshal.load(file)
   $quest_variables     = Marshal.load(file) # New
   $game_self_switches  = Marshal.load(file)
   $game_screen         = Marshal.load(file)
   $game_actors         = Marshal.load(file)
   $game_party          = Marshal.load(file)
   $game_troop          = Marshal.load(file)
   $game_map          = Marshal.load(file)
   $game_player         = Marshal.load(file)
   $quest               = Marshal.load(file) # New
   if $game_system.magic_number != $data_system.magic_number
     $game_map.setup($game_map.map_id)
     $game_player.center($game_player.x, $game_player.y)
   end
   $game_party.refresh
 end
end
# End Modified Class

# New Class
#----------------------#
# ● Quest Switches ● #
#----------------------#
class Quest_Switches
 def initialize
   @data = []
   @data = Array.new(5000, false)
 end
 def [](switch_id)
   if switch_id <= 5000 and @data[switch_id] != nil
     return @data[switch_id]
   else
     return false
   end
 end
 def []=(switch_id, value)
   if switch_id <= 5000
     @data[switch_id] = value
     comp_count = 0
     for i in 0...$quest.size
       if $quest[i].type == 2
         for k in 0...$quest[i].requirements.size
           if @data[$quest[i].switches[k]] == true
             comp_count += 1
           end
         end
         if comp_count == $quest[i].requirements.size
           $quest[i].completed = true
         else
           $quest[i].completed = false
         end
       end
     end
   end
 end
end
# End New Class

# New Class
#-----------------------#
# ● Quest Variables ● #
#-----------------------#
class Quest_Variables
 def initialize
   @data = []
   @data = Array.new(5000, 0)
 end
 def [](variable_id)
   if variable_id <= 5000 and @data[variable_id] != nil
     return @data[variable_id]
   else
     return 0
   end
 end
 def []=(variable_id, value)
   if variable_id <= 5000
     @data[variable_id] = value
     comp_count = 0
     for i in 0...$quest.size
       if $quest[i].type == 1
         for k in 0...$quest[i].requirements.size
           if @data[$quest[i].variables[k]] != nil
             if @data[$quest[i].variables[k]] >= $quest[i].values[k]
               comp_count += 1
             end
           end
         end
         if comp_count == $quest[i].requirements.size
           $quest[i].completed = true
         else
           $quest[i].completed = false
         end
       end
     end
   end
 end
end
# End New Class

# Modified Class
#------------------#
# ● Game Party ● #
#------------------#
class Game_Party
 def gain_item(item_id, n)
   if item_id > 0
     @items[item_id] = [[item_number(item_id) + n, 0].max, 99].min
     # New
     comp_count = 0
     for i in 0...$quest.size
       if $quest[i].type == 3
         for k in 0...$quest[i].requirements.size
           if item_number($quest[i].requirements[k]) >= $quest[i].values[k]
             comp_count += 1
           end
         end
         if comp_count == $quest[i].requirements.size
           $quest[i].completed = true
         else
           $quest[i].completed = false
         end
       end
     end
     # End New
   end
 end
end
# End Modified Class
 
Man, i solved this by myself...
Thank you to all the people that didn't help me cause they thought it was "bad coded".
I actually solved withouth ruby knowledge but with logic knowledge.
There was a bad algorithm.
This topic can be closed.
 
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