samanoskue
Member
Script Request Template
I really like this Achievement (have made a few charges to the script) but I want to use it as a Quest script.
Detailed Description:
Basically I want to make it so that when the first switch is active the quest text changes from ??? to the text giving the information on the quest.
Then when a second switch is active the quest text changes to something else.
Example
quest text "???"
switch 1 = on
quest text "Please head to the dock and talk to Adam."
switch 2 = on
Quest text "complete"
Screen shots:
I really like this Achievement (have made a few charges to the script) but I want to use it as a Quest script.
Code:
Â
# ===========================================================================
# Â Â Â Â Â Â Â Â Achievements System Script by Omegas7.
# ===========================================================================
# Â Â Â Â Version: 2.0.
# Â Â Â Â Possibly final version, functional.
# ===========================================================================
# Â Â Author: Omegas7.
# Â Â Exclusive script for: Â http://www.myrpgmaker.com
# Â Â Platform: RPG Maker VX.
# ===========================================================================
#
# Â Â New to version 2.0:
# Â Â Â Set complete achievements icon.
# Â Â Â Set incomplete achievements icon.
# Â Â Â Window showing the total achievements done.
#
# ===========================================================================
Â
Â
# ===========================================================================
# Â Module, here you may edit the achievements here.
# ===========================================================================
Â
module OMEGAS7_ACHIEVEMENTS
Â
 # Achievents Icons ID when incomplete.
 ICON_INCOMPLETE = 0
Â
 # Achievents Icons ID when complete.
 ICON_COMPLETE = 0
Â
 # Achievements Icons spaces before the achievements names.
 # Default 3 (3 spaces).
 ICON_SPACE_LEVEL = 3
Â
 # Achievements Names, separated by commas.
 ACHIEVEMENT_NAME = ["01- Super Love.","02- Super Hate.","03- Amazing Chest."]
Â
 # Achievements Done Switches ID, sperated by commas.
 ACHIEVEMENT_SWITCH = [1,2,3]
Â
Â
 ACHIEVEMENT_INFO = []    # <--- Don't edit this.
Â
 # Achievements Information/Descriptions.
 # ACHIEVEMENT_INFO[N] = [Text Lines]
 # N is the Achievement ID, counting from 0.
 # The text lines, each separated by a comma.
Â
 ACHIEVEMENT_INFO[0] = [
 "There is a pretty green haired girl.",
 "I bet I could make her love me",
 "easily."
 ]
Â
 ACHIEVEMENT_INFO[1] = [
 "I bet I could make that green",
 "haired girl hate me."
 ]
Â
 ACHIEVEMENT_INFO[2] = [
 "There is a quite interesting red,",
 "chest wonder what's in it?"
 ]
Â
end
Â
# ===========================================================================
# End of module.
# ===========================================================================
Â
class Omegas_Achievements_Scene < Scene_Base
Â
 include OMEGAS7_ACHIEVEMENTS
Â
 def initialize
  create_values
  create_commands
  create_info
  create_info_window
 end
Â
 def start
  create_menu_background
 end
Â
 def create_values
  @names = []
  @switches = ACHIEVEMENT_SWITCH
  @info = []
  @info_2 = []
 end
Â
 def create_commands
  for i in 0...ACHIEVEMENT_NAME.size
   if $game_switches[@switches[i]] == true
    @names[i] = ACHIEVEMENT_NAME[i].to_s
   else
    @names[i] = "???"
   end
  end
  @command_window = Window_Command_Ach.new(200,@names)
  @command_window.height = 316
 end
Â
 def update
  @command_window.update
  @info_2 = @info[@command_window.index]
  @info_window.update(@info_2)
 Â
  if Input.trigger?(Input::B)
   @command_window.dispose
   @info_window.dispose
   @info_window_2.dispose
   $scene = Scene_Map.new
  end
  Â
 end
Â
 def create_info
  for i in 0...ACHIEVEMENT_INFO.size
   if $game_switches[@switches[i]] == true
    @info[i] = ACHIEVEMENT_INFO[i]
   else
    @info[i] = ["Unknown Information."]
   end
  end
 end
Â
 def create_info_window
  @info_window = Omegas7_Achievement_Info.new
 end
Â
end
Â
Â
class Omegas7_Achievement_Info < Window_Base
 def initialize
  super(200,0,544 - 200,417)
  @info = [""]
  refresh
 end
 def refresh
  self.contents.clear
  for i in [email=0...@info.size]0...@info.size[/email]
   self.contents.draw_text(0,i * 28,self.width,28,@info[i].to_s)
  end
 end
 def update(info)
  if @info != info
   @info = info
   refresh
  end
 end
end
Â
Â
class Window_Command_Ach < Window_Selectable
Â
 include OMEGAS7_ACHIEVEMENTS
Â
 attr_reader  :commands
Â
 def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
  if row_max == 0
   row_max = (commands.size + column_max - 1) / column_max
  end
  super(0, 0, width, row_max * WLH + 32, spacing)
  @commands = commands
  @item_max = commands.size
  @column_max = column_max
  @spaces = ICON_SPACE_LEVEL.to_i
  @spaces_text = ""
  @done = []
 Â
  for i in 0...@spaces
   @spaces_text += " "
  end
 Â
  for i in 0..ACHIEVEMENT_NAME.size
   if $game_switches[ACHIEVEMENT_SWITCH[i].to_i] == true
    @done[i] = true
   else
    @done[i] = false
   end
  end
  Â
  refresh
  self.index = 0
 end
Â
 def refresh
  self.contents.clear
  for i in 0...@item_max
   draw_item(i)
  end
 end
Â
 def draw_item(index, enabled = true)
  rect = item_rect(index)
  rect.x += 4
  rect.width -= 8
  self.contents.clear_rect(rect)
  self.contents.font.color = normal_color
  self.contents.font.color.alpha = enabled ? 255 : 128
  self.contents.draw_text(rect, @spaces_text.to_s + @commands[index])
  if @done[index] == true
   draw_icon(ICON_COMPLETE.to_i,0,rect.y)
  else
   draw_icon(ICON_INCOMPLETE.to_i,0,rect.y)
  end
 Â
 end
end
Â
Detailed Description:
Basically I want to make it so that when the first switch is active the quest text changes from ??? to the text giving the information on the quest.
Then when a second switch is active the quest text changes to something else.
Example
quest text "???"
switch 1 = on
quest text "Please head to the dock and talk to Adam."
switch 2 = on
Quest text "complete"
Screen shots: