Jump to content
Nicke

XS - Menu Delux

Recommended Posts

N0M4D, please edit your posts instead of double posting. (The edit button is located to the left of the "Quote" buttons in your posts)

Share this post


Link to post
Share on other sites

You really should add resolution constants: CURRENT_RESOLUTION_WIDTH = (whatever they want) and CURRENT_RESOLUTION_HEIGHT = (whatever they want). Since I use 640x416 (I believe?), you could then base all the windows creation off of these variables.

 

example, you want left side to be 25%, mid to be 50% and right side to be 25%, you just calculate based on those constants. You could, optionally, add options to change the widths' percentages, too, expanding the script moreso.

 

I am going to look into using this as I sketched up a very similar design. Maybe I'll even patch it and post the code, if you don't mind. :)

 

EDIT: I found an issue with your description in your initial post: You do NOT include a link to the default background image.

 

Additionally, on that note, you also do not provide any instructions on how to create your own background image--or at least what you are expecting for a background image. This also applies to the fogs.

 

These changes would also be welcomed.

:END EDIT:

Edited by Iyce

Share this post


Link to post
Share on other sites

@lyce: Yes, there are of course better way of drawing the windows and I should really make a patch so it supports any resolution. Good point! I will clean up the code and add a few more instructions when I got the time. :)

Share this post


Link to post
Share on other sites

Sounds good, Niclas. Thank you for the basis of an amazing in-game menu. I look forward to expanding all my menu scenes into this kind of style.

Share this post


Link to post
Share on other sites

I have a little problem... So when you choose a command that works on separate party members (such as skills, equip, status), it simply goes directly to the leading member's window the actor it was last "on".

 

Is there a way to allow you to choose which actor to start it up on?

I know you can press L or R (Q/W) to switch between actors, but sometimes it's better to keep the simplicity and usability for players, don't you think?

Edited by Anderson88

Share this post


Link to post
Share on other sites

Hi. All I've tried to do is put your core script and menu delux script in but I keep getting an error :c I tried it on a blank project and got the same error so I know it's not a compatibility issue with other scripts I have. I have placed the menu example images in system. What have I done wrong?

jk8ok.png

Share this post


Link to post
Share on other sites

Please use the latest Core Script and put it above this script.

Share this post


Link to post
Share on other sites
Please use the latest Core Script and put it above this script.

Thanks (: I remember I googled your core script instead of taking it from the link in your post. I guess I must've downloaded an older version from someone else.  This time I took from your original post and it worked. You have a lot of really awesome scripts and I appreciate you allow for commercial use. Thank you very much Nicke. Keep up the awesome work ^^

Share this post


Link to post
Share on other sites

Hi again. Really really sorry to bother you once more. I'm trying to add a menu command that was created by another script (Emerald Skill Trees Ace). I the menu list I put it as ":talents   => ["", "Return to title.", 4133, true, true],". It wasn't the last menu command, so the comma is definitely meant to be at the end. I wasn't too sure what the second true did (I believe for personal, which I don't know what that means). I tried it as false too but similar result.  Sorry I'm being so noob, but please help :( Here is the error image. If it helps, what I've done for your script and the emerald skill trees script is below.

lWC6I.png

 

Menu Delux:

 

 

#==============================================================================
# XaiL System - Menu Delux
# Author: Nicke
# Created: 20/11/2012
# Edited: 28/11/2012
# Version: 1.0d
#==============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#==============================================================================
# Requires: XS - Core Script.
#==============================================================================
#
# This script changes the way the menu scene works. Not compatible with
# XS - Menu or XS - Icon Menu.
#
# Instructions are in the settings module below. Make sure you read through
# everything so you understand each section.
#
# *** Only for RPG Maker VX Ace. ***
#==============================================================================
($imported ||= {})["XAIL-XS-MENU_DELUX"] = true

module XAIL
module MENU_DELUX
#--------------------------------------------------------------------------#
# * Settings
#--------------------------------------------------------------------------#
# MENU_FONT:
# MENU_FONT = [name, size, color, bold, shadow]
MENU_FONT = [["Calibri", "Verdana"], 18, Color.new(255,255,255), true, true]

# MENU_WINDOW:
# MENU_WINDOW [x, y, z, opacity]
MENU_WINDOW = [-12, -12, 200, 0]

# STATUS_WINDOW:
# STATUS_WINDOW [x, y, z, opacity]
STATUS_WINDOW = [142, -4, 200, 0]

# DETAILS_WINDOW:
# DETAILS_WINDOW [x, y, z, opacity]
DETAILS_WINDOW = [380, -10, 200, 0]

# PLAYTIME_WINDOW:
# PLAYTIME_WINDOW [x, y, z, opacity, icon, enabled]
PLAYTIME_WINDOW = [430, 348, 200, 0, 280, true]

# HELP_WINDOW:
# Setup help window.
# HELP = [x, y, z, opacity, enabled]
HELP_WINDOW = [-6, 352, 200, 0, true]

# MENU_ALIGNMENT:
# MENU_ALIGNMENT = 0 (left), 1 (center), 2 (right)
MENU_ALIGNMENT = 0 # Default: 2.

# MENU_SKIN:
# The windowskin to use for the windows.
# Set to nil to disable.
# MENU_SKIN = string
MENU_SKIN = nil

# MENU_LIST:
# name, icon_index and custom are optional.
# If name is empty it will use the corresponding symbol as name instead.
# To make a command a common event you need to set custom to the common event
# id you want to run as seen below.
# symbol => [name, description, icon_index, enabled, personal, custom]
MENU_LIST = {
:item => ["", "Browse through your acquired items.", 4148, true, false],
:equip => ["Equipment", "Change your equipment.", 4145, true, true],
:skill => ["Spells", "Manage your available skills.", 4147, true, true],
:status => ["Stats", "See the current status of the hero.", 4136, true, true],
:formation => ["", "Change the formation of the party.", 4134, true, false],
:save => ["", "Record your progress.", 4139, true, false],
:load => ["", "Load your saved progress.", 4165, true, false, Scene_Load],
:game_end => ["Quit", "Exit the program.", 4162, true, false],
:title => ["", "Return to title.", 4133, true, false, Scene_Title],
:talents => ["", "Return to title.", 4133, true, true],
:event_1 => ["Camping", "Run common event camping.", 728, true, false, 1]
} # Don't remove this line!

# MENU_SAVE = true/false
# Override enabled option for save (so you can change it ingame).
MENU_SAVE = true

# If MENU_CUSTOM is true you will have to add the commands yourself
# ingame, which can be useful for certain quest related stuff or if you
# want to enable/disable menu commands.
# To add/remove a command ingame follow these instructions:
#
# In a script call do like this:
# menu_scene(key, type)
# menu_scene(:item,:add) # To add item to menu list.
# menu_scene(:item,:del) # To remove item from menu list.
#
# In a conditional branch you can check if a menu command is
# enabled/disabled:
# menu_active?(key)
# menu_active?(:item) # Check if item is enabled.
# !menu_active?(:item) # Check if item is disabled.
#
# To set a id to be enabled do like this:
# menu_active(:skill, true) # Set menu skill to be enabled.
#
# To add/remove all available menu commands use one of the
# following methods in a script call:
# menu_add_all
# menu_del_all
#
# MENU_CUSTOM = true/false
MENU_CUSTOM = false

# The text to be displayed if no menu items is available.
# Only used if MENU_CUSTOM is true.
# MENU_EMPTY = string
EMPTY = "Menu is not available at this point..."

# MENU_MUSIC:
# Set the music to be played at the menu scene.
# This is optional.
# MUSIC = true/false
MUSIC = true
# MUSIC_BGM = [name, volume, pitch]
MUSIC_BGM = ["Theme4", 70, 100]
# MUSIC_BGS = [name, volume, pitch]
MUSIC_BGS = ["Darkness", 50, 100]

# ANIM_LIST:
# A list of animation images.
# name => [z, zoom_x, zoom_y, blend_type, opacity]
ANIM_LIST = {
"Menu_Fog1" => [1, 1.2, 1.2, 1, 125],
"Menu_Fog2" => [1, 1.8, 1.8, 1, 155]
} # Don't remove this line!

# BACKGROUND:
# name => [x, y, z, opacity]
BACKGROUND = {
"Menu_Back" => [0, 0, 4, 255]
} # Don't remove this line!

# BAR_COLOR = rgba(255,255,255,255)
# Set the color of the gauges.
BAR_HP = [Color.new(205,50,50,65), Color.new(235,75,75,185)]
BAR_MP = [Color.new(50,50,205,65), Color.new(75,75,235,185)]
BAR_TP = [Color.new(50,205,50,65), Color.new(75,235,75,185)]

# DETAILS:
# Setup details here. (Recommended to use the default ones since you will
# need a bit RGSS knowledge to add more.)
def self.details
["#{Vocab::currency_unit}: #{$game_party.gold}",
"Steps: #{$game_party.steps}",
"Collected Items: #{$game_party.all_items.size}",
"Map: #{$game_map.name}",
"Leader: #{$game_party.leader.name}",
"Battle count: #{$game_system.battle_count}",
"Save count: #{$game_system.save_count}",
"Variable I: #{$game_variables[1]}",
"Variable II: #{$game_variables[2]}"]
end

# DETAILS_ICONS:
# DETAILS_ICONS[id] = icon_id
# Set the details icon_id. (optional)
# Should be in the same order as details.
# Use nil to disable a icon.
DETAILS_ICONS = []
DETAILS_ICONS[0] = 2114 # GOLD
DETAILS_ICONS[1] = 172 # STEPS
DETAILS_ICONS[2] = 270 # ITEMS
DETAILS_ICONS[3] = 232 # MAP
DETAILS_ICONS[4] = 4425 # LEADER
DETAILS_ICONS[5] = 115 # BATTLE COUNT
DETAILS_ICONS[6] = 224 # SAVE COUNT
DETAILS_ICONS[7] = nil # VAR 1
DETAILS_ICONS[8] = nil # VAR 2

# Transition, nil to use default.
# TRANSITION [speed, transition, opacity]
TRANSITION = nil

end
end
# *** Don't edit below unless you know what you are doing. ***
#==============================================================================#
# ** Error Handler
#==============================================================================#
unless $imported["XAIL-XS-CORE"]
# // Error handler when XS - Core is not installed.
msg = "The script %s requires the latest version of XS - Core in order to function properly."
name = "XS - Menu Delux"
msgbox(sprintf(msg, name))
exit
end
#==============================================================================#
# ** Game_System
#==============================================================================#
class Game_System

attr_accessor :menu_list

alias xail_menu_delux_gm_sys_initialize initialize
def initialize(*args, &block)
# // Method to initialize game system.
xail_menu_delux_gm_sys_initialize(*args, &block)
@menu_list = {}
end

def get_menu
# // Method to get the menu list.
XAIL::MENU_DELUX::MENU_CUSTOM ? @menu_list : XAIL::MENU_DELUX::MENU_LIST
end

end
#==============================================================================#
# ** Game_Interpreter
#==============================================================================#
class Game_Interpreter

def menu_scene(key, type = :add)
# // Method to add/remove a menu item to the list.
case type
when :add # // Add menu id.
unless $game_system.menu_list.include?(XAIL::MENU_DELUX::MENU_LIST[key])
$game_system.menu_list[key] = XAIL::MENU_DELUX::MENU_LIST[key]
end unless XAIL::MENU_DELUX::MENU_LIST[key].nil?
when :del # // Remove menu id.
unless XAIL::MENU_DELUX::MENU_LIST[key].nil?
$game_system.menu_list.delete(key)
end
end
end

def menu_active?(key)
# // Method to check if menu key is enabled.
# This will return nil if menu item not added in the list.
return $game_system.menu_list[key][3] rescue nil
end

def menu_active(key, enabled)
# // Method to enable id.
$game_system.menu_list[id][3] = enabled
end

def menu_add_all
# // Method to add all available menu items.
XAIL::MENU_DELUX::MENU_LIST.each {|key| menu_scene(key) }
end

def menu_del_all
# // Method to remove all available menu items.
XAIL::MENU_DELUX::MENU_LIST.each {|key| menu_scene(key, :del) }
end

end
#==============================================================================#
# ** Game_Map
#==============================================================================#
class Game_Map

attr_reader :name

alias xail_menu_delux_setup setup
def setup(map_id)
# // Method to setup the map id.
xail_menu_delux_setup(map_id)
@name = $data_mapinfos[@map_id].name
end

end
#==============================================================================
# ** Window_MenuCommand
#==============================================================================
class Window_MenuCommand < Window_Command

def window_width
# // Method to return the width of MENU_WINDOW.
return 170
end

def alignment
# // Method to return the alignment.
return XAIL::MENU_DELUX::MENU_ALIGNMENT
end

def menu_color(color, enabled = true)
# // Method to set the color and alpha if not enabled.
contents.font.color.set(color)
contents.font.color.alpha = Colors::AlphaMenu unless enabled
end

def item_rect_for_text(index)
# // Method to draw item rect for text.
rect = item_rect(index)
contents.fill_rect(rect.x, rect.y, contents_width, contents_height, Color.new(0,0,0,60))
rect.x += 24
rect.width -= 8
draw_icon(XAIL::MENU_DELUX::MENU_LIST.values[index][2], -2, rect.y) unless XAIL::MENU_DELUX::MENU_LIST.values[index][2].nil?
rect
end

def draw_item(index)
# // Method to draw the command item.
contents.font.name = XAIL::MENU_DELUX::MENU_FONT[0]
contents.font.size = XAIL::MENU_DELUX::MENU_FONT[1]
# // Save option.
XAIL::MENU_DELUX::MENU_LIST[:save][3] = save_enabled if XAIL::MENU_DELUX::MENU_SAVE
menu_color(XAIL::MENU_DELUX::MENU_FONT[2], menu_enabled?(index))
# // Font settings
contents.font.bold = XAIL::MENU_DELUX::MENU_FONT[3]
contents.font.shadow = XAIL::MENU_DELUX::MENU_FONT[4]
draw_text(item_rect_for_text(index), command_name(index), alignment)
reset_font_settings
end

def menu_enabled?(index)
# // Method to check if menu item is enabled.
return $game_system.get_menu.values[index][3]
end

def make_command_list
# // Method to add the commands.
$game_system.get_menu.each {|key, value|
name = value[0] == "" ? key.id2name.capitalize : value[0]
XAIL::MENU_DELUX::MENU_LIST[:save][3] = save_enabled if XAIL::MENU_DELUX::MENU_SAVE
add_command(name, key, value[3], value[5].nil? ? nil : value[5])
}
end

end
#==============================================================================
# ** Window_MenuStatus
#==============================================================================
class Window_MenuStatus < Window_Selectable

def window_width
# // Method to determine window width.
return 250
end

def window_height
# // Method to determine window height.
return Graphics.height
end

def standard_padding
# // Method to determine standard padding.
return 4
end

def col_max
# // Method to determine col max.
return 2
end

def spacing
# // Method to determine spacing.
return 30
end

def item_width
# // Method to determine item width.
return 98
end

def item_height
# // Method to determine item height.
return 128
end

def refresh
# // Method to refresh the window.
contents.clear
draw_background
draw_all_items
end

def draw_background
# // Method to draw background.
contents.fill_rect(0, 0, contents_width, contents_height, Color.new(0,0,0,60))
end

def draw_item(index)
# // Method to draw item.
actor = $game_party.members[index]
rect = item_rect(index)
draw_item_background(index)
# // Face
draw_actor_face(actor, rect.x + 1, rect.y + 1, true)
# // Name
draw_font_text(actor.name, rect.x + 4, rect.y, rect.width, 0, XAIL::MENU_DELUX::MENU_FONT[0], 20, XAIL::MENU_DELUX::MENU_FONT[2])
# // Level
lvl = "#{Vocab::level_a} #{actor.level}"
draw_font_text(lvl, rect.x + 4, rect.y + 64, rect.width, 0, XAIL::MENU_DELUX::MENU_FONT[0], 16, XAIL::MENU_DELUX::MENU_FONT[2])
# // Class
draw_font_text(actor.class.name, rect.x - 4, rect.y + 76, rect.width, 2, XAIL::MENU_DELUX::MENU_FONT[0], 16, XAIL::MENU_DELUX::MENU_FONT[2])
# // Stats
draw_menu_stats(actor, :hp, rect.x, rect.y + 90, XAIL::MENU_DELUX::BAR_HP[0], XAIL::MENU_DELUX::BAR_HP[1], rect.width - 2)
draw_menu_stats(actor, :mp, rect.x, rect.y + 100, XAIL::MENU_DELUX::BAR_MP[0], XAIL::MENU_DELUX::BAR_MP[1], rect.width - 2)
draw_menu_stats(actor, :tp, rect.x, rect.y + 110, XAIL::MENU_DELUX::BAR_TP[0], XAIL::MENU_DELUX::BAR_TP[1], rect.width - 2)
end

def draw_menu_stats(actor, stat, x, y, color1, color2, width)
# // Method to draw actor hp & mp.
case stat
when :hp
rate = actor.hp_rate ; vocab = Vocab::hp_a ; values = [actor.hp, actor.mhp]
when :mp
rate = actor.mp_rate ; vocab = Vocab::mp_a ; values = [actor.mp, actor.mmp]
when :tp
rate = actor.tp_rate ; vocab = Vocab::tp_a ; values = [actor.tp, actor.max_tp]
end
contents.font.name = XAIL::MENU_DELUX::MENU_FONT[0]
contents.font.size = 14 # // Override font size.
contents.font.color = XAIL::MENU_DELUX::MENU_FONT[2]
contents.font.bold = XAIL::MENU_DELUX::MENU_FONT[3]
contents.font.shadow = XAIL::MENU_DELUX::MENU_FONT[4]
# // Draw guage.
draw_gauge_ex(x, y - 8, width, 8, rate, color1, color2)
# // Draw stats.
draw_text(x + 1, y, width, line_height, values[0], 0)
draw_text(x - 1, y, width, line_height, values[1], 2)
# // Draw vocab.
draw_text(x, y, width, line_height, vocab, 1)
reset_font_settings
end

end
#==============================================================================
# ** Window_Menu_Details
#==============================================================================
class Window_Menu_Details < Window_Base

def initialize(x, y)
# // Method to initialize.
super(x, y, window_width, fitting_height(XAIL::MENU_DELUX.details.size) + 6)
@leader = $game_party.leader
refresh
end

def standard_padding
# // Method to determine standard padding.
return 8
end

def window_width
# // Method to determine window width.
return 172
end

def refresh
# // Method to refresh the window.
contents.clear
# // Draw background.
draw_background
# // Draw details.
y = -10
XAIL::MENU_DELUX.details.each_index {|i|
draw_line_ex(0, y+=24, Color.new(255,255,255,32), Color.new(0,0,0,64))
draw_font_text(XAIL::MENU_DELUX.details[i], -4, line_height * i + 4, contents_width, 2, XAIL::MENU_DELUX::MENU_FONT[0], 16, XAIL::MENU_DELUX::MENU_FONT[2])
}
# // Draw icons.
draw_icons(XAIL::MENU_DELUX::DETAILS_ICONS, :vertical, 2, line_height * 0 + 2)
end

def draw_background
# // Method to draw background.
contents.fill_rect(0, 0, contents_width, contents_height, Color.new(0,0,0,60))
end

def update
# // Method to update details window.
super
if @leader != $game_party.leader
@leader = $game_party.leader
refresh
end
end

end
#==============================================================================
# ** Window_Menu_Playtime
#==============================================================================
class Window_Menu_Playtime < Window_Base

def initialize(x, y)
# // Method to initialize.
super(x, y, 120, fitting_height(1))
@playtime = $game_system.playtime_s
refresh
end

def refresh
# // Method to refresh the window.
contents.clear
# // Draw icon.
draw_icon(XAIL::MENU_DELUX::PLAYTIME_WINDOW[4], 4, 0)
# // Draw playtime.
draw_font_text(@playtime, 0, 6, contents_width, 2, XAIL::MENU_DELUX::MENU_FONT[0], 22, XAIL::MENU_DELUX::MENU_FONT[2])
end

def update
# // Method to update the window.
super
@playtime = $game_system.playtime_s
refresh
end

end
#==============================================================================#
# ** Window_Menu_Help
#==============================================================================#
class Window_Menu_Help < Window_Help

attr_accessor :index

alias xail_icon_menu_winhelp_init initialize
def initialize(*args, &block)
# // Method to initialize help window.
xail_icon_menu_winhelp_init(*args, &block)
@index = 0
end

def set_text(text, enabled)
# // Method to set a new help text.
if text != @text
menu_color(XAIL::MENU_DELUX::MENU_FONT[2], enabled)
@text = text
refresh
end
end

def refresh
# // Refresh help contents.
contents.clear
draw_help_text
end

def draw_help_text
# // Method to draw the help text.
contents.font.name = XAIL::MENU_DELUX::MENU_FONT[0]
contents.font.size = XAIL::MENU_DELUX::MENU_FONT[1]
menu_color(XAIL::MENU_DELUX::MENU_FONT[2], menu_enabled?(@index))
contents.font.bold = XAIL::MENU_DELUX::MENU_FONT[3]
contents.font.shadow = XAIL::MENU_DELUX::MENU_FONT[4]
# // Draw title and description for the menu.
draw_line_ex(0, 14, Color.new(255,255,255,128), Color.new(0,0,0,200))
draw_text_ex_no_reset(0, 0, @text)
reset_font_settings
end

def menu_enabled?(index)
# // Method to check if menu item is enabled.
return $game_system.get_menu.values[index][3]
end

def menu_color(color, enabled = true)
# // Method to set the color and alpha if not enabled.
contents.font.color.set(color)
contents.font.color.alpha = 150 unless enabled
end

end
#==============================================================================#
# ** Scene_MenuBase
#==============================================================================#
class Scene_MenuBase < Scene_Base

def start
# // Method to start the scene.
super
@actor = $game_party.menu_actor
if SceneManager.scene_is?(Scene_Menu)
@backgrounds = []
@animations = []
create_menu_backgrounds
create_menu_animations
end
end

def create_menu_backgrounds
# // Method to create custom background(s).
XAIL::MENU_DELUX::BACKGROUND.each {|key, value| @backgrounds << [sprite.new, key] }
@backgrounds.each {|i|
i[0].bitmap = Cache.system(i[1])
i[0].x = XAIL::MENU_DELUX::BACKGROUND[i[1]][0]
i[0].y = XAIL::MENU_DELUX::BACKGROUND[i[1]][1]
i[0].z = XAIL::MENU_DELUX::BACKGROUND[i[1]][2]
i[0].opacity = XAIL::MENU_DELUX::BACKGROUND[i[1]][3]
}
end

def create_menu_animations
# // Method to create custom animation(s).
# name => [z, zoom_x, zoom_y, blend_type, opacity]
XAIL::MENU_DELUX::ANIM_LIST.each {|key, value| @animations.push << [Plane.new, key] }
@animations.each {|i|
i[0].bitmap = Cache.system(i[1])
i[0].z = XAIL::MENU_DELUX::ANIM_LIST[i[1]][0]
i[0].zoom_x = XAIL::MENU_DELUX::ANIM_LIST[i[1]][1]
i[0].zoom_y = XAIL::MENU_DELUX::ANIM_LIST[i[1]][2]
i[0].blend_type = XAIL::MENU_DELUX::ANIM_LIST[i[1]][3]
i[0].opacity = XAIL::MENU_DELUX::ANIM_LIST[i[1]][4]
}
end

alias xail_upd_menubase_delux_upd update
def update(*args, &block)
# // Method for updating the scene.
xail_upd_menubase_delux_upd(*args, &block)
if SceneManager.scene_is?(Scene_Menu)
for i in 0...@animations.size
@animations[i][0].ox += 1.2 - i
@animations[i][0].oy -= 0.6 + i
end unless scene_changing?
delay?(1)
end
end

def delay?(amount)
# // Method to delay.
amount.times do
update_basic
end
end

alias xail_menubase_delux_transition perform_transition
def perform_transition(*args, &block)
# // Method to create the transition.
return if $game_system.get_menu.empty?
if XAIL::MENU_DELUX::TRANSITION.nil?
xail_menubase_delux_transition(*args, &block)
else
Graphics.transition(XAIL::MENU_DELUX::TRANSITION[0],XAIL::MENU_DELUX::TRANSITION[1],XAIL::MENU_DELUX::TRANSITION[2])
end
end

def dispose_sprites
# // Method to dispose sprites.
@backgrounds.each {|i| i[0].dispose unless i[0].nil? ; i[0] = nil } rescue nil
@animations.each {|i| i[0].dispose unless i[0].nil? ; i[0] = nil } rescue nil
end

def terminate
# // Method to terminate.
super
dispose_sprites unless SceneManager.scene_is?(Scene_Menu)
end

end
#==============================================================================#
# ** Scene_Menu
#==============================================================================#
class Scene_Menu < Scene_MenuBase

def start
super
# // Method to start the scene.
# // Return if menu empty.
return command_map if $game_system.get_menu.empty?
# // Create windows.
create_menu_command_window
create_menu_status_window
create_menu_details_window
create_menu_playtime_window if XAIL::MENU_DELUX::PLAYTIME_WINDOW[5]
if XAIL::MENU_DELUX::HELP_WINDOW[4]
create_menu_help_window
help_update(@command_window.index)
end
# // Play music if enabled.
play_menu_music if XAIL::MENU_DELUX::MUSIC
end

def create_menu_command_window
# // Method to create the command window.
@command_window = Window_MenuCommand.new
@command_window.windowskin = Cache.system(XAIL::MENU_DELUX::MENU_SKIN) unless XAIL::MENU_DELUX::MENU_SKIN.nil?
@command_window.x = XAIL::MENU_DELUX::MENU_WINDOW[0]
@command_window.y = XAIL::MENU_DELUX::MENU_WINDOW[1]
@command_window.z = XAIL::MENU_DELUX::MENU_WINDOW[2]
@command_window.opacity = XAIL::MENU_DELUX::MENU_WINDOW[3]
$game_system.get_menu.each {|key, value|
unless value[5].nil?
@command_window.set_handler(key, method(:command_custom))
else
if value[4]
@command_window.set_handler(key, method(:command_personal))
else
@command_window.set_handler(key, method("command_#{key}".to_sym))
end
end
}
@command_window.set_handler(:cancel, method(:return_scene))
end

def create_menu_status_window
# // Method to create the status window.
x = XAIL::MENU_DELUX::STATUS_WINDOW[0]
y = XAIL::MENU_DELUX::STATUS_WINDOW[1]
@status_window = Window_MenuStatus.new(x, y)
@status_window.z = XAIL::MENU_DELUX::STATUS_WINDOW[2]
@status_window.opacity = XAIL::MENU_DELUX::STATUS_WINDOW[3]
end

def create_menu_details_window
# // Method to create the details window.
x = XAIL::MENU_DELUX::DETAILS_WINDOW[0]
y = XAIL::MENU_DELUX::DETAILS_WINDOW[1]
@details_window = Window_Menu_Details.new(x, y)
@details_window.z = XAIL::MENU_DELUX::DETAILS_WINDOW[2]
@details_window.opacity = XAIL::MENU_DELUX::DETAILS_WINDOW[3]
end

def create_menu_playtime_window
# // Method to create the playtime window.
x = XAIL::MENU_DELUX::PLAYTIME_WINDOW[0]
y = XAIL::MENU_DELUX::PLAYTIME_WINDOW[1]
@playtime_window = Window_Menu_Playtime.new(x, y)
@playtime_window.z = XAIL::MENU_DELUX::PLAYTIME_WINDOW[2]
@playtime_window.opacity = XAIL::MENU_DELUX::PLAYTIME_WINDOW[3]
end

def create_menu_help_window
# // Method to create the help window.
@help_window = Window_Menu_Help.new(2)
@help_window.viewport = @viewport
@help_window.windowskin = Cache.system(XAIL::MENU_DELUX::MENU_SKIN) unless XAIL::MENU_DELUX::MENU_SKIN.nil?
@help_window.index = @command_window.index
@help_window.x = XAIL::MENU_DELUX::HELP_WINDOW[0]
@help_window.y = XAIL::MENU_DELUX::HELP_WINDOW[1]
@help_window.z = XAIL::MENU_DELUX::HELP_WINDOW[2]
@help_window.opacity = XAIL::MENU_DELUX::HELP_WINDOW[3]
end

def play_menu_music
# // Method to play menu music.
@last_bgm = RPG::BGM.last
@last_bgs = RPG::BGS.last
bgm = XAIL::MENU_DELUX::MUSIC_BGM
bgs = XAIL::MENU_DELUX::MUSIC_BGS
Sound.play(bgm[0], bgm[1], bgm[2], :bgm)
Sound.play(bgs[0], bgs[1], bgs[2], :bgs)
end

alias xail_upd_menu_delux_upd update
def update(*args, &block)
# // Method for updating the scene.
xail_upd_menu_delux_upd(*args, &block)
if XAIL::MENU_DELUX::HELP_WINDOW[4]
old_index = @help_window.index
if old_index != @command_window.index
help_update(@command_window.index)
end
end
end

def help_update(index)
# // If index changes update help window text.
list = XAIL::MENU_DELUX::MENU_LIST
icon = list.values[index][2].nil? ? "" : list.values[index][2]
name = list.values[index][0] == "" ? list.keys[index].id2name.capitalize : list.values[index][0]
if icon == "" ; title = name ; else ; title = '\i[' + icon.to_s + ']' + name ; end
desc = '\c[0]' + list.values[index][1]
text = "#{title}\n#{desc}"
enabled = list.values[index][3]
@help_window.index = index
@help_window.set_text(text, enabled)
end

def on_personal_ok
# // Method override on personal ok.
scene = "Scene_#{@command_window.current_symbol.to_s.capitalize}".to_class
SceneManager.call(scene)
end

def command_custom
# // Method to call a custom command. (Don't remove)
if @command_window.current_ext.is_a?(Integer)
$game_temp.reserve_common_event(@command_window.current_ext)
return command_map
end
SceneManager.call(@command_window.current_ext)
end

def command_map
# // command_map (Don't remove)
if $game_system.get_menu.empty?
Sound.play_buzzer
$game_message.texts << XAIL::MENU_DELUX::EMPTY
end
SceneManager.call(Scene_Map)
end

def pre_terminate
# // Method to pre terminate scene menu.
# // Play last bgm and bgs if menu music is enabled.
if XAIL::MENU_DELUX::MUSIC
@last_bgm.replay rescue nil
@last_bgs.replay rescue nil
end
end

end # END OF FILE

#=*==========================================================================*=#
# ** END OF FILE
#=*==========================================================================*=#

 

 

 

Emerald Skill Trees Ace:

 

#============================================================================

# Skill Trees Ace v1.4c
# By Emerald
# HEAVILY inspired by Basic(?) - Skill Trees of Awesome by Leongon
#----------------------------------------------------------------------------
# You're free to use the script for any game, as long as you give credits
#----------------------------------------------------------------------------
# Version History
# 0.5 -> Started the script. Added all basic functions. However, as of now
# requirements aren't shown in the info window.
# 0.6 -> Bug fixes for leveling skills and information window.
# 0.6b-> Yet another bugfix.
# 1.0 -> Added more customization on how to display skill levels on their icons.
# Also added an option which, if the menu command is used, allows you to
# select an actor first.
# 1.0b-> Small glitch fixed regarding switching between actors.
# 1.0c-> 'nother small glitch fixed regarding switching between actors. Also
# fixed a mistake made in previous version.
# 1.0d-> Changed something regarding forgetting previously learned skills, to
# avoid problems.
# 1.1a-> Bugfix time. Solved a few issues.
# 1.1b-> Bugfix patch #2. Possible first version without window bugs...
# 1.1c-> Bugfix patch #3. Fixed a slight problem with the requirements.
# 1.1d-> Bugfix patch #4. Fixed another slight problem with the requirements.
# 1.1e-> Bugfix patch #5. Fixed yet another problem with the requirements and
# also made the skill tree selection box disappear as soon as the scene
# starts.
# 1.2a-> Changed how almost all the methods in Game_Actor where structured.
# Removed some "skills with 1 level" issues in the process. Also split
# skill learning up in 3 categories, changeable with LEARN_MODE.
# Removed a few tree skill reset related bugs too.
# 1.2b-> Small typo fix. Also fixed an issue with leveling skills in LEARN_MODE
# 1 and 2 in which an already learnt skill would accidentally be forgotten.
# 1.2c-> Fixed an issues in which an wrong actor learned the selected skill and
# used up his/her points and an issue where the skill trees selection
# window would be activated while the skill tree window should be active.
# 1.3 -> Added an option to make trees based on class ID instead of actor ID.
# 1.4a-> Made fixes for the standard config, a deleted portion of the script,
# switching between actors and the trees selection window. Also added
# the requirements to the standard info window.
# 1.4b-> Small bugfix for cursor input.
# 1.4c-> Added TP cost display. Also solved a small bug regarding switch
# requirements display. Also fixed a small bug with actor IDs.
#----------------------------------------------------------------------------
# This is a script which I felt very needed for games where character
# customization is important. Note that this is a pretty hard to use script,
# so read the instructions thoroughly!
#
# INSTRUCTIONS:
#
# Just as always, put this script between ¥ Materials and ¥ Main.... If we
# scripters just got a penny for everytime we say this...
#
# The rest of the instructions are seperated in different sections. Read them
# thoroughly!!
#
# 1. Standard Module Constants
# 2. Tree Points Table
# 3. Objects
# 4. Trees
# 5. Trees Per Actor
# 6. Script Calls and others
#
# Information for the information window can be found at the bottom of the
# configurations!
#----------------------------------------------------------------------------
# SECTION 1 / STANDARD MODULE CONSTANTS
#----------------------------------------------------------------------------
# USE_MENU_COMMAND / If set to true, a command in the menu will appear which
# links you to the Skill Trees scene.
#
# MENU_VOCAB / Name of the menu command. Only use if USE_MENU_COMMAND is true.
#
#
# The following five constants are only used in the standard information
# window:
# TREE_POINTS_VOCAB / Name of the points which you can use to level skills.
#
# MP_COST_VOCAB / Name of the MP Cost of the skill.
#
# CURRENT_TREE_POINTS_VOCAB / The part of text that comes before the name of
# the current tree. Together, they form the name for the points invested in the
# current tree.
#
# SKILL_LEVEL_VOCAB / Name of the skill levels.
#
# REQUIREMENTS_VOCAB / Title of the requirements block.
# See REQUIREMENTS VARIABLES as the bottom of the instructions for more info
# about the requirements.
#
# LEVEL_DISPLAY_TYPE / How the levels of the skills are displayed on their icons.
# 0 = No display.
# 1 = Current level only.
# 2 = Current level and max level.
#
#
# The following constants deal with getting points at level up:
# TABLE_TREE_POINTS / Gain points according to a table. See Tree Points Table
# for more info.
#
# INDIVIDUAL_LEVEL_POINTS / Do the actors gain individual amounts of Tree Points
# on level up, yes or no. Doesn't apply for TABLE_TREE_POINTS.
#
# TREE_POINTS_PER_LEVEL / Amount of Tree Point received on level up. Make it an
# array ( [] ) with the amounts according to actor IDs if INDIVIDUAL_LEVEL_POINTS
# is true. NOTE THAT the first element is for actor ID 0, NOT 1!!!
#
# REMOVE_POINTS_ON_LEVEL_DOWN / If set to true, points will be removed from the
# current amount of Tree Points if the actor's level goes down. BEST USED IN
# COMBINATION WITH RESETS!!
#
# LEARN_MODE / Affects how you can gain skill levels. If 0, you must have learned
# the skill by putting a point in it in the same tree. If 1, you must have learned
# the skill by putting a point in it in any tree. If 2, you can also have learned
# the skill outside of skill trees.
#
# ACTOR_OR_CLASSES / Affects if trees are based on actors or on classes. 0 for
# actors, 1 for classes. NOTE THAT, if you change it to classes, Trees_Per_Actor
# don't work on actor_ids, but on class_ids. Also note that if an actor changes
# class, you could best use a reset to make sure the player has all the points
# back and hasn't learned skills which aren't in the new trees. Ask for help
# if you don't know where to use the reset.
#
#----------------------------------------------------------------------------
# SECTION 2 / TREE_POINTS_TABLE
#----------------------------------------------------------------------------
# This section contains tables with points which actors gain on level up if
# TABLE_TREE_POINTS is set to true.
#
# The table 0 => [...] is for every actor WITHOUT an individual table. Else,
# the key (key => [...]) should be equal to the actor_id.
#
# The values within the table are the amount of tree points gained for every
# NEXT LEVEL!! So the first amount is gained upon reaching level 2, the second
# amount upon reaching level 3 etc.
#
#----------------------------------------------------------------------------
# SECTION 3 / OBJECTS
#----------------------------------------------------------------------------
# Probably the hardest one...
# In this section, you create the objects that make up a tree. These can be
# either skills, or 'arrows'. Arrows are just icons which will be grayed out
# if their child skill is unavailable.
#
# Syntax:
# ARROWS
# Identifier => ["arrow_object", icon_index, child_skill]
# Identifier = a 'name' to easily identify the object. It is used to build trees
# in the next section, and therefore must be unique. However, it can be whatever
# you want it to be. Even an array.
#
# "arrow_object" = the type of the object. Must be exactly "arrow_object" if you
# want to make it an ARROW OBJECT.
#
# icon_index = INDEX of the ICON that is used by the object.
#
# child_skill = SKILL OBJECT which determines if this arrow should be GRAYED OUT
# or NOT. Use the identifier of the SKILL OBJECT as value for this one. Note that
# required amount of points doesn't count! (at least, not the first one)
#
#
# SKILLS
# Identifier => ["skill_object", [skill_1, skill_2, etc...], [requirements_first_skill], [requirements_second_skill], etc.....]
# Identifier = exact same as for the ARROW OBJECTS.
#
# "skill_object" = exact same as "arrow_object", but identifies SKILL OBJECTS.
#
# skill_1, 2, etc... = the IDs of the SKILLS at this object's different LEVELS.
# can be as many as you want. Icon will be taken from the skill, and is grayed
# out if requirements don't apply (except for the first COSTS requirement).
#
# requirements_first_skill = an ARRAY with the different REQUIREMENTS for the
# skill which belongs to this requirements. The requirements are respective with
# the skills. So:
# [skill_1, skill_2, skill_3], [requirements_skill_1], [requirements_skill_2], [requirements_skill_3]
#
# You can have as many of the following types of requirements as you want, but
# you MUST have at least one of the first type:
#
# Tree Points, ["points", amount_needed]
# amount_needed = amount of points required.
# NOTE that the VERY FIRST of this type of requirements is the cost to level the
# skill.
#
# Points in a certain tree, ["tree_points", tree_id, points_needed]
# tree_id = the tree_id of the tree in which the actor must have the needed
# points. If it is the first tree, tree_id = 0, second tree, tree_id = 1, third
# tree, tree_id = 2.
# points_needed = the points required in the specified tree.
#
# Skill Object at certain level, ["tree_skill_level", skill_object, required_level]
# skill_object = the identifier of the object which should have the required level.
# required_level = can't be more obvious. 0 is unlearned. Note that the skill level
# should be equal to OR HIGHER THAN this value.
#
# Required level, ["level", case, required_level]
# case = in which manner should the level be required? "=" (equal to), ">"
# (greater than), ">=" (greater than, equal to), "<" (less than), "<=" (less than
# equal to), "!=" (everything BUT)
#
# Skill learned, ["skill", skill_id]
# skill_id = ID of the skill which the actor must have learned.
# NOTE THAT THIS ONE can also be skills NOT learned by skill trees!! AND IT'S A
# SINGLE SKILL!
#
# Switch on certain value, ["switch", switch_id, key]
# switch_id = again, obvious....
# key = either true or false, the switch must be equal to this.
#
# Variable, ["variable", variable_id, case, amount]
# variable_id = ...
# case = same cases as with REQUIRED LEVEL.
#----------------------------------------------------------------------------
# SECTION 4 / TREES
#----------------------------------------------------------------------------
# Trees are build up from rows and identifiers. Note that every row has 7
# spots for objects. Doesn't matter what the objects are.
#
# Syntax:
# Identifier => [object, object, object, object, object, object, object,
# object, object, object, object, object, object, object]
# Identifier = the 'name' of the tree. This must be individual and is used to
# sort the trees for the actors(next section). Can be a string, number, symbol,
# whatever.... As long as it is identical and you use the exact same identifier
# in the next section.
#
# object = the IDENTIFIER of the object. Every tree has rows of 7 OBJECTS. The
# amounts of rows if infinite. If you want to leave an spot blank, use nil.
#
#----------------------------------------------------------------------------
# SECTION 5 / TREES PER ACTOR
#----------------------------------------------------------------------------
# The eassiest out of them all. Note that EVERY ACTOR should have an array
# here.
#
# Syntax:
# Actor_id => [tree_1, tree_2, tree_3, "tree_name_1", "tree_name_2", "tree_name_3"]
# Actor_id = obvious....
#
# tree_1...3 = the IDENTIFIER of the tree as used in Trees. So, can be a string,
# variable, symbol, whatever.... Leave nil for no tree.
#
# "tree_name_1...3" = NAME of the tree as displayed within the scene. Must be
# a string.
#
#----------------------------------------------------------------------------
# SECTION 6 / SCRIPT CALLS AND OTHERS
#----------------------------------------------------------------------------
# To add Tree Points, use:
# $game_actors[actor_id].tree_points += x
# $game_actors[actor_id].total_tree_points += x
# Where actor_id is the id of the actor for which the skill_points are meant
# and x is the amount received. Note that the total_tree_points should also
# receive the SAME amount as it is a variable used when RESETING TREES!!
#
# To add Tree Points to individual trees, use:
# $game_actors[actor_id].tree_points -= x
# $game_actors[actor_id].points_per_tree[tree_id] += x
# Where actor_id has the same meaning as above, tree_id is the id of the tree
# to add the points to and x is the amount of ppoints. The tree_points is used
# in order to prevent adding points which the actor has just gained. Else, use
# $game_actors[actor_id].total_tree_points += x.
#
# To reset a tree, use:
# $game_actors[actor_id].est_reset_tree(tree_id)
# $game_actors[actor_id].est_reset_all_trees
# The first is for only a single tree, the second for ALL trees. For tree_id,
# put the ID of the tree to reset.
#
# $game_actors[actor_id].est_skill_maxed?(skill_object, tree_id)
# to check if the actor with actor_id has maxed the SKILL OBJECT with skill_object
# as IDENTIFIER. Tree_id is the tree containing the SKILL OBJECT.
#
# $game_actors[actor_id].est_skill_level(skill_object, tree_id, different_trees_too?)
# this returns the skill level of the SKILL OBJECT with skill_object as identifier.
# tree_id is the ID of the tree containing the SKILL OBJECT. If different_trees_too?
# is set to true, the actor may have learned the skill in a different tree for
# the skill level to go up by 1.
#
# Use SceneManager.call(Scene_SkillTrees) to call the Skill Trees scene.
#
# INFORMATION_WINDOW
# This script always shows a window to the right of the tree. You can edit the
# contents of this window at the end of the configurations. HOWEVER, you need
# to be able to script to do this!!
#
#----------------------------------------------------------------------------
# REQUIREMENT VARIABLES
#----------------------------------------------------------------------------
# POINTS_REQUIREMENT_1 and POINTS_REQUIREMENT_ELSE
# Text to display when skill points are required ("points" requirement).
# _1 is the singular form, and _ELSE the plural.
# [_points] will be replaced by the required amount of points, so
# "Finally, [_points] points" with the requirement ["points", 7] becomes
# Finally, 7 points
#
# POINTS_IN_TREE_REQUIREMENT_1 and POINTS_IN_TREE_REQUIREMENT_ELSE
# Works the same as POINTS_REQUIREMENT, only for the "tree_points" requirement.
# An additional parameter for this string is [_tree] which will be replaced by
# the name of the tree in which the player should have the set amount of points.
# So "Have [_points] points in [_tree]" with ["tree_points", 0, 15] becomes
# Have 15 points in Ubar Tree
#
# SKILL_AT_LVL_REQUIREMENT_1 and SKILL_AT_LVL_REQUIREMENT_ELSE
# Works the same as POINTS_IN_TREE with [_tree] being replace by the name of
# the required skill (at its current level), [_skill].
# This string is for "tree_skill_level".
#
# LEVEL_REQUIREMENT
# All the strings for every possible case with "level". The sign corresponds
# to case in the "level" requirement. Only constant is [_level], which is
# obviously replaced by the required level.
#
# ["level", "!=", 5] with standard settings gives:
# Level anything but 5
#
# SKILL REQUIREMENT
# String for "skill" requirement. Only constant is [_skill], which is replaced
# by the skill's name.
# "[_skill] learned" with ["skill", 1] and skill 1 called Black End gives:
# Black End learned
#
# SWITCH_REQUIREMENT and VARIABLE_REQUIREMENT
# These two work exactly the same, with the exception of the constants.
# The both have [_id], which is replaced by the ID of the switch/variable, but
# variables also have [_var] which becomes the amount according to the
# requirements (which the variable must be equal to, or whatever).
# Every sentence is according to their ID, and if their ID is missing, the
# first one will be used (0 => ...), which is usually "Something must have
# happened..."
#----------------------------------------------------------------------------
# HEAVILY inspired by Basic(?) - Skill Trees of Awesome by Leongon
#----------------------------------------------------------------------------
# If you have any issues with this script, contact me at
# http://www.rpgmakervxace.net/index.php?/
#============================================================================
#
# CONFIGURATION
#
#============================================================================

module EME
module SKILL_TREES

#----------------------------------------------------------------------------
# SECTION 1 / STANDARD MODULE CONSTANTS
#----------------------------------------------------------------------------

USE_MENU_COMMAND = true
MENU_VOCAB = "Skill Trees"
FIRST_SELECT_ACTOR = true

TREE_POINTS_VOCAB = "SP"
MP_COST_VOCAB = "MP Cost"
TP_COST_VOCAB = "TP Cost"
CURRENT_TREE_POINTS_VOCAB = "SP in "
SKILL_LEVEL_VOCAB ="Skill Level"
REQUIREMENTS_VOCAB = "Requirements"

POINTS_REQUIREMENT_1 = "[_points] Skill Point"
POINTS_REQUIREMENT_ELSE = "[_points] Skill Points"
POINTS_IN_TREE_REQUIREMENT_1 = "[_points] SP in [_tree]"
POINTS_IN_TREE_REQUIREMENT_ELSE = "[_points] SP in [_tree]"
SKILL_AT_LVL_REQUIREMENT_1 = "[_points] SP in [_skill]"
SKILL_AT_LVL_REQUIREMENT_ELSE = "[_points] SP in [_skill]"
LEVEL_REQUIREMENT = {
"=" => "Level equal to [_level]",
">" => "Level higher than [_level]",
"<" => "Level below [_level]",
">=" => "Level at least [_level]",
"<=" => "Level not higher than [_level]",
"!=" => "Level anything but [_level]"
}
SKILL_REQUIREMENT = "[_skill] learned"
SWITCH_REQUIREMENT = {
0 => "Something must have happened...",
1 => "Must have eaten the pizza skill"
}
VARIABLE_REQUIREMENT = {
0 => "Something must have happened...",
1 => "Collected [_var] orbs"
}

LEVEL_DISPLAY_TYPE = 1
TABLE_TREE_POINTS = false
INDIVIDUAL_LEVEL_POINTS = false
TREE_POINTS_PER_LEVEL = 2
REMOVE_POINTS_ON_LEVEL_DOWN = true
LEARN_MODE = 1
ACTOR_OR_CLASSES = 0

#----------------------------------------------------------------------------
# SECTION 2 / TREE_POINTS_TABLE
#----------------------------------------------------------------------------

Tree_Points_Table = {
0 => [2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2],

1 => [3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3]
}

#----------------------------------------------------------------------------
# SECTION 3 / OBJECTS
#----------------------------------------------------------------------------

Objects = {

# Arrow Objects
"arrow_down" => ["arrow_object", 2239, "test_skill_1"],
"arrow_up" => ["arrow_object", 2236, "test_skill_2"],
"arrow_left" => ["arrow_object", 2238, "test_skill_1"],
"arrow_right"=> ["arrow_object", 2237, "test_skill_2"],

:example_arrow => ["arrow_object", 18, "pizza_skill"],

# Skill Objects
"ubar_skill" => ["skill_object", [1], [["points", 1], ["tree_points", 1, 1]]],
"pizza_skill" => ["skill_object", [2, 3, 4], [["points", 1]], [["points", 1],
["level", "!=", 99]], [["points", 5], ["tree_skill_level", "ubar_skill", 1], ["switch", 1, true]]],

"test_skill_1" => ["skill_object", [26], [["points", 1]]],
"test_skill_2" => ["skill_object", [27, 28], [["points", 1]], [["points", 1], ["level", "=", 15]]],

"passive_definite_crit" => ["skill_object", [130], [["points", 1]]],

"heal_mastery" => ["skill_object", [26], [["points", 1]]],
"heal" => ["skill_object", [27, 28], [["points", 1], ["tree_skill_level", "heal_mastery", 1]], [["points", 1]]]

}

#----------------------------------------------------------------------------
# SECTION 4 / TREES
#----------------------------------------------------------------------------

Trees = {

"test_tree" => ["ubar_skill" , :example_arrow, "pizza_skill", nil, nil, nil, nil],

"empty_tree" => ["uber_skill" , nil, nil, nil, nil, nil, nil],

"supar_tree" => ["test_skill_1", "arrow_down", "arrow_up", "test_skill_2", nil, nil, nil],

"test_tree"=> ["heal_mastery" , nil, "passive_definite_crit", nil, nil, nil, nil,
"arrow_down", nil, nil, nil, nil, nil, nil,
"heal", nil, nil, nil, nil, nil, nil],

"cute_tree"=> ["test_skill_1" , nil, nil, nil, nil, nil, nil,
nil, "arrow_up", nil, nil, nil, nil, nil,
nil, nil, "arrow_right" , "test_skill_2", nil, nil, nil]
}

#----------------------------------------------------------------------------
# SECTION 5 / TREES PER ACTOR
#----------------------------------------------------------------------------

Trees_Per_Actor = {

1 => ["empty_tree" , nil, nil, "Empty", nil, nil],
2 => ["test_tree", "supar_tree", nil, "Ubar Tree 2", "MOAR", ""],
3 => ["supar_tree", "test_tree", "cute_tree", "wow", "it's", "epic"],
4 => ["supar_tree", "test_tree", "cute_tree", "wow", "it's", "epic"],
5 => ["supar_tree", "test_tree", "cute_tree", "wow", "it's", "epic"],
6 => ["supar_tree", "test_tree", "cute_tree", "wow", "it's", "epic"],
7 => ["supar_tree", "test_tree", "cute_tree", "wow", "it's", "epic"],
8 => ["supar_tree", "test_tree", "cute_tree", "wow", "it's", "epic"],
9 => ["supar_tree", "test_tree", "cute_tree", "wow", "it's", "epic"],
10=> ["supar_tree", "test_tree", "cute_tree", "wow", "it's", "epic"],
11=> ["supar_tree", "test_tree", "cute_tree", "wow", "it's", "epic"],
12=> ["test_tree", "test_tree", "cute_tree", "wow", "it's", "epic"]

}

end
end

#============================================================================
# ADVANCED INFORMATION WINDOW
#----------------------------------------------------------------------------
# If you can script, here's the refresh with all the contents of the
# information window so you can easily change it if you want to.
#
# Added constants:
# @actor = the current actor. It's the $game_actors[actor_id] version.
# @tree_id = the ID of the current tree. 0, 1 or 2.
# @skill_object = the object that is currently selected.
#
# Useful constants:
# Tree Points = @actor.tree_points
# Points in current tree = @actor.points_per_tree[@tree_id]
# Skill object level = @actor.est_skill_level(@skill_object, @tree_id)
#============================================================================

class Window_EST_Information < Window_Base

def original_contents_height
height - standard_padding * 2
end

def contents_height
@contents_height != nil ? @contents_height : original_contents_height
end

def refresh
contents.clear
@contents_height = original_contents_height + 24 * ([get_requirements.size - 4, 0].max)
create_contents
# Actor Info
draw_actor_face(@actor, 0, 0)
draw_actor_name(@actor, 100, 0)
draw_actor_level(@actor, 212, 0)
draw_actor_class(@actor, 100, 24)
draw_actor_tree_points(@actor, 212, 24)
draw_actor_current_tree_points(@actor, 100, 48)
draw_line
# Skill Info
unless @skill_object == nil
level = [@actor.est_skill_level(@skill_object, @tree_id) - 1, 0].max # Which element of the row with skill IDs should be picked?
@current_skill = $data_skills[@skill_object[1][level]] # The skill that will be picked
draw_skill_name(0, 106)
draw_skill_cost(136, 106)
draw_skill_level(136, 1130)
draw_description(0, 154)
draw_line_2
draw_requirements(0, 208)
end
end

def draw_description(x, y)
current_line = 0
text = []
@current_skill.description.each_line {|line| text[current_line] = line; current_line += 1 }
draw_text(x, y, 328, 24, text[0])
draw_text(x, y + 24, 328, 24, text[1])
end

def draw_actor_level(actor, x, y)
change_color(system_color)
draw_text(x, y, 80, line_height, Vocab::level)
change_color(normal_color)
draw_text(x + 92, y, 24, line_height, actor.level, 2)
end

def draw_actor_tree_points(actor, x, y)
change_color(system_color)
draw_text(x, y, 80, line_height, EME::SKILL_TREES::TREE_POINTS_VOCAB)
change_color(normal_color)
draw_text(x + 80, y, 36, line_height, actor.tree_points, 2)
end

def draw_actor_current_tree_points(actor, x, y)
change_color(system_color)
draw_text(x, y, 170, line_height, EME::SKILL_TREES::CURRENT_TREE_POINTS_VOCAB + EME::SKILL_TREES::Trees_Per_Actor[actor.id][@tree_id + 3])
change_color(normal_color)
draw_text(x + 192, y, 36, line_height, actor.points_per_tree[@tree_id], 2)
end

def draw_line
rect = Rect.new(0, 100, contents.width, 2)
contents.fill_rect(rect, normal_color)
end

def draw_line_2
rect = Rect.new(0, 202, contents.width, 2)
contents.fill_rect(rect, normal_color)
end

def draw_skill_name(x, y)
draw_icon(@current_skill.icon_index, x, y, true)
change_color(normal_color)
draw_text(x + 24, y, 112, line_height, @current_skill.name)
end

def draw_skill_cost(x, y)
if @current_skill.mp_cost != 0
change_color(system_color)
draw_text(x, y, 144, line_height, EME::SKILL_TREES::MP_COST_VOCAB)
change_color(normal_color)
draw_text(x + 144, y, 48, line_height, @current_skill.mp_cost.to_s, 2)
if @current_skill.tp_cost != 0
change_color(system_color)
draw_text(x, y + 24, 144, line_height, EME::SKILL_TREES::TP_COST_VOCAB)
change_color(normal_color)
draw_text(x + 144, y + 24, 48, line_height, @current_skill.tp_cost.to_s, 2)
end
elsif @current_skill.tp_cost != 0
change_color(system_color)
draw_text(x, y, 144, line_height, EME::SKILL_TREES::TP_COST_VOCAB)
change_color(normal_color)
draw_text(x + 144, y, 48, line_height, @current_skill.tp_cost.to_s, 2)
end
end

def draw_skill_level(x, y)
change_color(system_color)
draw_text(x, y, 144, line_height, EME::SKILL_TREES::SKILL_LEVEL_VOCAB)
change_color(normal_color)
unless @actor.est_skill_maxed?(@skill_object, @tree_id)
draw_text(x + 156, y, 36, line_height, @actor.est_skill_level(@skill_object, @tree_id).to_s, 2)
else
draw_text(x + 156, y, 36, line_height, "MAX", 2)
end
end

def draw_requirements(x, y)
draw_text(x, y, 328, line_height, EME::SKILL_TREES::REQUIREMENTS_VOCAB)
requirements = get_requirements
unless requirements == 0
required_points = 0
required_tpoints = [0, 0, 0]
required_tskills = []
required_levels = []
required_skills = []
required_switches = []
required_variables = []
requirements.each{|requirement|
case requirement[0]
when "points"
required_points = requirement[1] if requirement[1] > required_points
when "tree_points"
required_tpoints[requirement[1]] = requirement[2] if requirement[2] > required_tpoints[requirement[1]]
when "tree_skill_level"
required_tskills.push(requirement)
when "level"
required_levels.push(requirement)
when "skill"
required_skills.push(requirement[1])
when "switch"
required_switches.push(requirement)
when "variable"
required_variables.push(requirement)
end
}
line_number = 1
if required_points != 0
required_points == 1 ? text = EME::SKILL_TREES::POINTS_REQUIREMENT_1.gsub("[_points]", required_points.to_s) : text = EME::SKILL_TREES::POINTS_REQUIREMENT_ELSE.gsub("[_points]", required_points.to_s)
draw_text(x, y + 24 * line_number, 328, line_height, text)
line_number += 1
end
if required_tpoints[0] != 0
required_tpoints[0] == 1 ? text = EME::SKILL_TREES::POINTS_IN_TREE_REQUIREMENT_1.gsub("[_points]", required_tpoints[0].to_s).gsub("[_tree]", EME::SKILL_TREES::Trees_Per_Actor[@actor.id][3]) : text = EME::SKILL_TREES::POINTS_IN_TREE_REQUIREMENT_ELSE.gsub("[_points]", required_tpoints[0].to_s).gsub("[_tree]", EME::SKILL_TREES::Trees_Per_Actor[@actor.id][3])
draw_text(x, y + 24 * line_number, 328, line_height, text)
line_number += 1
end
if required_tpoints[1] != 0
required_tpoints[1] == 1 ? text = EME::SKILL_TREES::POINTS_IN_TREE_REQUIREMENT_1.gsub("[_points]", required_tpoints[1].to_s).gsub("[_tree]", EME::SKILL_TREES::Trees_Per_Actor[@actor.id][4]) : text = EME::SKILL_TREES::POINTS_IN_TREE_REQUIREMENT_ELSE.gsub("[_points]", required_tpoints[1].to_s).gsub("[_tree]", EME::SKILL_TREES::Trees_Per_Actor[@actor.id][4])
draw_text(x, y + 24 * line_number, 328, line_height, text)
line_number += 1
end
if required_tpoints[2] != 0
required_tpoints[2] == 1 ? text = EME::SKILL_TREES::POINTS_IN_TREE_REQUIREMENT_1.gsub("[_points]", required_tpoints[2].to_s).gsub("[_tree]", EME::SKILL_TREES::Trees_Per_Actor[@actor.id][5]) : text = EME::SKILL_TREES::POINTS_IN_TREE_REQUIREMENT_ELSE.gsub("[_points]", required_tpoints[2].to_s).gsub("[_tree]", EME::SKILL_TREES::Trees_Per_Actor[@actor.id][5])
draw_text(x, y + 24 * line_number, 328, line_height, text)
line_number += 1
end
if !required_tskills.empty?
index = 0
loop do
req_points = required_tskills[index][2]
object = EME::SKILL_TREES::Objects[required_tskills[index][1]]
req_skill = $data_skills[object[1][@actor.est_skill_level(object, @tree_id) - 1]]
req_skill_name = req_skill.name
req_icon_index = req_skill.icon_index
if req_points == 1
text = EME::SKILL_TREES::SKILL_AT_LVL_REQUIREMENT_1.gsub("[_points]", req_points.to_s).gsub("[_skill]", "\\I[" + req_icon_index.to_s + "]" + req_skill_name)
else
text = EME::SKILL_TREES::SKILL_AT_LVL_REQUIREMENT_ELSE.gsub("[_points]", req_points.to_s).gsub("[_skill]", req_skill_name)
end
draw_text_ex(x, y + 24 * line_number, text)
line_number += 1
index += 1
break if index == required_tskills.size
end
end
if !required_levels.empty?
index = 0
loop do
text = EME::SKILL_TREES::LEVEL_REQUIREMENT[required_levels[index][1]].gsub("[_level]", required_levels[index][2].to_s)
draw_text(x, y + 24 * line_number, 328, line_height, text)
line_number += 1
index += 1
break if index == required_levels.size
end
end
if !required_skills.empty?
index = 0
loop do
text = EME::SKILL_TREES::SKILL_REQUIREMENT.gsub("[_skill]", $data_skills[required_skills[index]].name)
draw_text(x, y + 24 * line_number, 328, line_height, text)
line_number += 1
index += 1
break if index == required_skills.size
end
end
if !required_switches.empty?
index = 0
loop do
if EME::SKILL_TREES::SWITCH_REQUIREMENT.has_key?(required_switches[index][1])
text = EME::SKILL_TREES::SWITCH_REQUIREMENT[required_switches[index][1]].gsub("[_id]", required_switches[index][1].to_s)
else
text = EME::SKILL_TREES::SWITCH_REQUIREMENT[0].gsub("[_id]", required_switches[index][1].to_s)
end
draw_text(x, y + 24 * line_number, 328, line_height, text)
line_number += 1
index += 1
break if index == required_switches.size
end
end
if !required_variables.empty?
index = 0
loop do
if EME::SKILL_TREES::VARIABLE_REQUIREMENT.has_key?(required_variables[index][1])
text = EME::SKILL_TREES::VARIABLE_REQUIREMENT[required_variables[index][1]].gsub("[_id]", required_variables[index][1].to_s).gsub("[_var]", required_variables[index][3].to_s)
else
text = EME::SKILL_TREES::VARIABLE_REQUIREMENT[0].gsub("[_id]", required_variables[index][1].to_s).gsub("[_var]", required_variables[index][3].to_s)
end
draw_text(x, y + 24 * line_number, 328, line_height, text)
line_number += 1
index += 1
break if index == required_variables.size
end
end
else
draw_text(x, y + 24, 328, line_height, "None")
end
end

def get_requirements
level = 2 + @actor.est_skill_level(@skill_object, @tree_id)
requirements = @skill_object[level]
requirements = 0 if requirements == nil
return requirements
end

end

# Don't edit anything past this line unless you know what you're doing.

#============================================================================
#
# Game_Party
# Adds memorize variables.
#============================================================================

class Game_Party

attr_accessor :est_last_object_index
attr_accessor :est_last_tree_id
attr_accessor :est_last_actor_index

alias eme_est_something_something_dark_side initialize
def initialize
eme_est_something_something_dark_side
@est_last_object_index = 0
@est_last_tree_id = 0
@est_last_actor_index = 0
end

end

#============================================================================
#
# Game_Actor
# Adds needed individual variables and stuff.
#============================================================================

class Game_Actor

attr_accessor :tree_points
attr_accessor :total_tree_points
attr_accessor :points_per_tree
attr_accessor :tree_skills

alias eme_est_init_actor initialize
def initialize(actor_id)
@non_tree_skills = []
eme_est_init_actor(actor_id)
@tree_points = 0
@total_tree_points = 0
@points_per_tree = [0,0,0]
@tree_skills = [[], [], []]
if EME::SKILL_TREES::ACTOR_OR_CLASSES == 0
if EME::SKILL_TREES::TABLE_TREE_POINTS
if EME::SKILL_TREES::Tree_Points_Table.include?(@actor_id)
@tree_points = EME::SKILL_TREES::Tree_Points_Table[@actor_id]
else
@tree_points = EME::SKILL_TREES::Tree_Points_Table[0]
end
else
if EME::SKILL_TREES::INDIVIDUAL_LEVEL_POINTS
@tree_points = EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@actor_id] * (level - 1) if @actor_id >= 0
else
@tree_points = EME::SKILL_TREES::TREE_POINTS_PER_LEVEL * (level - 1)
end
end
else
if EME::SKILL_TREES::TABLE_TREE_POINTS
if EME::SKILL_TREES::Tree_Points_Table.include?(@class_id)
@tree_points = EME::SKILL_TREES::Tree_Points_Table[@class_id]
else
@tree_points = EME::SKILL_TREES::Tree_Points_Table[0]
end
else
if EME::SKILL_TREES::INDIVIDUAL_LEVEL_POINTS
@tree_points = EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@class_id] * (level - 1) if @class_id >= 0
else
@tree_points = EME::SKILL_TREES::TREE_POINTS_PER_LEVEL * (level - 1)
end
end
end
end

alias eme_est_level_up level_up
def level_up
eme_est_level_up
if EME::SKILL_TREES::ACTOR_OR_CLASSES == 0
if EME::SKILL_TREES::TABLE_TREE_POINTS
if EME::SKILL_TREES::Tree_Points_Table.has_key?(@actor_id)
@tree_points += EME::SKILL_TREES::Tree_Points_Table[@actor_id][@level - 2]
@total_tree_points += EME::SKILL_TREES::Tree_Points_Table[@actor_id][@level - 2]
else
@tree_points += EME::SKILL_TREES::Tree_Points_Table[0][@level - 2]
@total_tree_points += EME::SKILL_TREES::Tree_Points_Table[0][@level - 2]
end
else
if EME::SKILL_TREES::INDIVIDUAL_LEVEL_POINTS
@tree_points += EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@actor_id - 1]
@total_tree_points += EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@actor_id - 1]
else
@tree_points += EME::SKILL_TREES::TREE_POINTS_PER_LEVEL
@total_tree_points += EME::SKILL_TREES::TREE_POINTS_PER_LEVEL
end
end
else
if EME::SKILL_TREES::TABLE_TREE_POINTS
if EME::SKILL_TREES::Tree_Points_Table.has_key?(@class_id)
@tree_points += EME::SKILL_TREES::Tree_Points_Table[@class_id][@level - 2]
@total_tree_points += EME::SKILL_TREES::Tree_Points_Table[@class_id][@level - 2]
else
@tree_points += EME::SKILL_TREES::Tree_Points_Table[0][@level - 2]
@total_tree_points += EME::SKILL_TREES::Tree_Points_Table[0][@level - 2]
end
else
if EME::SKILL_TREES::INDIVIDUAL_LEVEL_POINTS
@tree_points += EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@class_id - 1]
@total_tree_points += EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@class_id - 1]
else
@tree_points += EME::SKILL_TREES::TREE_POINTS_PER_LEVEL
@total_tree_points += EME::SKILL_TREES::TREE_POINTS_PER_LEVEL
end
end
end
end

alias eme_est_level_down level_down
def level_down
eme_est_level_down
if EME::SKILL_TREES::ACTOR_OR_CLASSES == 0
if EME::SKILL_TREES::REMOVE_POINTS_ON_LEVEL_DOWN
if EME::SKILL_TREES::TABLE_TREE_POINTS
if EME::SKILL_TREES::Tree_Points_Table.has_key?(@actor_id)
@tree_points -= EME::SKILL_TREES::Tree_Points_Table[@actor_id][@level - 1]
@total_tree_points -= EME::SKILL_TREES::Tree_Points_Table[@actor_id][@level - 1]
else
@tree_points -= EME::SKILL_TREES::Tree_Points_Table[0][@level - 1]
@total_tree_points -= EME::SKILL_TREES::Tree_Points_Table[0][@level - 1]
end
else
if EME::SKILL_TREES::INDIVIDUAL_LEVEL_POINTS
@tree_points -= EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@actor_id]
@total_tree_points -= EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@actor_id]
else
@tree_points -= EME::SKILL_TREES::TREE_POINTS_PER_LEVEL
@total_tree_points -= EME::SKILL_TREES::TREE_POINTS_PER_LEVEL
end
end
end
else
if EME::SKILL_TREES::REMOVE_POINTS_ON_LEVEL_DOWN
if EME::SKILL_TREES::TABLE_TREE_POINTS
if EME::SKILL_TREES::Tree_Points_Table.has_key?(@class_id)
@tree_points -= EME::SKILL_TREES::Tree_Points_Table[@class_id][@level - 1]
@total_tree_points -= EME::SKILL_TREES::Tree_Points_Table[@class_id][@level - 1]
else
@tree_points -= EME::SKILL_TREES::Tree_Points_Table[0][@level - 1]
@total_tree_points -= EME::SKILL_TREES::Tree_Points_Table[0][@level - 1]
end
else
if EME::SKILL_TREES::INDIVIDUAL_LEVEL_POINTS
@tree_points -= EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@class_id]
@total_tree_points -= EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@class_id]
else
@tree_points -= EME::SKILL_TREES::TREE_POINTS_PER_LEVEL
@total_tree_points -= EME::SKILL_TREES::TREE_POINTS_PER_LEVEL
end
end
end
end
end

alias eme_est_learn_skill learn_skill
def learn_skill(skill_id)
eme_est_learn_skill(skill_id)
@non_tree_skills.push(skill_id) unless @non_tree_skills.include?(skill_id)
end

alias eme_est_forget_skill forget_skill
def forget_skill(skill_id)
eme_est_forget_skill(skill_id)
@non_tree_skills.delete(skill_id)
end

def learn_tree_skill(skill_id)
unless skill_learn?($data_skills[skill_id])
@skills.push(skill_id)
@skills.sort!
end
end

def forget_tree_skill(skill_id)
@skills.delete(skill_id)
end

def est_tree_skill_learn?(skill_object, tree_id, level)
@tree_skills[tree_id].include?(skill_object[1][level])
end

def est_all_trees_skill_learn?(skill_object, level)
@tree_skills[0].include?(skill_object[1][level]) or @tree_skills[1].include?(skill_object[1][level]) or @tree_skills[2].include?(skill_object[1][level])
end

def est_skill_level(skill_object, tree_id)
current_skill = 0
loop do
case EME::SKILL_TREES::LEARN_MODE
when 0
break if skill_object[1][current_skill] == nil
break unless est_tree_skill_learn?(skill_object, tree_id, current_skill)
current_skill += 1
when 1
break if skill_object[1][current_skill] == nil
break unless est_all_trees_skill_learn?(skill_object, current_skill)
current_skill += 1
when 2
break if skill_object[1][current_skill] == nil
break unless skill_learn?($data_skills[skill_object[1][current_skill]]) or est_all_trees_skill_learn?(skill_object, current_skill)
current_skill += 1
end
end
return current_skill
end

def est_skill_maxed?(skill_object, tree_id)
return true if est_skill_level(skill_object, tree_id) == est_skill_max_level(skill_object)
end

def est_skill_max_level(skill_object)
return skill_object[1].size
end

def est_reset_all_trees
for i in 0..2
est_reset_tree(i)
end
end

def est_reset_tree(tree_id)
@tree_points += @points_per_tree[tree_id]
@points_per_tree[tree_id] = 0
@tree_skills[tree_id].each {|skill_id| forget_tree_skill(skill_id) unless est_learned_elswhere?(skill_id, tree_id)}
@tree_skills[tree_id] = []
end

def est_learned_elswhere?(skill_id, tree_id)
current_tree = 0
for i in 0..2
next if current_tree == tree_id
return true if @tree_skills[tree_id].include?(skill_id)
end
return true if @non_tree_skills.include?(skill_id)
return false
end

def est_trees_amount
return 0 unless EME::SKILL_TREES::Trees_Per_Actor.has_key?(@actor_id) and EME::SKILL_TREES::ACTOR_OR_CLASSES == 0
return 0 unless EME::SKILL_TREES::Trees_Per_Actor.has_key?(@class_id) and EME::SKILL_TREES::ACTOR_OR_CLASSES == 1
count = 0
for i in 0..2
count += 1 if EME::SKILL_TREES::Trees_Per_Actor[@actor_id] != nil and EME::SKILL_TREES::ACTOR_OR_CLASSES == 0
count += 1 if EME::SKILL_TREES::Trees_Per_Actor[@class_id] != nil and EME::SKILL_TREES::ACTOR_OR_CLASSES == 1
end
return count
end

end

#============================================================================
#
# Window_EST_Trees
# The main window. This one depicts the current tree.
#============================================================================

class Window_EST_Trees < Window_Selectable

attr_reader :data
attr_reader :objects
attr_reader :trees
attr_reader :trees_per_actor
attr_accessor :actor
attr_accessor :tree_id
attr_accessor :previous_skill

def initialize(tree_id)
super(0, 48, 7 * 24 + 24, Graphics.height - 48)
@tree_id = tree_id
@data = []
if EME::SKILL_TREES::FIRST_SELECT_ACTOR and $game_party.menu_actor != nil
@actor = $game_party.menu_actor
else
if $game_party.members[$game_party.est_last_actor_index] != nil
@actor = $game_party.members[$game_party.est_last_actor_index]
else
@actor = $game_party.members[0]
end
end
@trees = EME::SKILL_TREES::Trees
@trees_per_actor = EME::SKILL_TREES::Trees_Per_Actor
@objects = EME::SKILL_TREES::Objects
refresh
end

def item_max
@data ? @data.size : 1
end

def col_max
return 7
end

def item_width
return 24
end

def item_height
return 24
end

def spacing
return 0
end

def select_last
if @data[$game_party.est_last_object_index] != nil and @objects[@data[$game_party.est_last_object_index]][0] != "arrow_object"
select($game_party.est_last_object_index)
else
current_element = 0
last_element = @data.size - 1
loop do
if current_element <= last_element
if @data[current_element] != nil and @objects[@data[current_element]][0] != "arrow_object"
select(current_element)
return
else
current_element += 1
end
else
self.unselect
end
end
end
end

alias eme_est_process_ok process_ok
def process_ok
if current_skill_not_maxed?
eme_est_process_ok
else
Sound.play_buzzer
end
end

alias eme_est_cursor_down cursor_down
def cursor_down(wrap = false)
loop do
if @index + col_max > @data.size - 1
@index = 0
if @data[@index] != nil and @objects[@data[@index]][0] != "arrow_object"
select(0)
break
else
cursor_right(wrap)
break
end
elsif @data[@index + col_max] != nil and @objects[@data[index + col_max]][0] != "arrow_object"
eme_est_cursor_down(wrap)
break
else
self.index += col_max
self.index = 0 if index > item_max
end
end
$game_party.est_last_object_index = @index
end

alias eme_est_cursor_up cursor_up
def cursor_up(wrap = false)
loop do
if @index - col_max < 0
@index = item_max
if @data[@index] != nil and @objects[@data[@index]][0] != "arrow_object"
select(item_max)
break
else
cursor_left(wrap)
break
end
elsif @data[index - col_max] != nil and @objects[@data[index - col_max]][0] != "arrow_object"
eme_est_cursor_up(wrap)
break
else
@index -= col_max
@index = 0 if @index < 0
end
end
$game_party.est_last_object_index = @index
end

alias eme_est_cursor_right cursor_right
def cursor_right(wrap = false)
loop do
if index + 1 > @data.size - 1
self.index = 0
if @data[index] != nil and @objects[@data[index]][0] != "arrow_object"
select(0)
return
end
elsif @data[index + 1] != nil and @objects[@data[index + 1]][0] != "arrow_object"
break
else
self.index += 1
self.index = 0 if index > item_max
end
end
eme_est_cursor_right(wrap)
$game_party.est_last_object_index = @index
end

alias eme_est_cursor_left cursor_left
def cursor_left(wrap = false)
loop do
if index - 1 < 0
self.index = @data.size - 1
if @data[index] != nil and @objects[@data[index]][0] != "arrow_object"
select(@data.size - 1)
return
end
elsif @data[index - 1] != nil and @objects[@data[index - 1]][0] != "arrow_object"
break
else
self.index -= 1
self.index = 0 if index > item_max
end
end
eme_est_cursor_left(wrap)
$game_party.est_last_object_index = @index
end

def enable_arrow?(arrow_object)
for i in 2...arrow_object.size
return false unless enable_skill?(@objects[arrow_object], true)
end
return true
end

def enable_skill?(skill_object, used_in_enable_arrow)
return true if @actor.est_skill_maxed?(skill_object, @tree_id)
requirements = skill_object[@actor.est_skill_level(skill_object, @tree_id) + 2]
requirements.each {|requirement|
case requirement[0]
when "points"
return false unless used_in_enable_arrow or @actor.tree_points >= requirement[1]
when "tree_points"
return false unless @actor.points_per_tree[requirement[1]] >= requirement[2]
when "tree_skill_level"
return false unless @actor.est_skill_level(@objects[requirement[1]], @tree_id) >= requirement[2] or @actor.est_skill_maxed?(@objects[requirement[1]], @tree_id)
when "level"
case requirement[1]
when "="
return false unless @actor.level == requirement[2]
when ">"
return false unless @actor.level > requirement[2]
when ">="
return false unless @actor.level >= requirement[2]
when "<"
return false unless @actor.level < requirement[2]
when "<="
return false unless @actor.level <= requirement[2]
when "!="
return false unless @actor.level != requirement[2]
end
when "skill"
return false unless @actor.skill_learn?($data_skills[requirement[1]])
when "switch"
if requirement[2]
return false unless $game_switches[requirement[1]]
else
return false if $game_switches[requirement[1]]
end
when "variable"
case requirement[2]
when "="
return false unless $game_variables[requirement[1]] == requirement[3]
when ">"
return false unless $game_variables[requirement[1]] > requirement[3]
when ">="
return false unless $game_variables[requirement[1]] >= requirement[3]
when "<"
return false unless $game_variables[requirement[1]] < requirement[3]
when "<="
return false unless $game_variables[requirement[1]] <= requirement[3]
when "!="
return false unless $game_variables[requirement[1]] != requirement[3]
end
end
}
return true
end

def current_item_enabled?
return false if @data[index] == nil
case @objects[@data[index]][0]
when "skill_object"
return true if enable_skill?(@objects[@data[index]], false)
when "arrow_object"
return true if enable_arrow?(@objects[@data[index]])
end
return false
end

def current_skill_not_maxed?
return false if @data[index] == nil
case @objects[@data[index]][0]
when "skill_object"
return true unless @actor.est_skill_maxed?(@objects[@data[index]], @tree_id)
end
return false
end

def make_tree_data
id = @actor.id if EME::SKILL_TREES::ACTOR_OR_CLASSES == 0
id = @actor.class_id if EME::SKILL_TREES::ACTOR_OR_CLASSES == 1
if @trees_per_actor[id] != nil
if @trees_per_actor[id][@tree_id] != nil
@data = @trees[@trees_per_actor[id][@tree_id]]
elsif @trees_per_actor[@actor.id][0] != nil
@tree_id = 0
@data = @trees[@trees_per_actor[id][@tree_id]]
elsif @trees_per_actor[@actor.id][1] != nil
@tree_id = 1
@data = @trees[@trees_per_actor[id][@tree_id]]
elsif @trees_per_actor[@actor.id][2] != nil
@tree_id = 2
@data = @trees[@trees_per_actor[id][@tree_id]]
else
@data = nil
end
else
@data = nil
end
end

def draw_item(index)
if @data[index] != nil
object = @objects[@data[index]]
rect = item_rect(index)
rect.width -= 4
if object[0] == "arrow_object"
draw_icon(object[1], rect.x, rect.y, enable_arrow?(object))
elsif object[0] == "skill_object"
skill_level = @actor.est_skill_level(object, @tree_id)
skill_level_2 = [skill_level - 1, 0].max
draw_icon($data_skills[object[1][skill_level_2]].icon_index, rect.x, rect.y, enable_skill?(object, false))
contents.font.size = 16
unless EME::SKILL_TREES::LEVEL_DISPLAY_TYPE == 0
unless @actor.est_skill_maxed?(object, @tree_id)
if EME::SKILL_TREES::LEVEL_DISPLAY_TYPE == 1
draw_text(rect.x + 2, rect.y + 4, 24, line_height, skill_level.to_s)
else
max_skill_level = @actor.est_skill_max_level(object)
draw_text(rect.x + 2, rect.y + 4, 24, line_height, skill_level.to_s+"/"+max_skill_level.to_s)
end
else
draw_text(rect.x + 2, rect.y + 4, 24, line_height, "MAX")
end
end
end
end
end

def refresh
make_tree_data
create_contents
draw_all_items
select_last
end

end

#============================================================================
#
# Window_EST_Selection
# Window which enables the player to select the differen trees.
#============================================================================

class Window_EST_Selection < Window_HorzCommand

attr_accessor :actor_id

def initialize
@actor_id = 0
super(0, 0)
end

def window_width
Graphics.width
end

def col_max
return 3
end

def update
super
case current_symbol
when :tree_1
$game_party.est_last_tree_id = 0
when :tree_2
$game_party.est_last_tree_id = 1
when :tree_3
$game_party.est_last_tree_id = 2
end
end

def make_command_list
if EME::SKILL_TREES::Trees_Per_Actor.include?(@actor_id)
add_command(EME::SKILL_TREES::Trees_Per_Actor[@actor_id][3], :tree_1) if EME::SKILL_TREES::Trees_Per_Actor[@actor_id][0] != nil
add_command(EME::SKILL_TREES::Trees_Per_Actor[@actor_id][4], :tree_2) if EME::SKILL_TREES::Trees_Per_Actor[@actor_id][1] != nil
add_command(EME::SKILL_TREES::Trees_Per_Actor[@actor_id][5], :tree_3) if EME::SKILL_TREES::Trees_Per_Actor[@actor_id][2] != nil
end
end

alias eme_est_i_need_something_original refresh
def refresh
eme_est_i_need_something_original
clear_command_list
make_command_list
end

end

#============================================================================
#
# Window_EST_Information
# Window which shows all needed information.
#============================================================================

class Window_EST_Information < Window_Base

attr_accessor :actor
attr_accessor :tree_id
attr_accessor :skill_object

def initialize
super(7 * 24 + 24, 48, Graphics.width - 7 * 24 - 24, Graphics.height - 48)
@actor = nil
@tree_id = 0
@skill_object = ["", [0], ["points", 0]]
end

end

#============================================================================
#
# Window_MenuCommand
# Adds the skill trees menu command.
#============================================================================

class Window_MenuCommand

alias eme_est_original_commands add_original_commands
def add_original_commands
eme_est_original_commands
add_command(EME::SKILL_TREES::MENU_VOCAB, :talents) if EME::SKILL_TREES::USE_MENU_COMMAND
end

end

#============================================================================
#
# Scene_Menu
# Adds the handler to access the skill trees scene from the menu.
#============================================================================

class Scene_Menu

alias eme_est_create_command_window create_command_window
def create_command_window
eme_est_create_command_window
if EME::SKILL_TREES::USE_MENU_COMMAND
if EME::SKILL_TREES::FIRST_SELECT_ACTOR
@command_window.set_handler(:talents, method(:command_personal))
else
@command_window.set_handler(:talents, method(:talents_scene))
end
end
end

def talents_scene
unless EME::SKILL_TREES::FIRST_SELECT_ACTOR
SceneManager.call(Scene_SkillTrees)
else
@status_window.activate
@status_window.select($game_party.members.index($game_party.menu_actor))
end
end

alias eme_est_personal_ok on_personal_ok
def on_personal_ok
if @command_window.current_symbol == :talents
SceneManager.call(Scene_SkillTrees)
else
eme_est_personal_ok
end
end

end

#============================================================================
#
# Scene_SkillTrees
# New scene to learn skills from the trees.
#============================================================================

class Scene_SkillTrees < Scene_MenuBase

def start
super
create_skill_trees
create_skill_trees_selection
create_info_window
@skill_trees_selection.deactivate
@skill_trees_selection.unselect
@skill_tree.activate
end

def update
super
@skill_tree.active ? @last_window = "trees" : @last_window = "selection"
any_change = false
any_change_2 = false
if @info_window.skill_object != @skill_tree.objects[@skill_tree.data[@skill_tree.index]] and @skill_tree.objects[@skill_tree.data[@skill_tree.index]] != nil
@info_window.skill_object = @skill_tree.objects[@skill_tree.data[@skill_tree.index]]
any_change_2 = true
end
if @info_window.tree_id != $game_party.est_last_tree_id
@info_window.tree_id = $game_party.est_last_tree_id
any_change = true
end
if @skill_tree.tree_id != $game_party.est_last_tree_id
@skill_tree.tree_id = $game_party.est_last_tree_id
any_change = true
end
if any_change
@skill_tree.refresh
@skill_tree.select_last
@info_window.skill_object = @skill_tree.objects[@skill_tree.data[@skill_tree.index]]
@skill_tree.unselect
end
@info_window.refresh if any_change or any_change_2
if Input.press?(:X)
@info_window.oy -= 2 unless @info_window.oy == 0
elsif Input.press?(:Y)
@info_window.oy += 2 unless @info_window.oy == @info_window.contents_height - @info_window.original_contents_height
end
end

def create_skill_trees
@skill_tree = Window_EST_Trees.new($game_party.est_last_tree_id)
@skill_tree.viewport = @viewport
@skill_tree.set_handler(:ok, method(:learn_skill))
@skill_tree.set_handler(:cancel, method(:switch_to_selection))
@skill_tree.set_handler(:pageup, method(:actor_left))
@skill_tree.set_handler(:pagedown, method(:actor_right))
end

def create_skill_trees_selection
@skill_trees_selection = Window_EST_Selection.new
@skill_trees_selection.actor_id = @skill_tree.actor.id if EME::SKILL_TREES::ACTOR_OR_CLASSES == 0
@skill_trees_selection.actor_id = @skill_tree.actor.class_id if EME::SKILL_TREES::ACTOR_OR_CLASSES == 1
@skill_trees_selection.clear_command_list
@skill_trees_selection.make_command_list
@skill_trees_selection.refresh
@skill_trees_selection.viewport = @viewport
@skill_trees_selection.set_handler(:ok, method(:switch_to_tree))
@skill_trees_selection.set_handler(:cancel, method(:return_scene))
@skill_trees_selection.set_handler(:pageup, method(:actor_left))
@skill_trees_selection.set_handler(:pagedown, method(:actor_right))
end

def create_info_window
@info_window = Window_EST_Information.new
@info_window.actor = @skill_tree.actor
@info_window.tree_id = @skill_tree.tree_id
@info_window.skill_object = @skill_tree.objects[@skill_tree.data[@skill_tree.index]]
@info_window.refresh
@info_window.viewport = @viewport
end

def switch_to_tree
@skill_trees_selection.deactivate
@skill_trees_selection.unselect
@skill_tree.activate
@skill_tree.select_last
end

def switch_to_selection
@skill_tree.deactivate
@skill_tree.unselect
@skill_trees_selection.activate
id = @skill_tree.tree_id
if EME::SKILL_TREES::ACTOR_OR_CLASSES == 0
id -= 1 if EME::SKILL_TREES::Trees_Per_Actor[@skill_tree.actor.id][1] == nil and id > 1
id -= 1 if EME::SKILL_TREES::Trees_Per_Actor[@skill_tree.actor.id][0] == nil
else
id -= 1 if EME::SKILL_TREES::Trees_Per_Actor[@skill_tree.actor.class_id][1] == nil and id > 1
id -= 1 if EME::SKILL_TREES::Trees_Per_Actor[@skill_tree.actor.class_id][0] == nil
end
@skill_trees_selection.select(id || 0)
end

def actor_left
$game_party.menu_actor = @skill_tree.actor
$game_party.menu_actor_prev
@skill_tree.actor = $game_party.menu_actor
if (@skill_trees_selection.actor_id != @skill_tree.actor.id and EME::SKILL_TREES::ACTOR_OR_CLASSES == 0) or (@skill_trees_selection.actor_id != @skill_tree.actor.class_id and EME::SKILL_TREES::ACTOR_OR_CLASSES == 1)
@skill_trees_selection.actor_id = @skill_tree.actor.id if EME::SKILL_TREES::ACTOR_OR_CLASSES == 0
@skill_trees_selection.actor_id = @skill_tree.actor.class_id if EME::SKILL_TREES::ACTOR_OR_CLASSES == 1
@info_window.actor = @skill_tree.actor
@actor = @skill_tree.actor
@skill_tree.refresh
@skill_trees_selection.refresh
@info_window.refresh
$game_party.est_last_actor_index = $game_party.members.index(@skill_tree.actor)
end
@last_window == "trees" ? @skill_tree.activate : @skill_trees_selection.activate
@skill_tree.unselect unless @skill_tree.active
end

def actor_right
$game_party.menu_actor = @skill_tree.actor
$game_party.menu_actor_next
@skill_tree.actor = $game_party.menu_actor
if (@skill_trees_selection.actor_id != @skill_tree.actor.id and EME::SKILL_TREES::ACTOR_OR_CLASSES == 0) or (@skill_trees_selection.actor_id != @skill_tree.actor.class_id and EME::SKILL_TREES::ACTOR_OR_CLASSES == 1)
@skill_trees_selection.actor_id = @skill_tree.actor.id if EME::SKILL_TREES::ACTOR_OR_CLASSES == 0
@skill_trees_selection.actor_id = @skill_tree.actor.class_id if EME::SKILL_TREES::ACTOR_OR_CLASSES == 1
@info_window.actor = @skill_tree.actor
@actor = @skill_tree.actor
@skill_tree.refresh
@skill_trees_selection.refresh
@info_window.refresh
$game_party.est_last_actor_index = $game_party.members.index(@skill_tree.actor)
end
@last_window == "trees" ? @skill_tree.activate : @skill_trees_selection.activate
@skill_tree.unselect unless @skill_tree.active
end

def learn_skill
object = @skill_tree.objects[@skill_tree.data[@skill_tree.index]]
unless @actor.est_skill_maxed?(object, @skill_tree.tree_id)
current_element = 0
cost = 0
loop do
if object[@actor.est_skill_level(object, @skill_tree.tree_id) + 2][current_element][0] == "points"
cost = object[@actor.est_skill_level(object, @skill_tree.tree_id) + 2][current_element][1]
break
else
current_element += 1
end
end
@actor.tree_points -= cost
@actor.points_per_tree[@skill_tree.tree_id] += cost
@actor.tree_skills[@skill_tree.tree_id].push(object[1][@actor.est_skill_level(object, @skill_tree.tree_id)])
previous_level = [@actor.est_skill_level(object, @skill_tree.tree_id) - 2, 0].max
@actor.forget_tree_skill(object[1][previous_level]) unless @actor.est_skill_level(object, @skill_tree.tree_id) == 1 or @actor.est_learned_elswhere?(object[1][previous_level], @skill_tree.tree_id)
@actor.learn_tree_skill(object[1][@actor.est_skill_level(object, @skill_tree.tree_id) - 1])
@skill_tree.refresh
@info_window.refresh
@skill_tree.activate
end
end
 

end

 

Share this post


Link to post
Share on other sites

Trying adding this to the list instead:

:talents   => ["", "Modify your talents", 4135, true, true, Scene_SkillTrees],
  • Like 1

Share this post


Link to post
Share on other sites

Sir, once more, thank you ^^ and now I understand how to find scene calls for other scripts. I shall like every script of yours that I use and put you as the main credit. Thanks mate.

Trying adding this to the list instead:

:talents   => ["", "Modify your talents", 4135, true, true, Scene_SkillTrees],

Share this post


Link to post
Share on other sites

Hello again, I'm currently testing through the scripts I've obtained and have found two errors in XS - Menu Delux (v1.0d).
XS - Core is updated to the latest version (2.1c) of course.


These errors were found when testing with menu_custom set to true, this time however I had found fixes for them that I believe you should check.

During your modification from v1.0c to v1.0d, I've noticed on line 258 and 263 that you've removed the value section of those lines.

258 Before : XAIL::MENU_DELUX::MENU_LIST.each {|key, value| menu_scene(key) }
258 Current : XAIL::MENU_DELUX::MENU_LIST.each {|key| menu_scene(key) }

263 Before : XAIL::MENU_DELUX::MENU_LIST.each {|key, value| menu_scene(key, :del) }
263 Current : XAIL::MENU_DELUX::MENU_LIST.each {|key| menu_scene(key, :del) }

Due to this change, the script commands menu_add_all and menu_del_all would not work, but by returning them back to their previous state (adding the ", value" section) would fix the functions.

- - - - -

The second issue is the following snippet from lines 251 to 254

 

  def menu_active(key, enabled)
#
    $game_system.menu_list[id][3] = enabled
  end

The issue is that it is attempting to call an id, yet you've stated in the header to use true/false for this command. So therefore using the script calls to call true/false (for example - menu_active(:item, true)) would crash the game.
I took a wild guess admittedly but had found that changing

    $game_system.menu_list[id][3] = enabled
to
    $game_system.menu_list[key][3] = enabled


allowed the function to work.


Note - I have tested on a blank project to double check.

Edited by DSkyo

Share this post


Link to post
Share on other sites

Thanks, I have released a updated version now. Should work as intended now.

Share this post


Link to post
Share on other sites

Glad to help,

btw you forgot to update the file in your link for v1.0e, it's still v1.0d right now.

Share this post


Link to post
Share on other sites
You basicially want it to start on a pre-defined actor all the time?

 

 

Ah, no, what I meant was that you don't get to choose which actor you want to open the menu on. It'd be nice if, just one step before that menu was opened, you get to choose the actor it opens on.

Share this post


Link to post
Share on other sites

Awesome script !! I love it....I have one problem though :(
I cant seem to download your other menu scripts for example: XS - Icon Skill, XS - Icon Equip etc

The only one I could download is the XS - Menu Delux

Could you maybe fix, or upload all of your scripts somewhere else?

Thanks, keep up the awesome work :)

Share this post


Link to post
Share on other sites

Nicke,

 

Excellent script, I just started poking around and I very much like what I see, it's very flexible and easy to understand, and it draws upon a lot of fun stats that RMVXA seemed to leave out.

 

I haven't been having any issues with it, actually, and everything seems to be working fine except for one little bit: the TP gauges. Unlike HP and MP, TP is gauged only to 100, and your gauges are presenting them not as a number of 0 - 100, but as a percentage. I've been digging through the script for the last few hours, changing and moving things around, but I can't seem to find a way to fix this or even pinpoint the error-- if it even is an error.

 

I've attached a screen so you can see. If that's how it's supposed to be then don't worry about it, It's a very lovely setup and I intend to use it regardless.

 

Thanks alot in advance,

 

~White

post-18559-0-91258600-1358669746_thumb.png

Share this post


Link to post
Share on other sites

Adding this to the new Master Script List. PM me and let me know if I miss any related scripts as I have a lot of catching up to do.

Share this post


Link to post
Share on other sites

This script makes everything look so clean, including the test/message box.

Edited by lookerup

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted