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.

[vx] change Achievement script to a quest script

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.
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:
Mission1.jpg

Mission2.jpg

Mission3.jpg
 

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