N0M4D_PC 0 Posted December 28, 2012 Wow, nevermind lol. I was reading too deep. I got it. But, how to make a new window? Share this post Link to post Share on other sites
Galv 1,387 Posted December 28, 2012 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
Iyce 0 Posted December 28, 2012 (edited) 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 December 28, 2012 by Iyce Share this post Link to post Share on other sites
Nicke 151 Posted December 28, 2012 @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
Iyce 0 Posted December 28, 2012 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
Anderson88 26 Posted December 28, 2012 (edited) 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 December 28, 2012 by Anderson88 Share this post Link to post Share on other sites
Nicke 151 Posted December 30, 2012 You basicially want it to start on a pre-defined actor all the time? Share this post Link to post Share on other sites
ChrisCage 0 Posted January 4, 2013 I feel like a real noob but where can i find the example backgrounds? ^^' Share this post Link to post Share on other sites
Kipp0420 0 Posted January 4, 2013 Yea, I'd kinda like to know that too.. lol Share this post Link to post Share on other sites
Nicke 151 Posted January 4, 2013 Fixed. You can now download it. Share this post Link to post Share on other sites
Rylix 0 Posted January 6, 2013 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? Share this post Link to post Share on other sites
Nicke 151 Posted January 6, 2013 Please use the latest Core Script and put it above this script. Share this post Link to post Share on other sites
Rylix 0 Posted January 6, 2013 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
Rylix 0 Posted January 6, 2013 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. 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"] = truemodule XAILmodule 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 = stringMENU_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/falseMENU_CUSTOM = false# The text to be displayed if no menu items is available.# Only used if MENU_CUSTOM is true.# MENU_EMPTY = stringEMPTY = "Menu is not available at this point..."# MENU_MUSIC:# Set the music to be played at the menu scene.# This is optional.# MUSIC = true/falseMUSIC = 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 # GOLDDETAILS_ICONS[1] = 172 # STEPSDETAILS_ICONS[2] = 270 # ITEMSDETAILS_ICONS[3] = 232 # MAPDETAILS_ICONS[4] = 4425 # LEADERDETAILS_ICONS[5] = 115 # BATTLE COUNTDETAILS_ICONS[6] = 224 # SAVE COUNTDETAILS_ICONS[7] = nil # VAR 1DETAILS_ICONS[8] = nil # VAR 2# Transition, nil to use default.# TRANSITION [speed, transition, opacity]TRANSITION = nilendend# *** 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))exitend#==============================================================================## ** Game_System#==============================================================================#class Game_Systemattr_accessor :menu_listalias xail_menu_delux_gm_sys_initialize initializedef initialize(*args, &block)# // Method to initialize game system.xail_menu_delux_gm_sys_initialize(*args, &block)@menu_list = {}enddef get_menu# // Method to get the menu list.XAIL::MENU_DELUX::MENU_CUSTOM ? @menu_list : XAIL::MENU_DELUX::MENU_LISTendend#==============================================================================## ** Game_Interpreter#==============================================================================#class Game_Interpreterdef menu_scene(key, type = :add)# // Method to add/remove a menu item to the list.case typewhen :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)endendenddef 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 nilenddef menu_active(key, enabled)# // Method to enable id.$game_system.menu_list[id][3] = enabledenddef menu_add_all# // Method to add all available menu items.XAIL::MENU_DELUX::MENU_LIST.each {|key| menu_scene(key) }enddef menu_del_all# // Method to remove all available menu items.XAIL::MENU_DELUX::MENU_LIST.each {|key| menu_scene(key, :del) }endend#==============================================================================## ** Game_Map#==============================================================================#class Game_Mapattr_reader :namealias xail_menu_delux_setup setupdef setup(map_id)# // Method to setup the map id.xail_menu_delux_setup(map_id)@name = $data_mapinfos[@map_id].nameendend#==============================================================================# ** Window_MenuCommand#==============================================================================class Window_MenuCommand < Window_Commanddef window_width# // Method to return the width of MENU_WINDOW.return 170enddef alignment# // Method to return the alignment.return XAIL::MENU_DELUX::MENU_ALIGNMENTenddef 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 enabledenddef 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 += 24rect.width -= 8draw_icon(XAIL::MENU_DELUX::MENU_LIST.values[index][2], -2, rect.y) unless XAIL::MENU_DELUX::MENU_LIST.values[index][2].nil?rectenddef 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_SAVEmenu_color(XAIL::MENU_DELUX::MENU_FONT[2], menu_enabled?(index))# // Font settingscontents.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_settingsenddef menu_enabled?(index)# // Method to check if menu item is enabled.return $game_system.get_menu.values[index][3]enddef 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_SAVEadd_command(name, key, value[3], value[5].nil? ? nil : value[5])}endend#==============================================================================# ** Window_MenuStatus#==============================================================================class Window_MenuStatus < Window_Selectabledef window_width# // Method to determine window width.return 250enddef window_height# // Method to determine window height.return Graphics.heightenddef standard_padding# // Method to determine standard padding.return 4enddef col_max# // Method to determine col max.return 2enddef spacing# // Method to determine spacing.return 30enddef item_width# // Method to determine item width.return 98enddef item_height# // Method to determine item height.return 128enddef refresh# // Method to refresh the window.contents.cleardraw_backgrounddraw_all_itemsenddef draw_background# // Method to draw background.contents.fill_rect(0, 0, contents_width, contents_height, Color.new(0,0,0,60))enddef draw_item(index)# // Method to draw item.actor = $game_party.members[index]rect = item_rect(index)draw_item_background(index)# // Facedraw_actor_face(actor, rect.x + 1, rect.y + 1, true)# // Namedraw_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])# // Levellvl = "#{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])# // Classdraw_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])# // Statsdraw_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)enddef draw_menu_stats(actor, stat, x, y, color1, color2, width)# // Method to draw actor hp & mp.case statwhen :hprate = actor.hp_rate ; vocab = Vocab::hp_a ; values = [actor.hp, actor.mhp]when :mprate = actor.mp_rate ; vocab = Vocab::mp_a ; values = [actor.mp, actor.mmp]when :tprate = actor.tp_rate ; vocab = Vocab::tp_a ; values = [actor.tp, actor.max_tp]endcontents.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_settingsendend#==============================================================================# ** Window_Menu_Details#==============================================================================class Window_Menu_Details < Window_Basedef initialize(x, y)# // Method to initialize.super(x, y, window_width, fitting_height(XAIL::MENU_DELUX.details.size) + 6)@leader = $game_party.leaderrefreshenddef standard_padding# // Method to determine standard padding.return 8enddef window_width# // Method to determine window width.return 172enddef refresh# // Method to refresh the window.contents.clear# // Draw background.draw_background# // Draw details.y = -10XAIL::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)enddef draw_background# // Method to draw background.contents.fill_rect(0, 0, contents_width, contents_height, Color.new(0,0,0,60))enddef update# // Method to update details window.superif @leader != $game_party.leader@leader = $game_party.leaderrefreshendendend#==============================================================================# ** Window_Menu_Playtime#==============================================================================class Window_Menu_Playtime < Window_Basedef initialize(x, y)# // Method to initialize.super(x, y, 120, fitting_height(1))@playtime = $game_system.playtime_srefreshenddef 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])enddef update# // Method to update the window.super@playtime = $game_system.playtime_srefreshendend#==============================================================================## ** Window_Menu_Help#==============================================================================#class Window_Menu_Help < Window_Helpattr_accessor :indexalias xail_icon_menu_winhelp_init initializedef initialize(*args, &block)# // Method to initialize help window.xail_icon_menu_winhelp_init(*args, &block)@index = 0enddef set_text(text, enabled)# // Method to set a new help text.if text != @textmenu_color(XAIL::MENU_DELUX::MENU_FONT[2], enabled)@text = textrefreshendenddef refresh# // Refresh help contents.contents.cleardraw_help_textenddef 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_settingsenddef menu_enabled?(index)# // Method to check if menu item is enabled.return $game_system.get_menu.values[index][3]enddef 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 enabledendend#==============================================================================## ** Scene_MenuBase#==============================================================================#class Scene_MenuBase < Scene_Basedef start# // Method to start the scene.super@actor = $game_party.menu_actorif SceneManager.scene_is?(Scene_Menu)@backgrounds = []@animations = []create_menu_backgroundscreate_menu_animationsendenddef 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]}enddef 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]}endalias xail_upd_menubase_delux_upd updatedef 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 + iend unless scene_changing?delay?(1)endenddef delay?(amount)# // Method to delay.amount.times doupdate_basicendendalias xail_menubase_delux_transition perform_transitiondef 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)elseGraphics.transition(XAIL::MENU_DELUX::TRANSITION[0],XAIL::MENU_DELUX::TRANSITION[1],XAIL::MENU_DELUX::TRANSITION[2])endenddef 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 nilenddef terminate# // Method to terminate.superdispose_sprites unless SceneManager.scene_is?(Scene_Menu)endend#==============================================================================## ** Scene_Menu#==============================================================================#class Scene_Menu < Scene_MenuBasedef startsuper# // Method to start the scene.# // Return if menu empty.return command_map if $game_system.get_menu.empty?# // Create windows.create_menu_command_windowcreate_menu_status_windowcreate_menu_details_windowcreate_menu_playtime_window if XAIL::MENU_DELUX::PLAYTIME_WINDOW[5]if XAIL::MENU_DELUX::HELP_WINDOW[4]create_menu_help_windowhelp_update(@command_window.index)end# // Play music if enabled.play_menu_music if XAIL::MENU_DELUX::MUSICenddef 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))elseif value[4]@command_window.set_handler(key, method(:command_personal))else@command_window.set_handler(key, method("command_#{key}".to_sym))endend}@command_window.set_handler(:cancel, method(:return_scene))enddef 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]enddef 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]enddef 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]enddef 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]enddef play_menu_music# // Method to play menu music.@last_bgm = RPG::BGM.last@last_bgs = RPG::BGS.lastbgm = XAIL::MENU_DELUX::MUSIC_BGMbgs = XAIL::MENU_DELUX::MUSIC_BGSSound.play(bgm[0], bgm[1], bgm[2], :bgm)Sound.play(bgs[0], bgs[1], bgs[2], :bgs)endalias xail_upd_menu_delux_upd updatedef 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.indexif old_index != @command_window.indexhelp_update(@command_window.index)endendenddef help_update(index)# // If index changes update help window text.list = XAIL::MENU_DELUX::MENU_LISTicon = 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 ; enddesc = '\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)enddef on_personal_ok# // Method override on personal ok.scene = "Scene_#{@command_window.current_symbol.to_s.capitalize}".to_classSceneManager.call(scene)enddef 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_mapendSceneManager.call(@command_window.current_ext)enddef command_map# // command_map (Don't remove)if $game_system.get_menu.empty?Sound.play_buzzer$game_message.texts << XAIL::MENU_DELUX::EMPTYendSceneManager.call(Scene_Map)enddef 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 nilendendend # 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 EMEmodule SKILL_TREES#----------------------------------------------------------------------------# SECTION 1 / STANDARD MODULE CONSTANTS#----------------------------------------------------------------------------USE_MENU_COMMAND = trueMENU_VOCAB = "Skill Trees"FIRST_SELECT_ACTOR = trueTREE_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 = 1TABLE_TREE_POINTS = falseINDIVIDUAL_LEVEL_POINTS = falseTREE_POINTS_PER_LEVEL = 2REMOVE_POINTS_ON_LEVEL_DOWN = trueLEARN_MODE = 1ACTOR_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"]}endend#============================================================================# 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_Basedef original_contents_heightheight - standard_padding * 2enddef contents_height@contents_height != nil ? @contents_height : original_contents_heightenddef refreshcontents.clear@contents_height = original_contents_height + 24 * ([get_requirements.size - 4, 0].max)create_contents# Actor Infodraw_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 Infounless @skill_object == nillevel = [@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 pickeddraw_skill_name(0, 106)draw_skill_cost(136, 106)draw_skill_level(136, 1130)draw_description(0, 154)draw_line_2draw_requirements(0, 208)endenddef draw_description(x, y)current_line = 0text = []@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])enddef 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)enddef 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)enddef 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)enddef draw_linerect = Rect.new(0, 100, contents.width, 2)contents.fill_rect(rect, normal_color)enddef draw_line_2rect = Rect.new(0, 202, contents.width, 2)contents.fill_rect(rect, normal_color)enddef 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)enddef draw_skill_cost(x, y)if @current_skill.mp_cost != 0change_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 != 0change_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)endelsif @current_skill.tp_cost != 0change_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)endenddef 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)elsedraw_text(x + 156, y, 36, line_height, "MAX", 2)endenddef draw_requirements(x, y)draw_text(x, y, 328, line_height, EME::SKILL_TREES::REQUIREMENTS_VOCAB)requirements = get_requirementsunless requirements == 0required_points = 0required_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_pointswhen "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 = 1if required_points != 0required_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 += 1endif required_tpoints[0] != 0required_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 += 1endif required_tpoints[1] != 0required_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 += 1endif required_tpoints[2] != 0required_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 += 1endif !required_tskills.empty?index = 0loop doreq_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.namereq_icon_index = req_skill.icon_indexif req_points == 1text = 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)elsetext = EME::SKILL_TREES::SKILL_AT_LVL_REQUIREMENT_ELSE.gsub("[_points]", req_points.to_s).gsub("[_skill]", req_skill_name)enddraw_text_ex(x, y + 24 * line_number, text)line_number += 1index += 1break if index == required_tskills.sizeendendif !required_levels.empty?index = 0loop dotext = 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 += 1index += 1break if index == required_levels.sizeendendif !required_skills.empty?index = 0loop dotext = 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 += 1index += 1break if index == required_skills.sizeendendif !required_switches.empty?index = 0loop doif 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)elsetext = EME::SKILL_TREES::SWITCH_REQUIREMENT[0].gsub("[_id]", required_switches[index][1].to_s)enddraw_text(x, y + 24 * line_number, 328, line_height, text)line_number += 1index += 1break if index == required_switches.sizeendendif !required_variables.empty?index = 0loop doif 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)elsetext = EME::SKILL_TREES::VARIABLE_REQUIREMENT[0].gsub("[_id]", required_variables[index][1].to_s).gsub("[_var]", required_variables[index][3].to_s)enddraw_text(x, y + 24 * line_number, 328, line_height, text)line_number += 1index += 1break if index == required_variables.sizeendendelsedraw_text(x, y + 24, 328, line_height, "None")endenddef get_requirementslevel = 2 + @actor.est_skill_level(@skill_object, @tree_id)requirements = @skill_object[level]requirements = 0 if requirements == nilreturn requirementsendend# Don't edit anything past this line unless you know what you're doing.#============================================================================## Game_Party# Adds memorize variables.#============================================================================class Game_Partyattr_accessor :est_last_object_indexattr_accessor :est_last_tree_idattr_accessor :est_last_actor_indexalias eme_est_something_something_dark_side initializedef initializeeme_est_something_something_dark_side@est_last_object_index = 0@est_last_tree_id = 0@est_last_actor_index = 0endend#============================================================================## Game_Actor# Adds needed individual variables and stuff.#============================================================================class Game_Actorattr_accessor :tree_pointsattr_accessor :total_tree_pointsattr_accessor :points_per_treeattr_accessor :tree_skillsalias eme_est_init_actor initializedef 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 == 0if EME::SKILL_TREES::TABLE_TREE_POINTSif 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]endelseif EME::SKILL_TREES::INDIVIDUAL_LEVEL_POINTS@tree_points = EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@actor_id] * (level - 1) if @actor_id >= 0else@tree_points = EME::SKILL_TREES::TREE_POINTS_PER_LEVEL * (level - 1)endendelseif EME::SKILL_TREES::TABLE_TREE_POINTSif 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]endelseif EME::SKILL_TREES::INDIVIDUAL_LEVEL_POINTS@tree_points = EME::SKILL_TREES::TREE_POINTS_PER_LEVEL[@class_id] * (level - 1) if @class_id >= 0else@tree_points = EME::SKILL_TREES::TREE_POINTS_PER_LEVEL * (level - 1)endendendendalias eme_est_level_up level_updef level_upeme_est_level_upif EME::SKILL_TREES::ACTOR_OR_CLASSES == 0if EME::SKILL_TREES::TABLE_TREE_POINTSif 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]endelseif 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_LEVELendendelseif EME::SKILL_TREES::TABLE_TREE_POINTSif 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]endelseif 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_LEVELendendendendalias eme_est_level_down level_downdef level_downeme_est_level_downif EME::SKILL_TREES::ACTOR_OR_CLASSES == 0if EME::SKILL_TREES::REMOVE_POINTS_ON_LEVEL_DOWNif EME::SKILL_TREES::TABLE_TREE_POINTSif 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]endelseif 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_LEVELendendendelseif EME::SKILL_TREES::REMOVE_POINTS_ON_LEVEL_DOWNif EME::SKILL_TREES::TABLE_TREE_POINTSif 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]endelseif 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_LEVELendendendendendalias eme_est_learn_skill learn_skilldef learn_skill(skill_id)eme_est_learn_skill(skill_id)@non_tree_skills.push(skill_id) unless @non_tree_skills.include?(skill_id)endalias eme_est_forget_skill forget_skilldef forget_skill(skill_id)eme_est_forget_skill(skill_id)@non_tree_skills.delete(skill_id)enddef learn_tree_skill(skill_id)unless skill_learn?($data_skills[skill_id])@skills.push(skill_id)@skills.sort!endenddef forget_tree_skill(skill_id)@skills.delete(skill_id)enddef est_tree_skill_learn?(skill_object, tree_id, level)@tree_skills[tree_id].include?(skill_object[1][level])enddef 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])enddef est_skill_level(skill_object, tree_id)current_skill = 0loop docase EME::SKILL_TREES::LEARN_MODEwhen 0break if skill_object[1][current_skill] == nilbreak unless est_tree_skill_learn?(skill_object, tree_id, current_skill)current_skill += 1when 1break if skill_object[1][current_skill] == nilbreak unless est_all_trees_skill_learn?(skill_object, current_skill)current_skill += 1when 2break if skill_object[1][current_skill] == nilbreak unless skill_learn?($data_skills[skill_object[1][current_skill]]) or est_all_trees_skill_learn?(skill_object, current_skill)current_skill += 1endendreturn current_skillenddef est_skill_maxed?(skill_object, tree_id)return true if est_skill_level(skill_object, tree_id) == est_skill_max_level(skill_object)enddef est_skill_max_level(skill_object)return skill_object[1].sizeenddef est_reset_all_treesfor i in 0..2est_reset_tree(i)endenddef 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] = []enddef est_learned_elswhere?(skill_id, tree_id)current_tree = 0for i in 0..2next if current_tree == tree_idreturn true if @tree_skills[tree_id].include?(skill_id)endreturn true if @non_tree_skills.include?(skill_id)return falseenddef est_trees_amountreturn 0 unless EME::SKILL_TREES::Trees_Per_Actor.has_key?(@actor_id) and EME::SKILL_TREES::ACTOR_OR_CLASSES == 0return 0 unless EME::SKILL_TREES::Trees_Per_Actor.has_key?(@class_id) and EME::SKILL_TREES::ACTOR_OR_CLASSES == 1count = 0for i in 0..2count += 1 if EME::SKILL_TREES::Trees_Per_Actor[@actor_id] != nil and EME::SKILL_TREES::ACTOR_OR_CLASSES == 0count += 1 if EME::SKILL_TREES::Trees_Per_Actor[@class_id] != nil and EME::SKILL_TREES::ACTOR_OR_CLASSES == 1endreturn countendend#============================================================================## Window_EST_Trees# The main window. This one depicts the current tree.#============================================================================class Window_EST_Trees < Window_Selectableattr_reader :dataattr_reader :objectsattr_reader :treesattr_reader :trees_per_actorattr_accessor :actorattr_accessor :tree_idattr_accessor :previous_skilldef 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_actorelseif $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]endend@trees = EME::SKILL_TREES::Trees@trees_per_actor = EME::SKILL_TREES::Trees_Per_Actor@objects = EME::SKILL_TREES::Objectsrefreshenddef item_max@data ? @data.size : 1enddef col_maxreturn 7enddef item_widthreturn 24enddef item_heightreturn 24enddef spacingreturn 0enddef select_lastif @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)elsecurrent_element = 0last_element = @data.size - 1loop doif current_element <= last_elementif @data[current_element] != nil and @objects[@data[current_element]][0] != "arrow_object"select(current_element)returnelsecurrent_element += 1endelseself.unselectendendendendalias eme_est_process_ok process_okdef process_okif current_skill_not_maxed?eme_est_process_okelseSound.play_buzzerendendalias eme_est_cursor_down cursor_downdef cursor_down(wrap = false)loop doif @index + col_max > @data.size - 1@index = 0if @data[@index] != nil and @objects[@data[@index]][0] != "arrow_object"select(0)breakelsecursor_right(wrap)breakendelsif @data[@index + col_max] != nil and @objects[@data[index + col_max]][0] != "arrow_object"eme_est_cursor_down(wrap)breakelseself.index += col_maxself.index = 0 if index > item_maxendend$game_party.est_last_object_index = @indexendalias eme_est_cursor_up cursor_updef cursor_up(wrap = false)loop doif @index - col_max < 0@index = item_maxif @data[@index] != nil and @objects[@data[@index]][0] != "arrow_object"select(item_max)breakelsecursor_left(wrap)breakendelsif @data[index - col_max] != nil and @objects[@data[index - col_max]][0] != "arrow_object"eme_est_cursor_up(wrap)breakelse@index -= col_max@index = 0 if @index < 0endend$game_party.est_last_object_index = @indexendalias eme_est_cursor_right cursor_rightdef cursor_right(wrap = false)loop doif index + 1 > @data.size - 1self.index = 0if @data[index] != nil and @objects[@data[index]][0] != "arrow_object"select(0)returnendelsif @data[index + 1] != nil and @objects[@data[index + 1]][0] != "arrow_object"breakelseself.index += 1self.index = 0 if index > item_maxendendeme_est_cursor_right(wrap)$game_party.est_last_object_index = @indexendalias eme_est_cursor_left cursor_leftdef cursor_left(wrap = false)loop doif index - 1 < 0self.index = @data.size - 1if @data[index] != nil and @objects[@data[index]][0] != "arrow_object"select(@data.size - 1)returnendelsif @data[index - 1] != nil and @objects[@data[index - 1]][0] != "arrow_object"breakelseself.index -= 1self.index = 0 if index > item_maxendendeme_est_cursor_left(wrap)$game_party.est_last_object_index = @indexenddef enable_arrow?(arrow_object)for i in 2...arrow_object.sizereturn false unless enable_skill?(@objects[arrow_object], true)endreturn trueenddef 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]endwhen "skill"return false unless @actor.skill_learn?($data_skills[requirement[1]])when "switch"if requirement[2]return false unless $game_switches[requirement[1]]elsereturn false if $game_switches[requirement[1]]endwhen "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]endend}return trueenddef current_item_enabled?return false if @data[index] == nilcase @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]])endreturn falseenddef current_skill_not_maxed?return false if @data[index] == nilcase @objects[@data[index]][0]when "skill_object"return true unless @actor.est_skill_maxed?(@objects[@data[index]], @tree_id)endreturn falseenddef make_tree_dataid = @actor.id if EME::SKILL_TREES::ACTOR_OR_CLASSES == 0id = @actor.class_id if EME::SKILL_TREES::ACTOR_OR_CLASSES == 1if @trees_per_actor[id] != nilif @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 = nilendelse@data = nilendenddef draw_item(index)if @data[index] != nilobject = @objects[@data[index]]rect = item_rect(index)rect.width -= 4if 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].maxdraw_icon($data_skills[object[1][skill_level_2]].icon_index, rect.x, rect.y, enable_skill?(object, false))contents.font.size = 16unless EME::SKILL_TREES::LEVEL_DISPLAY_TYPE == 0unless @actor.est_skill_maxed?(object, @tree_id)if EME::SKILL_TREES::LEVEL_DISPLAY_TYPE == 1draw_text(rect.x + 2, rect.y + 4, 24, line_height, skill_level.to_s)elsemax_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)endelsedraw_text(rect.x + 2, rect.y + 4, 24, line_height, "MAX")endendendendenddef refreshmake_tree_datacreate_contentsdraw_all_itemsselect_lastendend#============================================================================## Window_EST_Selection# Window which enables the player to select the differen trees.#============================================================================class Window_EST_Selection < Window_HorzCommandattr_accessor :actor_iddef initialize@actor_id = 0super(0, 0)enddef window_widthGraphics.widthenddef col_maxreturn 3enddef updatesupercase current_symbolwhen :tree_1$game_party.est_last_tree_id = 0when :tree_2$game_party.est_last_tree_id = 1when :tree_3$game_party.est_last_tree_id = 2endenddef make_command_listif 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] != niladd_command(EME::SKILL_TREES::Trees_Per_Actor[@actor_id][4], :tree_2) if EME::SKILL_TREES::Trees_Per_Actor[@actor_id][1] != niladd_command(EME::SKILL_TREES::Trees_Per_Actor[@actor_id][5], :tree_3) if EME::SKILL_TREES::Trees_Per_Actor[@actor_id][2] != nilendendalias eme_est_i_need_something_original refreshdef refresheme_est_i_need_something_originalclear_command_listmake_command_listendend#============================================================================## Window_EST_Information# Window which shows all needed information.#============================================================================class Window_EST_Information < Window_Baseattr_accessor :actorattr_accessor :tree_idattr_accessor :skill_objectdef initializesuper(7 * 24 + 24, 48, Graphics.width - 7 * 24 - 24, Graphics.height - 48)@actor = nil@tree_id = 0@skill_object = ["", [0], ["points", 0]]endend#============================================================================## Window_MenuCommand# Adds the skill trees menu command.#============================================================================class Window_MenuCommandalias eme_est_original_commands add_original_commandsdef add_original_commandseme_est_original_commandsadd_command(EME::SKILL_TREES::MENU_VOCAB, :talents) if EME::SKILL_TREES::USE_MENU_COMMANDendend#============================================================================## Scene_Menu# Adds the handler to access the skill trees scene from the menu.#============================================================================class Scene_Menualias eme_est_create_command_window create_command_windowdef create_command_windoweme_est_create_command_windowif EME::SKILL_TREES::USE_MENU_COMMANDif EME::SKILL_TREES::FIRST_SELECT_ACTOR@command_window.set_handler(:talents, method(:command_personal))else@command_window.set_handler(:talents, method(:talents_scene))endendenddef talents_sceneunless EME::SKILL_TREES::FIRST_SELECT_ACTORSceneManager.call(Scene_SkillTrees)else@status_window.activate@status_window.select($game_party.members.index($game_party.menu_actor))endendalias eme_est_personal_ok on_personal_okdef on_personal_okif @command_window.current_symbol == :talentsSceneManager.call(Scene_SkillTrees)elseeme_est_personal_okendendend#============================================================================## Scene_SkillTrees# New scene to learn skills from the trees.#============================================================================class Scene_SkillTrees < Scene_MenuBasedef startsupercreate_skill_treescreate_skill_trees_selectioncreate_info_window@skill_trees_selection.deactivate@skill_trees_selection.unselect@skill_tree.activateenddef updatesuper@skill_tree.active ? @last_window = "trees" : @last_window = "selection"any_change = falseany_change_2 = falseif @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 = trueendif @info_window.tree_id != $game_party.est_last_tree_id@info_window.tree_id = $game_party.est_last_tree_idany_change = trueendif @skill_tree.tree_id != $game_party.est_last_tree_id@skill_tree.tree_id = $game_party.est_last_tree_idany_change = trueendif any_change@skill_tree.refresh@skill_tree.select_last@info_window.skill_object = @skill_tree.objects[@skill_tree.data[@skill_tree.index]]@skill_tree.unselectend@info_window.refresh if any_change or any_change_2if Input.press?(:X)@info_window.oy -= 2 unless @info_window.oy == 0elsif Input.press?(:Y)@info_window.oy += 2 unless @info_window.oy == @info_window.contents_height - @info_window.original_contents_heightendenddef 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))enddef 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))enddef 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 = @viewportenddef switch_to_tree@skill_trees_selection.deactivate@skill_trees_selection.unselect@skill_tree.activate@skill_tree.select_lastenddef switch_to_selection@skill_tree.deactivate@skill_tree.unselect@skill_trees_selection.activateid = @skill_tree.tree_idif EME::SKILL_TREES::ACTOR_OR_CLASSES == 0id -= 1 if EME::SKILL_TREES::Trees_Per_Actor[@skill_tree.actor.id][1] == nil and id > 1id -= 1 if EME::SKILL_TREES::Trees_Per_Actor[@skill_tree.actor.id][0] == nilelseid -= 1 if EME::SKILL_TREES::Trees_Per_Actor[@skill_tree.actor.class_id][1] == nil and id > 1id -= 1 if EME::SKILL_TREES::Trees_Per_Actor[@skill_tree.actor.class_id][0] == nilend@skill_trees_selection.select(id || 0)enddef actor_left$game_party.menu_actor = @skill_tree.actor$game_party.menu_actor_prev@skill_tree.actor = $game_party.menu_actorif (@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.activeenddef actor_right$game_party.menu_actor = @skill_tree.actor$game_party.menu_actor_next@skill_tree.actor = $game_party.menu_actorif (@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.activeenddef learn_skillobject = @skill_tree.objects[@skill_tree.data[@skill_tree.index]]unless @actor.est_skill_maxed?(object, @skill_tree.tree_id)current_element = 0cost = 0loop doif 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]breakelsecurrent_element += 1endend@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.activateendend end Share this post Link to post Share on other sites
Nicke 151 Posted January 6, 2013 Trying adding this to the list instead: :talents => ["", "Modify your talents", 4135, true, true, Scene_SkillTrees], 1 Share this post Link to post Share on other sites
Rylix 0 Posted January 6, 2013 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
DSkyo 1 Posted January 13, 2013 (edited) 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 endThe 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] = enabledto $game_system.menu_list[key][3] = enabled allowed the function to work.Note - I have tested on a blank project to double check. Edited January 13, 2013 by DSkyo Share this post Link to post Share on other sites
Nicke 151 Posted January 13, 2013 Thanks, I have released a updated version now. Should work as intended now. Share this post Link to post Share on other sites
DSkyo 1 Posted January 13, 2013 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
Nicke 151 Posted January 13, 2013 Ah should work now. Share this post Link to post Share on other sites
Anderson88 26 Posted January 14, 2013 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
RequLz 1 Posted January 14, 2013 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
whitesf0791 1 Posted January 20, 2013 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 Share this post Link to post Share on other sites
HellKiteChaoS 36 Posted January 20, 2013 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
lookerup 32 Posted January 21, 2013 (edited) This script makes everything look so clean, including the test/message box. Edited January 21, 2013 by lookerup Share this post Link to post Share on other sites