Main Menu
  • Welcome to The RPG Maker Resource Kit.

"Simple" Quest log screen

Started by Sthrattoff, January 12, 2007, 08:55:45 AM

0 Members and 2 Guests are viewing this topic.

Irgna

Sweet, this script fixes the problem I've had with every other Quest Log I've found. I have a question though. I really need this script for my game, but I might be making my game commercial. Besides asking you for permission (which I am doing now) and including you in the credits, what would you require?
PROPERTY OF TEABAG!!! ALL HAIL TEABAG!!!

Valcos

Window_Command line 18 RGGS Error faild to creat bit map? what does that mean?
Im to cool to have my own signature!!!

Karo Rushe

Whenever I use the Call Script Command
I get that This Line:

Quote$descriptionm.push "Head to the Temple, and Retrieve The 'Lost Logia' Before Valmar."
number (1)
$objectivesm.push
Saying it cannot be read, error on Nil.

Sthrattoff

look at this line :
$objectivesm
make sure to change the m with objective numbers, like:
$objectives1

By the way, is that the old version?
I already updated it. Check this thread.
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

Sthrattoff

#54
New Version Has Arrived!
No more editing at other places. Just put it!

#=============================================================================
# Quest Log Screen
#-----------------------------------------------------------------------------
# ** Version 2.3
# ** Original by Sthrattoff
#=============================================================================
# Description :
# This script enables the ability to show current active quest.

# Features :
# EXTREMELY SIMPLIFIED! Now the script is just about 150 lines length including comments.
# Unlimited amount of quest can be added.
# Use variable to mark quest's progress.

# Limitation :
# Only can store up to 12 progresses per quest.

# History :
# Version 1.0 : Initial release.
# Version 1.2 : Add "Types" features.
# Version 2.0 : Changes in programming style and infinite quest support.
# Version 2.2 : Cut the script length to about 150 lines.
# Version 2.3 : Add "Quest Progress" bar in exchange of "Types" removal.

# Instruction
# Just put this script above main.

# Configuration :
# To add a quest, fill these information by using .push
# $names.push "Name"
# $types.push "Type"
# $description.push (["line1", "line2", ..., "Line5"])
# $objectives.push (["onjective1", ..., "objective12"])
# $var_ID.push ID_NUMBER
# $end_val.push END_VALUE

# Credits
# See the header + Blizzard and Enterbrain
#=============================================================================
class Scene_Quest
 
 # Defines array variables
 $names = []
 $description = []
 $objectives = []
 $var_ID = []
 $end_val = []
 
 # The main process
 def main
   @quest_list = Window_Command.new(160, $names)
   @quest_window = Window_Quest.new
   @quest_window.x = 160
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     break if $scene != self
   end
   Graphics.freeze
   @quest_list.dispose
   @quest_window.dispose
 end
 
 def update
   @quest_list.update
   @quest_window.update
   if @quest_list.active
     update_quest
     return
   end
 end
 
 def update_quest
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Menu.new(2)
     return
   end
   $id = @quest_list.index
   return
 end
 
end    

class Window_Quest < Window_Base
 
 def initialize
   super(0, 0, 480, 480)
   self.contents = Bitmap.new(width - 32, height - 32)
   refresh
 end
 
 def refresh
   self.contents.clear
   self.contents.font.color = system_color
   self.contents.draw_text(0, 0, self.width - 32, 32, $names[$id.to_i].to_s, 1)
   self.contents.draw_text(0, 192, self.width - 32, 32, "Objectives", 1)
   self.contents.draw_text(0, 416, self.width - 32, 32, "Quest Progress")
   self.contents.font.color = normal_color
   for i in 0..4
     self.contents.draw_text(0, i * 32 + 32, self.width - 32, 32, $description[$id.to_i][i].to_s)
   end
   a = b = $game_variables[$var_ID[$id.to_i]]
   if a > 5
     self.contents.draw_text(240, (a - 6) * 32 + 224, 240, 32, "• " + $objectives[$id.to_i][a].to_s)
   else
     self.contents.draw_text(0, a * 32 + 224, 240, 32, "• " + $objectives[$id.to_i][a].to_s)
   end
   self.contents.font.color = disabled_color
   if b > 0
     for j in 0..(b - 1)
       if j > 5
         self.contents.draw_text(240, (j - 6) * 32 + 224, 240, 32, "• " + $objectives[$id.to_i][j].to_s)
       else
         self.contents.draw_text(0, j * 32 + 224, 240, 32, "• " + $objectives[$id.to_i][j].to_s)
       end
     end
   end
   draw_quest_progress(96, 428, self.width - 128)
 end
 
 def update
   refresh
 end
 
end

class Window_Base < Window
 
 def draw_quest_progress(x, y, w = 200)
   current = $game_variables[$var_ID[$id.to_i]]
   ending = $end_val[$id.to_i]
   bordercolor = system_color
   outercolor  = Color.new(180, 210, 120, 255)
   midcolor    = Color.new(180, 210, 140, 255)
   innercolor  = Color.new(180, 210, 160, 255)
   emptycolor  = Color.new(0, 0, 0, 255)
   linewidth = (((current * 1.0) / ending) * (w - 2))
   emptywidth = ((w - 1) - linewidth)
   emptyx = ((x + 1) + linewidth)
   border = Rect.new(x, y, w, 8)
   emptyline = Rect.new(x + 1, y + 1, w - 2, 6)
   outerline = Rect.new(x + 1, y + 1, linewidth, 6)
   midline = Rect.new(x + 2, y + 2, linewidth - 2, 4)
   innerline = Rect.new(x + 3, y + 3, linewidth - 4, 2)
   self.contents.fill_rect(border, bordercolor)
   self.contents.fill_rect(emptyline, emptycolor)
   self.contents.fill_rect(outerline, outercolor)
   self.contents.fill_rect(midline, midcolor)
   self.contents.fill_rect(innerline, innercolor)
 end
 
end

class Scene_Save < Scene_File
 
 alias old_save_data write_save_data
 def write_save_data(file)
   old_save_data(file)
   Marshal.dump($names, file)
   Marshal.dump($description, file)
   Marshal.dump($objectives, file)
   Marshal.dump($var_ID, file)
   Marshal.dump($end_val, file)
 end
 
end

class Scene_Load < Scene_File
 
 alias old_load_data read_save_data
 def read_save_data(file)
   old_load_data(file)
   $names = Marshal.load(file)
   $description = Marshal.load(file)
   $objectives = Marshal.load(file)
   $var_ID = Marshal.load(file)
   $end_val = Marshal.load(file)
 end
 
end

class Scene_Title
 
 alias old_new_game command_new_game
 def command_new_game
   old_new_game
   $names.clear
   $description.clear
   $objectives.clear
   $var_ID.clear
   $end_val.clear
 end
 
end

class Scene_Menu
 
 def initialize(menu_index = 0)
   @menu_index = menu_index
   size = $names.size
   for i in 0..size
     var = $var_ID[i]
     ending = $end_val[i]
     if $game_variables[var.to_i] >= ending.to_i
       $names.delete_at i
       $description.delete_at i
       $objectives.delete_at i
       $var_ID.delete_at i
       $end_val.delete_at i
     end
   end
 end
 
end
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

Martynator

I'm sorry, but i still don't understand it. Now you can ask what, but that's hard and much to explain, so i want to ask you (i think this sounds kinda rude  :)) if you can make a very small demo off this with 2 people and they both give you a quest, and ( of course) you can see that in the quest log, and you must do something and then you see that you're further in the quest. thanks. ;D

And My Game Too When It Ever Finishes :P
Martynator and 24 Sneaky Snoopers are viewing this board.
Why don't they join then? :lol:

Sthrattoff

Demo?
Sounds good. I'll make it when I have some time
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

Martynator


And My Game Too When It Ever Finishes :P
Martynator and 24 Sneaky Snoopers are viewing this board.
Why don't they join then? :lol:

Sthrattoff

I'm busy. A lot.
I'm doing my project by myself...
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

swiftdeathsk

#59
looks good! I understand it pretty well so far, I could make a demo for you :) i'll get started on it right now!



EDIT: I have taken the liberty and created a demo for this :) here's the link: http://www.box.net/shared/78qraeztaf
If the scripter or an admin/mod wishes to add this link to the first post, please do.

swiftdeathsk

#60
I've got a problem with this script. From what I have figured out, you must do each quest in order because of the $var_ID.push #. The problem is the .push, which basically makes it so that if you skip a quest between, say quest [ 0] and quest [2] (quest [1] basically), then you get an error of "cannot convert nil into String", and the error line is in the 'Window_Line' script on line 40 (this is the line:     self.contents.draw_text(rect, @commands[index]) ). This is a problem for my game because there is no specific order of quests that must be done, which means that using .push for the variable will not work for my game, because (as i have said) the quest can only be done in order... is there any way someone could help by making the $var_ID.push ID_NUMBER be similar to the $name variable in the sense that it goes like this: $var_ID[QUEST_ID] ID_NUMBER



Inunah

I know this may seem dumb, but..

Where do you put that script?

Falcon


hero_kenshi

i have the same problem as swiftdeathsk
also... my objextives are long descriptions and id prefer not to make them short cause most dont fit into the place where you type the objextives in that little box thing is there a way a can have more than one box... if you understand wat im asking

P.s gotta love the beas  :bean:

DarkEmmisary

Could you make an example for as what to put in the call script command?

eg. for quest "The Dark Side"

type: Sidequest

Description: Frank wants me to gather the materials for his new experiments

Objectives: Gather Materials: King's Weed, Fireroot, Dead Leaves

Sthrattoff

example, call script event command:
<code>
$names.push "The Dark Side"
$description.push ["I need something", "To become Darth Vader"]
$objectives.push ["Kill Palpatine", "Kill Yoda"]
</code>
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

r_y_u_u

 :(help, i am using this script in my game, and i edited the menu so that you could have this where save normally is, as i am saving from events, i came to test my firsts ave event, and it gave me this error
QuoteScript 'quest log' line 161: argument error occured.
wrong number of arguments(0 for1)
whats wrong?
help!!! :(

destiny

i am using version 2.3 and im getting an error  :o



Script 'Window_Command' line 18:RGSSError occurred.
Failed to create bitmap



self.contents = Bitmap.new(width - 32, @item_max * 32)

can someone tell me what is wrong?

Sthrattoff

Hold on. I'll rewrite everything. Seems take some days...
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

destiny

finaly a reply  ;D
thank u for the reply
thanks in advance for re-writing the script

Sthrattoff

#70
So far...

It's quite simpler, and use no global variables (which that means less RAM usage, or so experts says), but I didn't put method to write the description yet, I'm still confused how to get the paragraphs looks good. And then, on my calculation, for a moment (until I update this script again), don't make a subquest MORE THAN 8. Otherwise, the other subquest (objectives) will not shown.

Usage:
$game_system.(properties).push details # to add quest detail. for objectives, push in form of array.

To call:
$scene = Scene_Quest.new

Because this is the specific version (for usage on Symphony of Alderra : Hourglasses And Memories, which is older name was Symphony of Alderra : Memoirs of Life), so on the Scene_Quest's def update, change $scene = Scene_Menu.new(2) to $scene = Scene_Map.new if you didn't planning to integrate this script to your CMS. And, I didn't test it yet. If you found error please PM me.

#==============================================================================
# Improvised Quest Log
# Written specifically for Symphony of Alderra : Hourglasses And Memories
# © 2007 by Sthrattoff
#==============================================================================

# Supplement for Game_System
class Game_System
 
  attr_accessor :quest_name           # Quest's title
  attr_accessor :quest_length         # Quest's subquests
  attr_accessor :quest_description    # Quest's description
  attr_accessor :quest_objectives     # Quest's objectives
  attr_accessor :quest_marker         # Quest's marker variable
 
  alias old_initialize initialize
  def initialize
    old_initialize
    @quest_name = []
    @quest_length = []
    @quest_description = []
    @quest_objectives = []
    @quest_marker = []
  end
 
end

# Supplement for Scene_Map
class Scene_Map
 
  alias old_update update
  def update
    quest_size = $game_system.quest_name.size
    for i in 0..quest_size - 1
      if $game_variables[$game_system.quest_marker[i].to_i] >= $game_system.quest_length
        $game_system.quest_name.delete_at i
        $game_system.quest_length.delete_at i
        $game_system.quest_description.delete_at i
        $game_system.quest_objectives.delete_at i
        $game_system.quest_marker.delete_at i
        quest_size -= 1
      end
    end
    old_update
  end
 
end

class Window_Quest < Window_Base
 
  def initialize(id)
    super(0, 0, 480, 480)
    self.contents = Bitmap.new
    refresh
    @id = id
  end
 
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 480, 32, $game_system.quest_name[@id].to_s, 1)
    self.contents.draw_text(0, 32, 480, 32, "Description")
    self.contents.draw_text(0, 192, 480, 32, "Objectives")
    self.contents.font.color = disabled_color
    size = $game_variables[$game_system.quest_marker[@id].to_i]
    for i in 0..size - 1
      self.contents.draw_text(0, 224 + i * 32, 480, 32, $game_system.quest_objectives[@id][i].to_s)
    end
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 224 + size.to_i * 32, 480, 32, $game_system.quest_objectives[@id][size].to_s)
    self.contents.font.color = normal_color
    # Deskripsi dan segala methodnya...
  end
 
end

class Scene_Quest
 
  def main
    @command = Window_Command.new(160, $game_system.quest_name)
    @command.x = 480   
    @quest = Window_Quest.new(@command.index)   
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    @command.dispose
    @quest.dispose
  end
 
  def update
    @command.update
    @quest.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(2)
      return
    end
    return
  end
 
end
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

destiny

i get a syntaxerror on line 68 :o
hope u can fix it  ;)

Sthrattoff

2 things fixed.
Copy paste the code below again...
Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%

destiny

#73
thank you
but now i get a SyntaxError on line 70  :(
i tried it both in a new one and an existing project.

Sthrattoff

Symphony of Alderra : Memoirs of Life

Storyline : 200% (Overimaginatives)
Scripting : 100% (At last...)
Eventing  : 100%
Mapping   : 0.125%