Dargor I'm trying to add omega7's Achievements to the customs command so that it comes up in the main menu. I tried to put it in the update command selection but I don't know how.
Here is Omega7's Achievements Module
Here is Omega7's Achievements Module
# ===========================================================================
# 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 = 87
# Achievents Icons ID when complete.
ICON_COMPLETE = 86
# 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] == true
@names = ACHIEVEMENT_NAME.to_s
else
@names = "???"
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] == true
@info = ACHIEVEMENT_INFO
else
@info = ["Unknown Information."]
end
end
end
def create_info_window
@info_window = Omegas7_Achievement_Info.new
@info_window_2 = Omegas7_Achievement_Info_2.new
end
end
class Omegas7_Achievement_Info < Window_Base
def initialize
super(200,0,544 - 200,316)
@info = [""]
refresh
end
def refresh
self.contents.clear
for i in 0...@info.size
self.contents.draw_text(0,i * 28,self.width,28,@info.to_s)
end
end
def update(info)
if @info != info
@info = info
refresh
end
end
end
class Omegas7_Achievement_Info_2 < Window_Base
include OMEGAS7_ACHIEVEMENTS
def initialize
super(0,316,544,100)
@complete = 0
refresh
end
def refresh
for i in 0..ACHIEVEMENT_NAME.size
if $game_switches[ACHIEVEMENT_SWITCH.to_i] == true
@complete += 1
end
end
self.contents.clear
self.contents.draw_text(0,0,544,50,"Complete Achievements: " + @complete.to_s + " / " + ACHIEVEMENT_NAME.size.to_s)
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.to_i] == true
@done = true
else
@done = 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
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
commands = $game_system.menu_commands
index = commands.index(Vocab::save)
$game_system.add_menu_command(index, Vocab::Achievements)
dargor_vx_cmcbestiary_menu_create_command_window
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
dargor_vx_cmcbestiary_menu_update_command_selection
command = @command_window.selection
if Input.trigger?(Input::C)
case @command_window.selection
when Vocab::Achievements
$scene = Omegas_Achievements_Scene.new(true)
end
end
end
# 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 = 87
# Achievents Icons ID when complete.
ICON_COMPLETE = 86
# 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] == true
@names = ACHIEVEMENT_NAME.to_s
else
@names = "???"
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] == true
@info = ACHIEVEMENT_INFO
else
@info = ["Unknown Information."]
end
end
end
def create_info_window
@info_window = Omegas7_Achievement_Info.new
@info_window_2 = Omegas7_Achievement_Info_2.new
end
end
class Omegas7_Achievement_Info < Window_Base
def initialize
super(200,0,544 - 200,316)
@info = [""]
refresh
end
def refresh
self.contents.clear
for i in 0...@info.size
self.contents.draw_text(0,i * 28,self.width,28,@info.to_s)
end
end
def update(info)
if @info != info
@info = info
refresh
end
end
end
class Omegas7_Achievement_Info_2 < Window_Base
include OMEGAS7_ACHIEVEMENTS
def initialize
super(0,316,544,100)
@complete = 0
refresh
end
def refresh
for i in 0..ACHIEVEMENT_NAME.size
if $game_switches[ACHIEVEMENT_SWITCH.to_i] == true
@complete += 1
end
end
self.contents.clear
self.contents.draw_text(0,0,544,50,"Complete Achievements: " + @complete.to_s + " / " + ACHIEVEMENT_NAME.size.to_s)
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.to_i] == true
@done = true
else
@done = 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
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
commands = $game_system.menu_commands
index = commands.index(Vocab::save)
$game_system.add_menu_command(index, Vocab::Achievements)
dargor_vx_cmcbestiary_menu_create_command_window
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
dargor_vx_cmcbestiary_menu_update_command_selection
command = @command_window.selection
if Input.trigger?(Input::C)
case @command_window.selection
when Vocab::Achievements
$scene = Omegas_Achievements_Scene.new(true)
end
end
end