Thank you very much for the name change modern algebra, if there is anything I could do for you, please let me know.
As for the script I forgot about it until today. Spent the whole week watching all the movies I've missed since 2005 and looking for a nice project to join.
This script adds the help command to the main menu in the default menu.
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, "Help"])
@command_window.index = @menu_index
if $game_party.members.size == 0 # If number of party members is 0
@command_window.draw_item(0, false) # Disable item
@command_window.draw_item(1, false) # Disable skill
@command_window.draw_item(2, false) # Disable equipment
@command_window.draw_item(3, false) # Disable status
end
if $game_system.save_disabled # If save is forbidden
@command_window.draw_item(4, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # Item
$scene = Scene_Item.new
when 1,2,3 # Skill, equipment, status
start_actor_selection
when 4 # Save
$scene = Scene_File.new(true, false, false)
when 5 # End Game
$scene = Scene_End.new
when 6 # Help
$scene = Scene_Help.new
end
end
end
end
And this is the Help Scene.
#==============================================================================
# ** RPG::State Module
#------------------------------------------------------------------------------
# This module handles state information.
#==============================================================================
module RPG
class State
#--------------------------------------------------------------------------
# * Get State Information
#--------------------------------------------------------------------------
def state_information
# Get Help information
help_text = self.note.scan(/INFO[\s]?(.*?)[\s]?INFO/m).flatten
# If help text array is not empty
if !help_text.empty?
# Split text
help_text = help_text[0].strip!.split(/\r\n/)
end
# Return help text
return help_text
end
end
end
#==============================================================================
# ** Scene_Help
#------------------------------------------------------------------------------
# This class performs the Help screen processing.
#==============================================================================
class Scene_Help < Scene_Base
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
# Line limit per page
PAGE_LINE_LIMIT = 12
# Help Commands
HELP_COMMANDS = [
"Basics",
"Basics2",
"Status",
]
# Status Command Name
STATUS_COMMAND = "Status"
# Status States [States ID]
STATUS_STATES = [1, 2, 3, 4, 5]
# Help Information Hash
HELP_INFORMATION = {
# Command name => Help Header Text, Text information,
"Basics" =>
["These are the basics help text header.",
"Basics:
Here we put information to help the
player."],
"Basics2" =>
["These are the basics help text header.",
"Width Test:
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------"],
"Status" =>
["View status effects information.", ""],
}
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
# Create Help Window
@help_window = Window_Help.new
# Create command Window
@command_window = Window_Command.new(172, HELP_COMMANDS)
@command_window.y = 56
@command_window.height = 360
# Create Help Contents Window
@help_contents_window = Window_Base.new(172, 56, 372, 360)
# Status Command Window
@status_command_window = Window_Command.new(180, make_status_commands)
@status_command_window.x = 172
@status_command_window.y = 56
@status_command_window.height = 360
@status_command_window.visible = false
@status_command_window.active = false
# Status Contents Display
@status_contents_window = Window_Base.new(352, 56, 192, 360)
@status_contents_window.visible = false
# Draw Status Window information
draw_status_window_information
# Viewing Help Information Flag
@viewing_help = false
# Display Page
@display_page = 0
# Current Page
@current_page = 1
# Total Pages
@total_pages = 1
# Current Command
@current_command = active_command
# Update Help Window information
update_help_information
# Draw Help Window Contents
draw_help_window_contents
end
#--------------------------------------------------------------------------
# * Make Status Commands
#--------------------------------------------------------------------------
def make_status_commands
# Commands Array
commands = []
for i in 0...STATUS_STATES.size
# Add State name to commands array
commands << sprintf("%d.%s", i + 1, $data_states[STATUS_STATES[i]].name)
end
# Return commands
return commands
end
#--------------------------------------------------------------------------
# * Get Active Command
#--------------------------------------------------------------------------
def active_command(index = nil)
# Get command
command = index == nil ? @command_window.index : index
return @command_window.commands[command]
end
#--------------------------------------------------------------------------
# * Check if Current Command is a Status Commmand
#--------------------------------------------------------------------------
def status_command?
return STATUS_COMMAND == active_command
end
#--------------------------------------------------------------------------
# * Make Help Commands
#--------------------------------------------------------------------------
def draw_help_window_contents
# Clear Help Contents Window
@help_contents_window.contents.clear
# Return if Help information hash information text is empty
return if HELP_INFORMATION[active_command][1].empty?
# Get Text
text = HELP_INFORMATION[active_command][1].split(/\n/)
# Page Start
start = @display_page * PAGE_LINE_LIMIT
# Page limit
limit = start + PAGE_LINE_LIMIT
@help_contents_window.contents.font.color = @help_contents_window.normal_color
for line in start...limit
# Break if line is nil
break if text[line] == nil
index = line
index %= PAGE_LINE_LIMIT
@help_contents_window.contents.draw_text(0, 0 + index * 25, 340, 24, text[line].strip)
end
# Adjust Total Pages
@total_pages = (text.size.to_f / PAGE_LINE_LIMIT.to_f).ceil
# Draw Pages
@help_contents_window.contents.font.color = @help_contents_window.system_color
@help_contents_window.contents.draw_text(100, 305, 340, 24, "Page:" )
@help_contents_window.contents.font.color = @help_contents_window.normal_color
@help_contents_window.contents.draw_text(160, 305, 150, 24, sprintf("%d / %d", @current_page, @total_pages))
end
#--------------------------------------------------------------------------
# * Draw Status Window Information
#--------------------------------------------------------------------------
def draw_status_window_information
# Get State
state = $data_states[STATUS_STATES[@status_command_window.index]]
# Get State information
info = state.state_information
# Resize Window
@status_contents_window.height = [[60 + info.size * 24, 60].max, 360].min
@status_contents_window.create_contents
# Draw State Icon
@status_contents_window.draw_icon(state.icon_index, 0, 0)
@status_contents_window.contents.draw_text(26, 0, 150, 24, state.name)
for i in 0...info.size
@status_contents_window.contents.draw_text(0, 27 + i * 24, 165, 24, info[i])
end
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
# Dispose of windows
@help_window.dispose
@command_window.dispose
@status_command_window.dispose
@help_contents_window.dispose
@status_contents_window.dispose
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
$scene = Scene_Menu.new(6)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# Update Help Window information
update_help_information
# Update Command Window
@command_window.update
# Update Status Command
@status_command_window.update
# If Status Command Window
if @status_command_window.active
update_status_command
return
end
# If Command Window Active
if @command_window.active
update_command
return
end
# If viewing help information
if @viewing_help
# Update Help Information viewing
update_help_information_viewing
return
end
end
#--------------------------------------------------------------------------
# * Update Status Command
#--------------------------------------------------------------------------
def update_status_command
# If active status command is not the same as the current command
if @status_command_window.index != @current_command
# Draw Status Window Information
draw_status_window_information
# Set Current Command
@current_command = @status_command_window.index
end
if Input.trigger?(Input::B)
# Play cancel SE
Sound.play_cancel
@status_command_window.active = false
@status_command_window.index = 0
@command_window.active = true
# Set Status Window visibility
@status_contents_window.visible = false
return
end
end
#--------------------------------------------------------------------------
# * Update Command
#--------------------------------------------------------------------------
def update_command
# If active command is not the same as current command
if active_command != @current_command
# Set Display Page
@display_page = 0
# Set Current Page
@current_page = @display_page + 1
# Set windows visibility
@help_contents_window.visible = status_command? ? false : true
@status_command_window.visible = status_command? ? true : false
@status_contents_window.visible = false
# Draw Help window contents
draw_help_window_contents
# Set Current Command
@current_command = active_command
end
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
return
end
if Input.trigger?(Input::C)
# Play Decision SE
Sound.play_decision
# If Status Command
if status_command?
@command_window.active = false
@status_command_window.active = true
@current_command = @status_command_window.index
# Set Status Window visibility
@status_contents_window.visible = true
# Draw Status Window Information
draw_status_window_information
return
else
@command_window.active = false
@viewing_help = true
return
end
end
end
#--------------------------------------------------------------------------
# * Update Help Window Information Viewing
#--------------------------------------------------------------------------
def update_help_information_viewing
if Input.trigger?(Input::B)
Sound.play_cancel
@viewing_help = false
@command_window.active = true
return
end
if Input.repeat?(Input::RIGHT) or Input.trigger?(Input::RIGHT)
next_page
end
if Input.repeat?(Input::LEFT) or Input.trigger?(Input::LEFT)
previous_page
end
if Input.repeat?(Input::R)
next_page(true)
end
if Input.repeat?(Input::L)
previous_page(true)
end
end
#--------------------------------------------------------------------------
# * Go to the next page
#--------------------------------------------------------------------------
def next_page(last = false)
# Return if current page is the same or more than the total pages available
return Sound.play_buzzer if @current_page >= @total_pages
# If go to last page is true
if last
# Play cursor SE
Sound.play_cursor
return
end
# Play cursor SE
Sound.play_cursor
# Set Display Page
@display_page += 1
# Set Current Page
@current_page = @display_page + 1
# Draw Help window contents
draw_help_window_contents
end
#--------------------------------------------------------------------------
# * Go to the previous page
#--------------------------------------------------------------------------
def previous_page(first = false)
# Return if current page is the same or less than 0
return Sound.play_buzzer if @current_page <= 1
# If go to first page is true
if first
# Play cursor SE
Sound.play_cursor
# Set Display Page
@display_page = 0
# Set Current Page
@current_page = @display_page + 1
# Draw Help window contents
draw_help_window_contents
return
end
# Play cursor SE
Sound.play_cursor
# Set Display Page
@display_page -= 1
# Set Current Page
@current_page = @display_page + 1
# Draw Help window contents
draw_help_window_contents
end
#--------------------------------------------------------------------------
# * Update Help Window Information
#--------------------------------------------------------------------------
def update_help_information
# If command window is active
if @command_window.active
@help_window.set_text("Select an option for help and information.")
return
end
# If viewing help information
if @viewing_help
@help_window.set_text(HELP_INFORMATION[active_command][0])
return
end
end
end
Normally I pass on making scripts like these due to all the explaining involved. So I'll be as brief as possible and you better know your way around arrays, hashes and constants.
To limit the number of lines that appear per page edit this line:
PAGE_LINE_LIMIT = 12
Change the 12 to whatever number of lines you want it to display per page.
To add help commands/topics edit this constant in the script:
HELP_COMMANDS = ["Command1", "Command2", "Command3", "etc"]
Now this is probably the most complex part of it. The help information.
HELP_INFORMATION = {"Command1" => ["Help Window Header Text",
"Help Info Text"]}
The Key in the hash has to have the same name as one in the help commands array constant.
To set which command will respond as the status command edit this constant in the script:
STATUS_COMMAND = "Name"
And here you set the state ID's that are displayed on the status command.
STATUS_STATES = [ID, ID, ID, ID]
ID = Number of the ID in the database.
And finally for the state information.
Add into the states notebox the following:
INFO
Text here
INFO
Example:
INFO
This is state info-
rmation
TEST
TEST
TEST
INFO
And sorry if the explanation sucks, but I stopped making public scripts because I can't stand explaining complex scripts, so you might have to find someone to explain how the scripts work to you. It's very simple stuff so with enough poking around you might figure it out yourself.
Have a nice day.