Hyomoto 1 Posted March 24, 2012 (edited) Hello, I'm a new member here and I was hoping to at least extend an olive branch so I'm not a total newbie. Since Yanfly is currently taking a break, I've come across a few minor bugs in his message scripts which I have fixed and will share with the community. Also, I've made an update to his Input Combo System you might enjoy if you are using that particular script. Ace Message System. When you tint the screen, the ChoiceList and Gold windows will also be tinted, this fixes the z of those windows to be above the effect (which is how the name window works). There's also a \em[x] tag added which allows you to change the face index. This is for actors who have various emotions, you can select which one should be showing without changing the actor's face. #============================================================================== # # â–¼ Yanfly Engine Ace - Ace Message System v1.04 # -- Last Updated: 2012.03.24 # -- Level: Normal # -- Requires: n/a # #============================================================================== $imported = {} if $imported.nil? $imported["YEA-MessageSystem"] = true #============================================================================== # â–¼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2012.03.24 - Fixed z bug in Window_ChoiceList and Window_Gold. # 2012.01.13 - Bug Fixed: Negative tags didn't display other party members. # 2012.01.12 - Compatibility Update: Message Actor Codes # 2012.01.10 - Added Feature: \pic[x] text code. # 2012.01.04 - Bug Fixed: \ic tag was \ii. No longer the case. # - Added: Scroll Text window now uses message window font. # 2011.12.31 - Started Script and Finished. # #============================================================================== # â–¼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # While RPG Maker VX Ace certainly improved the message system a whole lot, it # wouldn't hurt to add in a few more features, such as name windows, converting # textcodes to write out the icons and/or names of items, weapons, armours, and # more in quicker fashion. This script also gives the developer the ability to # adjust the size of the message window during the game, give it a separate # font, and to give the player a text fast-forward feature. # #============================================================================== # â–¼ 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. # # ----------------------------------------------------------------------------- # Message Window text Codes - These go inside of your message window. # ----------------------------------------------------------------------------- # Default: Effect: # \v[x] - Writes variable x's value. # \n[x] - Writes actor x's name. # \p[x] - Writes party member x's name. # \g - Writes gold currency name. # \c[x] - Changes the colour of the text to x. # \i[x] - Draws icon x at position of the text. # \{ - Makes text bigger by 8 points. # \} - Makes text smaller by 8 points. # \$ - Opens gold window. # \. - Waits 15 frames (quarter second). # \| - Waits 60 frames (a full second). # \! - Waits until key is pressed. # \> - Following text is instant. # \< - Following text is no longer instant. # \^ - Skips to the next message. # \\ - Writes a "\" in the window. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # \em[x] -Changes the face_index to x. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Wait: Effect: # \w[x] - Waits x frames (60 frames = 1 second). Message window only. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # NameWindow: Effect: # \n<x> - Creates a name box with x string. Left side. *Note # \nc<x> - Creates a name box with x string. Centered. *Note # \nr<x> - Creates a name box with x string. Right side. *Note # # *Note: Works for message window only. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Position: Effect: # \px[x] - Sets x position of text to x. # \py[x] - Sets y position of text to y. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Picture: Effect: # \pic[x] - Draws picture x from the Graphics\Pictures folder. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Outline: Effect: # \oc[x] - Sets outline colour to x. # \oo[x] - Sets outline opacity to x. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Font: Effect: # \fr - Resets all font changes. # \fz[x] - Changes font size to x. # \fn[x] - Changes font name to x. # \fb - Toggles font boldness. # \fi - Toggles font italic. # \fo - Toggles font outline. # \fs - Toggles font shadow. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Actor: Effect: # \em[x] - Changes face_index to x. For faces with emotions. !Note # \af[x] - Shows face of actor x. *Note # \ac[x] - Writes out actor's class name. *Note # \as[x] - Writes out actor's subclass name. Req: Class System. *Note # \an[x] - Writes out actor's nickname. *Note # # !Note: Personal modification # *Note: If x is 0 or negative, it will show the respective # party member's face instead. # 0 - Party Leader # -1 - 1st non-leader member. # -2 - 2nd non-leader member. So on. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Names: Effect: # \nc[x] - Writes out class x's name. # \ni[x] - Writes out item x's name. # \nw[x] - Writes out weapon x's name. # \na[x] - Writes out armour x's name. # \ns[x] - Writes out skill x's name. # \nt[x] - Writes out state x's name. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Icon Names: Effect: # \ic[x] - Writes out class x's name including icon. * # \ii[x] - Writes out item x's name including icon. # \iw[x] - Writes out weapon x's name including icon. # \ia[x] - Writes out armour x's name including icon. # \is[x] - Writes out skill x's name including icon. # \it[x] - Writes out state x's name including icon. # # *Note: Requires YEA - Class System # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # And those are the text codes added with this script. Keep in mind that some # of these text codes only work for the Message Window. Otherwise, they'll work # for help descriptions, actor biographies, and others. # #============================================================================== # â–¼ Compatibility # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that # it will run with RPG Maker VX without adjusting. # #============================================================================== module YEA module MESSAGE #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - General Message Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # The following below will adjust the basic settings and that will affect # the majority of the script. Adjust them as you see fit. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This button is the button used to make message windows instantly skip # forward. Hold down for the effect. Note that when held down, this will # speed up the messages, but still wait for the pauses. However, it will # automatically go to the next page when prompted. TEXT_SKIP = :A # Input::A is the shift button on keyboard. # This variable adjusts the number of visible rows shown in the message # window. If you do not wish to use this feature, set this constant to 0. # If the row value is 0 or below, it will automatically default to 4 rows. VARIABLE_ROWS = 21 # This variable adjusts the width of the message window shown. If you do # not wish to use this feature, set this constant to 0. If the width value # is 0 or below, it will automatically default to the screen width. VARIABLE_WIDTH = 22 # This is the amount of space that the message window will indent whenever # a face is used. Default: 112 FACE_INDENT_X = 112 #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Name Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # The name window is a window that appears outside of the main message # window box to display whatever text is placed inside of it like a name. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- NAME_WINDOW_X_BUFFER = -20 # Buffer x position of the name window. NAME_WINDOW_Y_BUFFER = 0 # Buffer y position of the name window. NAME_WINDOW_PADDING = 20 # Padding added to the horizontal position. NAME_WINDOW_OPACITY = 255 # Opacity of the name window. NAME_WINDOW_COLOUR = 6 # Text colour used by default for names. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Message Font Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # Ace Message System separates the in-game system font form the message # font. Adjust the settings here for your fonts. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This array constant determines the fonts used. If the first font does not # exist on the player's computer, the next font in question will be used # in place instead and so on. MESSAGE_WINDOW_FONT_NAME = ["Dark11", "Verdana", "Arial", "Courier New"] # These adjust the other settings regarding the way the game font appears # including the font size, whether or not the font is bolded by default, # italic by default, etc. MESSAGE_WINDOW_FONT_SIZE = 24 # Font size. MESSAGE_WINDOW_FONT_BOLD = false # Default bold? MESSAGE_WINDOW_FONT_ITALIC = false # Default italic? MESSAGE_WINDOW_FONT_OUTLINE = true # Default outline? MESSAGE_WINDOW_FONT_SHADOW = false # Default shadow? end # MESSAGE end # YEA #============================================================================== # â–¼ Editting anything past this point may potentially result in causing # computer damage, incontinence, explosion of user's head, coma, death, and/or # halitosis so edit at your own risk. #============================================================================== #============================================================================== # â– Variable #============================================================================== module Variable #-------------------------------------------------------------------------- # self.message_rows #-------------------------------------------------------------------------- def self.message_rows return 4 if YEA::MESSAGE::VARIABLE_ROWS <= 0 return 4 if $game_variables[YEA::MESSAGE::VARIABLE_ROWS] <= 0 return $game_variables[YEA::MESSAGE::VARIABLE_ROWS] end #-------------------------------------------------------------------------- # self.message_width #-------------------------------------------------------------------------- def self.message_width return Graphics.width if YEA::MESSAGE::VARIABLE_WIDTH <= 0 return Graphics.width if $game_variables[YEA::MESSAGE::VARIABLE_WIDTH] <= 0 return $game_variables[YEA::MESSAGE::VARIABLE_WIDTH] end end # Variable #============================================================================== # â– Game_Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # overwrite method: command_101 #-------------------------------------------------------------------------- def command_101 wait_for_message $game_message.face_name = @params[0] $game_message.face_index = @params[1] $game_message.background = @params[2] $game_message.position = @params[3] while continue_message_string? @index += 1 if @list[@index].code == 401 $game_message.add(@list[@index].parameters[0]) end break if $game_message.texts.size >= Variable.message_rows end case next_event_code when 102 @index += 1 setup_choices(@list[@index].parameters) when 103 @index += 1 setup_num_input(@list[@index].parameters) when 104 @index += 1 setup_item_choice(@list[@index].parameters) end wait_for_message end #-------------------------------------------------------------------------- # new method: continue_message_string? #-------------------------------------------------------------------------- def continue_message_string? return true if next_event_code == 101 && Variable.message_rows > 4 return next_event_code == 401 end end # Game_Interpreter #============================================================================== # â– Window_Base #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # new method: setup_message_font #-------------------------------------------------------------------------- def setup_message_font @message_font = true change_color(normal_color) contents.font.out_color = Font.default_out_color contents.font.name = YEA::MESSAGE::MESSAGE_WINDOW_FONT_NAME contents.font.size = YEA::MESSAGE::MESSAGE_WINDOW_FONT_SIZE contents.font.bold = YEA::MESSAGE::MESSAGE_WINDOW_FONT_BOLD contents.font.italic = YEA::MESSAGE::MESSAGE_WINDOW_FONT_ITALIC contents.font.outline = YEA::MESSAGE::MESSAGE_WINDOW_FONT_OUTLINE contents.font.shadow = YEA::MESSAGE::MESSAGE_WINDOW_FONT_SHADOW end #-------------------------------------------------------------------------- # alias method: reset_font_settings #-------------------------------------------------------------------------- alias window_base_reset_font_settings_ams reset_font_settings def reset_font_settings if @message_font setup_message_font else window_base_reset_font_settings_ams contents.font.out_color = Font.default_out_color contents.font.outline = Font.default_outline contents.font.shadow = Font.default_shadow end end #-------------------------------------------------------------------------- # alias method: convert_escape_characters #-------------------------------------------------------------------------- alias window_base_convert_escape_characters_ams convert_escape_characters def convert_escape_characters(text) result = window_base_convert_escape_characters_ams(text) result = convert_ace_message_system_new_escape_characters(result) return result end #-------------------------------------------------------------------------- # new method: convert_ace_message_system_new_escape_characters #-------------------------------------------------------------------------- def convert_ace_message_system_new_escape_characters(result) #--- result.gsub!(/\eFR/i) { "\eAMSF[0]" } result.gsub!(/\eFB/i) { "\eAMSF[1]" } result.gsub!(/\eFI/i) { "\eAMSF[2]" } result.gsub!(/\eFO/i) { "\eAMSF[3]" } result.gsub!(/\eFS/i) { "\eAMSF[4]" } #--- result.gsub!(/\eEM\[(\d+)\]/i) { change_emote($1.to_i) } result.gsub!(/\eAC\[([-+]?\d+)\]/i) { escape_actor_class_name($1.to_i) } result.gsub!(/\eAS\[([-+]?\d+)\]/i) { escape_actor_subclass_name($1.to_i) } result.gsub!(/\eAN\[([-+]?\d+)\]/i) { escape_actor_nickname($1.to_i) } #--- result.gsub!(/\eNC\[(\d+)\]/i) { $data_classes[$1.to_i].name } result.gsub!(/\eNI\[(\d+)\]/i) { $data_items[$1.to_i].name } result.gsub!(/\eNW\[(\d+)\]/i) { $data_weapons[$1.to_i].name } result.gsub!(/\eNA\[(\d+)\]/i) { $data_armors[$1.to_i].name } result.gsub!(/\eNS\[(\d+)\]/i) { $data_skills[$1.to_i].name } result.gsub!(/\eNT\[(\d+)\]/i) { $data_states[$1.to_i].name } #--- result.gsub!(/\eIC\[(\d+)\]/i) { escape_icon_item($1.to_i, :class) } result.gsub!(/\eII\[(\d+)\]/i) { escape_icon_item($1.to_i, :item) } result.gsub!(/\eIW\[(\d+)\]/i) { escape_icon_item($1.to_i, :weapon) } result.gsub!(/\eIA\[(\d+)\]/i) { escape_icon_item($1.to_i, :armour) } result.gsub!(/\eIS\[(\d+)\]/i) { escape_icon_item($1.to_i, :skill) } result.gsub!(/\eIT\[(\d+)\]/i) { escape_icon_item($1.to_i, :state) } #--- return result end #-------------------------------------------------------------------------- # new method: escape_actor_class_name #-------------------------------------------------------------------------- def escape_actor_class_name(actor_id) actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0 actor = $game_actors[actor_id] return "" if actor.nil? return actor.class.name end #-------------------------------------------------------------------------- # new method: actor_subclass_name #-------------------------------------------------------------------------- def escape_actor_subclass_name(actor_id) return "" unless $imported["YEA-ClassSystem"] actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0 actor = $game_actors[actor_id] return "" if actor.nil? return "" if actor.subclass.nil? return actor.subclass.name end #-------------------------------------------------------------------------- # new method: escape_actor_nickname #-------------------------------------------------------------------------- def escape_actor_nickname(actor_id) actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0 actor = $game_actors[actor_id] return "" if actor.nil? return actor.nickname end #-------------------------------------------------------------------------- # new method: escape_icon_item #-------------------------------------------------------------------------- def escape_icon_item(data_id, type) case type when :class return "" unless $imported["YEA-ClassSystem"] icon = $data_classes[data_id].icon_index name = $data_items[data_id].name when :item icon = $data_items[data_id].icon_index name = $data_items[data_id].name when :weapon icon = $data_weapons[data_id].icon_index name = $data_weapons[data_id].name when :armour icon = $data_armors[data_id].icon_index name = $data_armors[data_id].name when :skill icon = $data_skills[data_id].icon_index name = $data_skills[data_id].name when :state icon = $data_states[data_id].icon_index name = $data_states[data_id].name else; return "" end text = "\eI[#{icon}]" + name return text end #-------------------------------------------------------------------------- # alias method: process_escape_character #-------------------------------------------------------------------------- alias window_base_process_escape_character_ams process_escape_character def process_escape_character(code, text, pos) case code.upcase #--- when 'FZ' contents.font.size = obtain_escape_param(text) when 'FN' text.sub!(/\[(.*?)\]/, "") font_name = $1.to_s font_name = Font.default_name if font_name.nil? contents.font.name = font_name.to_s #--- when 'OC' colour = text_color(obtain_escape_param(text)) contents.font.out_color = colour when 'OO' contents.font.out_color.alpha = obtain_escape_param(text) #--- when 'AMSF' case obtain_escape_param(text) when 0; reset_font_settings when 1; contents.font.bold = !contents.font.bold when 2; contents.font.italic = !contents.font.italic when 3; contents.font.outline = !contents.font.outline when 4; contents.font.shadow = !contents.font.shadow end #--- when 'PX' pos[:x] = obtain_escape_param(text) when 'PY' pos[:y] = obtain_escape_param(text) #--- when 'PIC' text.sub!(/\[(.*?)\]/, "") bmp = Cache.picture($1.to_s) rect = Rect.new(0, 0, bmp.width, bmp.height) contents.blt(pos[:x], pos[:y], bmp, rect) #--- else window_base_process_escape_character_ams(code, text, pos) end end end # Window_Base #============================================================================== # â– Window_Gold #============================================================================== class Window_Gold < Window_Base #-------------------------------------------------------------------------- # alias method: initialize #-------------------------------------------------------------------------- alias window_gold_initialize_ams initialize def initialize window_gold_initialize_ams self.z = 200 setup_message_font end end # Window_Gold #============================================================================== # â– Window_ChoiceList #============================================================================== class Window_ChoiceList < Window_Command #-------------------------------------------------------------------------- # alias method: initialize #-------------------------------------------------------------------------- alias window_choicelist_initialize_ams initialize def initialize(message_window) window_choicelist_initialize_ams(message_window) self.z = @message_window.z + 1 setup_message_font end end # Window_ChoiceList #============================================================================== # â– Window_ScrollText #============================================================================== class Window_ScrollText < Window_Base #-------------------------------------------------------------------------- # alias method: initialize #-------------------------------------------------------------------------- alias window_scrolltext_initialize_ams initialize def initialize window_scrolltext_initialize_ams setup_message_font end end # Window_ScrollText #============================================================================== # â– Window_NameMessage #============================================================================== class Window_NameMessage < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(message_window) @message_window = message_window super(0, 0, Graphics.width, fitting_height(1)) self.opacity = YEA::MESSAGE::NAME_WINDOW_OPACITY self.z = @message_window.z + 1 self.openness = 0 setup_message_font @close_counter = 0 deactivate end #-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- def update super return if self.active return if self.openness == 0 return if @closing @close_counter -= 1 return if @close_counter > 0 close end #-------------------------------------------------------------------------- # start_close #-------------------------------------------------------------------------- def start_close @close_counter = 4 deactivate end #-------------------------------------------------------------------------- # force_close #-------------------------------------------------------------------------- def force_close @close_counter = 0 deactivate close end #-------------------------------------------------------------------------- # start #-------------------------------------------------------------------------- def start(text, x_position) @text = text.clone set_width create_contents set_x_position(x_position) set_y_position refresh activate open end #-------------------------------------------------------------------------- # set_width #-------------------------------------------------------------------------- def set_width text = @text.clone dw = standard_padding * 2 + text_size(text).width dw += YEA::MESSAGE::NAME_WINDOW_PADDING * 2 dw += calculate_size(text.slice!(0, 1), text) until text.empty? self.width = dw end #-------------------------------------------------------------------------- # calculate_size #-------------------------------------------------------------------------- def calculate_size(code, text) case code when "\e" return calculate_escape_code_width(obtain_escape_code(text), text) else return 0 end end #-------------------------------------------------------------------------- # calculate_escape_code_width #-------------------------------------------------------------------------- def calculate_escape_code_width(code, text) dw = -text_size("\e").width - text_size(code).width case code.upcase when 'C', 'OC', 'OO' dw += -text_size("[" + obtain_escape_param(text).to_s + "]").width return dw when 'I' dw += -text_size("[" + obtain_escape_param(text).to_s + "]").width dw += 24 return dw when '{' make_font_bigger when '}' make_font_smaller when 'FZ' contents.font.size = obtain_escape_param(text) when 'FN' text.sub!(/\[(.*?)\]/, "") font_name = $1.to_s font_name = Font.default_name if font_name.nil? contents.font.name = font_name.to_s when 'AMSF' case obtain_escape_param(text) when 0; reset_font_settings when 1; contents.font.bold = !contents.font.bold when 2; contents.font.italic = !contents.font.italic when 3; contents.font.outline = !contents.font.outline when 4; contents.font.shadow = !contents.font.shadow end else return dw end end #-------------------------------------------------------------------------- # set_y_position #-------------------------------------------------------------------------- def set_x_position(x_position) case x_position when 1 # Left self.x = @message_window.x self.x += YEA::MESSAGE::NAME_WINDOW_X_BUFFER when 2 # 3/10 self.x = @message_window.x self.x += @message_window.width * 3 / 10 self.x -= self.width / 2 when 3 # Center self.x = @message_window.x self.x += @message_window.width / 2 self.x -= self.width / 2 when 4 # 7/10 self.x = @message_window.x self.x += @message_window.width * 7 / 10 self.x -= self.width / 2 when 5 # Right self.x = @message_window.x + @message_window.width self.x -= self.width self.x -= YEA::MESSAGE::NAME_WINDOW_X_BUFFER end self.x = [[self.x, Graphics.width - self.width].min, 0].max end #-------------------------------------------------------------------------- # set_y_position #-------------------------------------------------------------------------- def set_y_position case $game_message.position when 0 self.y = @message_window.height self.y -= YEA::MESSAGE::NAME_WINDOW_Y_BUFFER else self.y = @message_window.y - self.height self.y += YEA::MESSAGE::NAME_WINDOW_Y_BUFFER end end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh contents.clear reset_font_settings @text = sprintf("\eC[%d]%s", YEA::MESSAGE::NAME_WINDOW_COLOUR, @text) draw_text_ex(YEA::MESSAGE::NAME_WINDOW_PADDING, 0, @text) end end # Window_NameMessage #============================================================================== # â– Window_Message #============================================================================== class Window_Message < Window_Base #-------------------------------------------------------------------------- # alias method: initialize #-------------------------------------------------------------------------- alias window_message_initialize_ams initialize def initialize window_message_initialize_ams setup_message_font end #-------------------------------------------------------------------------- # overwrite method: window_width #-------------------------------------------------------------------------- def window_width return Variable.message_width end #-------------------------------------------------------------------------- # overwrite method: window_height #-------------------------------------------------------------------------- def window_height return fitting_height(Variable.message_rows) end #-------------------------------------------------------------------------- # alias method: create_all_windows #-------------------------------------------------------------------------- alias window_message_create_all_windows_ams create_all_windows def create_all_windows window_message_create_all_windows_ams @name_window = Window_NameMessage.new(self) end #-------------------------------------------------------------------------- # overwrite method: create_back_bitmap #-------------------------------------------------------------------------- def create_back_bitmap @back_bitmap = Bitmap.new(width, height) rect1 = Rect.new(0, 0, Graphics.width, 12) rect2 = Rect.new(0, 12, Graphics.width, fitting_height(4) - 24) rect3 = Rect.new(0, fitting_height(4) - 12, Graphics.width, 12) @back_bitmap.gradient_fill_rect(rect1, back_color2, back_color1, true) @back_bitmap.fill_rect(rect2, back_color1) @back_bitmap.gradient_fill_rect(rect3, back_color1, back_color2, true) end #-------------------------------------------------------------------------- # alias method: dispose_all_windows #-------------------------------------------------------------------------- alias window_message_dispose_all_windows_ams dispose_all_windows def dispose_all_windows window_message_dispose_all_windows_ams @name_window.dispose end #-------------------------------------------------------------------------- # alias method: update_all_windows #-------------------------------------------------------------------------- alias window_message_update_all_windows_ams update_all_windows def update_all_windows window_message_update_all_windows_ams @name_window.update @name_window.back_opacity = self.back_opacity @name_window.opacity = self.opacity end #-------------------------------------------------------------------------- # alias method: update_show_fast #-------------------------------------------------------------------------- alias window_message_update_show_fast_ams update_show_fast def update_show_fast @show_fast = true if Input.press?(YEA::MESSAGE::TEXT_SKIP) window_message_update_show_fast_ams end #-------------------------------------------------------------------------- # overwrite method: input_pause #-------------------------------------------------------------------------- def input_pause self.pause = true wait(10) Fiber.yield until Input.trigger?(: || Input.trigger?(:C) || Input.press?(YEA::MESSAGE::TEXT_SKIP) Input.update self.pause = false end #-------------------------------------------------------------------------- # overwrite method: convert_escape_characters #-------------------------------------------------------------------------- def convert_escape_characters(text) result = super(text.to_s.clone) result = namebox_escape_characters(result) result = message_escape_characters(result) return result end #-------------------------------------------------------------------------- # new method: namebox_escape_characters #-------------------------------------------------------------------------- def namebox_escape_characters(result) result.gsub!(/\eN\<(.+?)\>/i) { namewindow($1, 1) } result.gsub!(/\eN1\<(.+?)\>/i) { namewindow($1, 1) } result.gsub!(/\eN2\<(.+?)\>/i) { namewindow($1, 2) } result.gsub!(/\eNC\<(.+?)\>/i) { namewindow($1, 3) } result.gsub!(/\eN3\<(.+?)\>/i) { namewindow($1, 3) } result.gsub!(/\eN4\<(.+?)\>/i) { namewindow($1, 4) } result.gsub!(/\eN5\<(.+?)\>/i) { namewindow($1, 5) } result.gsub!(/\eNR\<(.+?)\>/i) { namewindow($1, 5) } return result end #-------------------------------------------------------------------------- # new method: namebox #-------------------------------------------------------------------------- def namewindow(text, position) @name_text = text @name_position = position return "" end #-------------------------------------------------------------------------- # new method: message_escape_characters #-------------------------------------------------------------------------- def message_escape_characters(result) result.gsub!(/\eAF\[(\d+)\]/i) { change_face($1.to_i) } return result end #-------------------------------------------------------------------------- # new method: change_face #-------------------------------------------------------------------------- def change_face(actor_id) actor_id = $game_party.members[actor_id.abs].id if actor_id <= 0 actor = $game_actors[actor_id] return "" if actor.nil? $game_message.face_name = actor.face_name $game_message.face_index = actor.face_index return "" end #-------------------------------------------------------------------------- # new method: change_emote #-------------------------------------------------------------------------- def change_emote(face_index) $game_message.face_index = face_index return "" end #-------------------------------------------------------------------------- # alias method: new_page #-------------------------------------------------------------------------- alias window_message_new_page_ams new_page def new_page(text, pos) adjust_message_window_size window_message_new_page_ams(text, pos) end #-------------------------------------------------------------------------- # overwrite method: new_line_x #-------------------------------------------------------------------------- def new_line_x return $game_message.face_name.empty? ? 0 : YEA::MESSAGE::FACE_INDENT_X end #-------------------------------------------------------------------------- # new method: adjust_message_window_size #-------------------------------------------------------------------------- def adjust_message_window_size self.height = window_height self.width = window_width create_contents update_placement self.x = (Graphics.width - self.width) / 2 start_name_window end #-------------------------------------------------------------------------- # new method: clear_name_window #-------------------------------------------------------------------------- def clear_name_window @name_text = "" @name_position = 0 end #-------------------------------------------------------------------------- # new method: start_name_window #-------------------------------------------------------------------------- def start_name_window return if @name_text == "" @name_window.start(@name_text, @name_position) end #-------------------------------------------------------------------------- # overwrite method: fiber_main #-------------------------------------------------------------------------- def fiber_main $game_message.visible = true update_background update_placement loop do process_all_text if $game_message.has_text? process_input $game_message.clear @gold_window.close @name_window.start_close Fiber.yield break unless text_continue? end close_and_wait $game_message.visible = false @fiber = nil end #-------------------------------------------------------------------------- # alias method: open_and_wait #-------------------------------------------------------------------------- alias window_message_open_and_wait_ams open_and_wait def open_and_wait clear_name_window adjust_message_window_size window_message_open_and_wait_ams end #-------------------------------------------------------------------------- # alias method: close_and_wait #-------------------------------------------------------------------------- alias window_message_close_and_wait_ams close_and_wait def close_and_wait @name_window.force_close window_message_close_and_wait_ams end #-------------------------------------------------------------------------- # alias method: all_close? #-------------------------------------------------------------------------- alias window_message_all_close_ams all_close? def all_close? return window_message_all_close_ams && @name_window.close? end #-------------------------------------------------------------------------- # alias method: process_escape_character #-------------------------------------------------------------------------- alias window_message_process_escape_character_ams process_escape_character def process_escape_character(code, text, pos) case code.upcase when 'W' # Wait wait(obtain_escape_param(text)) else window_message_process_escape_character_ams(code, text, pos) end end end # Window_Message #============================================================================== # # â–¼ End of File # #============================================================================== This is the Gab Window. It has the same bug as mentioned above, and the same fix. #============================================================================== # # â–¼ Yanfly Engine Ace - Gab Window v1.00 # -- Last Updated: 2012.03.24 # -- Level: Normal # -- Requires: n/a # #============================================================================== $imported = {} if $imported.nil? $imported["YEA-GabWindow"] = true #============================================================================== # â–¼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2012.03.24 - Fixed z bug. # 2012.01.23 - Started Script and Finished. # #============================================================================== # â–¼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Sometimes there's random jibber jabber that does not warrant a message box. # The Gab Window fulfills that jibber jabber by placing such text outside of # the message window box and at the corner of the screen. The gab text will # appear briefly and then disappear, not showing up again until the gab text is # updated with something else. # #============================================================================== # â–¼ 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. # # ----------------------------------------------------------------------------- # Script Calls - These commands are used with script calls. # ----------------------------------------------------------------------------- # These script calls can only be used from a map. The Gab Window will not # appear in battle or anywhere else. # # gab(string) # This will cause the Gab Window to appear with the string shown. Text codes # can be used inside the string. When using text codes, remember to use "\\" # for a single slash. # # gab(string, actor_id) # This will cause the Gab Window to appear with the string and the actor's # sprite. Text codes can be used inside the string. When using text codes, # remember to use "\\" for a single slash. There are special ID's that # can be used in place of the actor_id: # 0 - Party Leader # -1 - 1st non-leader member. # -2 - 2nd non-leader member. So on. # # gab(string, char_name, char_index) # This will cause the Gab Window to appear with the string shown and a sprite # using char_name as the filename of the character sprite and char_index as the # index of the character sprite. Text codes can be used inside the string. When # using text codes, remember to use "\\" for a single slash. # # clear_gab # This will cause the gab window to clear itself and immediately go invisible. # This will also allow a previously used gab prior to the clearing to reappear # immediately if followed up by another gab. # #============================================================================== # â–¼ Compatibility # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that # it will run with RPG Maker VX without adjusting. # # This script is compatible with Yanfly Engine Ace - Ace Message System v1.04+. # The positioning of these two scripts relative to each other does not matter. # #============================================================================== module YEA module GAB_WINDOW #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Gab Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These are the general settings used involving the Gab Window. Here, you # can change the Y location of the window (remember, it's two lines tall), # default font size, the position of the character sprites, and the amount # of time the Gab Window will remain fully visible before fading. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Y_LOCATION = 36 # This sets the Y location of the gab window. FONT_SIZE = 18 # This is the font size used for the gab window. CHAR_X_POS = 24 # This sets the X location of the character shown. CHAR_Y_POS = 40 # This sets the Y location of the character shown. BASE_TIME = 60 # Minimum frames the window will stay visible for. TIME_PER_TEXT = 4 # Frames added per text character. HIDE_SWITCH = 25 # If switch is ON, Gab Window will not appear. end # GAB_WINDOW end # YEA #============================================================================== # â–¼ Editting anything past this point may potentially result in causing # computer damage, incontinence, explosion of user's head, coma, death, and/or # halitosis so edit at your own risk. #============================================================================== #============================================================================== # â– Switch #============================================================================== module Switch #-------------------------------------------------------------------------- # self.hide_gab_window #-------------------------------------------------------------------------- def self.hide_gab_window return false if YEA::GAB_WINDOW::HIDE_SWITCH <= 0 return $game_switches[YEA::GAB_WINDOW::HIDE_SWITCH] end end # Switch #============================================================================== # â– Game_Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # new method: gab #-------------------------------------------------------------------------- def gab(text, case1 = nil, case2 = nil) return unless SceneManager.scene_is?(Scene_Map) if case1.is_a?(Integer) case1 = $game_party.members[case1.abs].id if case1 <= 0 actor = $game_actors[case1] if !actor.nil? case1 = actor.character_name case2 = actor.character_index end elsif case1.is_a?(String) case2 = 0 if case2.nil? end SceneManager.scene.setup_gab_window(text, case1, case2) end #-------------------------------------------------------------------------- # new method: clear_gab #-------------------------------------------------------------------------- def clear_gab return unless SceneManager.scene_is?(Scene_Map) SceneManager.scene.clear_gab end end # Game_Interpreter #============================================================================== # â– Window_Gab #============================================================================== class Window_Gab < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize dx = -standard_padding dy = YEA::GAB_WINDOW::Y_LOCATION super(dx, dy, Graphics.width + standard_padding, fitting_height(2)) self.z = 201 setup_message_font if $imported["YEA-MessageSystem"] clear end #-------------------------------------------------------------------------- # clear #-------------------------------------------------------------------------- def clear self.opacity = 0 self.contents_opacity = 0 @opacity_timer = 0 clear_settings end #-------------------------------------------------------------------------- # clear_settings #-------------------------------------------------------------------------- def clear_settings @text = "" @graphic = nil @index = nil end #-------------------------------------------------------------------------- # reset_font_settings #-------------------------------------------------------------------------- def reset_font_settings super contents.font.size = YEA::GAB_WINDOW::FONT_SIZE end #-------------------------------------------------------------------------- # setup #-------------------------------------------------------------------------- def setup(text, graphic, index) return if settings_match?(text, graphic, index) @text = text @graphic = graphic @index = index @opacity_timer = YEA::GAB_WINDOW::BASE_TIME @opacity_timer += YEA::GAB_WINDOW::TIME_PER_TEXT * @text.size refresh end #-------------------------------------------------------------------------- # settings_match? #-------------------------------------------------------------------------- def settings_match?(text, graphic, index) return false if @text != text return false if @graphic != graphic return false if @index != index return true end #-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- def update super self.visible = show_window? update_contents_opacity end #-------------------------------------------------------------------------- # show_window? #-------------------------------------------------------------------------- def show_window? return false if $game_message.visible && $game_message.position == 0 return !Switch.hide_gab_window end #-------------------------------------------------------------------------- # update_contents_opacity #-------------------------------------------------------------------------- def update_contents_opacity if @opacity_timer > 0 && self.contents_opacity >= 255 return @opacity_timer -= 1 end self.contents_opacity += @opacity_timer > 0 ? 16 : -4 end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh contents.clear draw_background_colour draw_graphic draw_text_ex(48, line_height / 2, @text) end #-------------------------------------------------------------------------- # draw_background_colour #-------------------------------------------------------------------------- def draw_background_colour temp_rect = contents.rect.clone temp_rect.width *= 0.667 back_colour1 = Color.new(0, 0, 0, 192) back_colour2 = Color.new(0, 0, 0, 0) contents.gradient_fill_rect(temp_rect, back_colour1, back_colour2) end #-------------------------------------------------------------------------- # draw_graphic #-------------------------------------------------------------------------- def draw_graphic char_name = @graphic char_index = @index dx = YEA::GAB_WINDOW::CHAR_X_POS dy = YEA::GAB_WINDOW::CHAR_Y_POS draw_character(char_name, char_index, dx, dy) end end # Window_Gab #============================================================================== # â– Scene_Map #============================================================================== class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # alias method: create_all_windows #-------------------------------------------------------------------------- alias scene_map_create_all_windows_gab create_all_windows def create_all_windows scene_map_create_all_windows_gab create_gab_window end #-------------------------------------------------------------------------- # new method: create_gab_window #-------------------------------------------------------------------------- def create_gab_window @gab_window = Window_Gab.new end #-------------------------------------------------------------------------- # new method: setup_gab_window #-------------------------------------------------------------------------- def setup_gab_window(text, graphic = nil, index = nil) @gab_window.setup(text, graphic, index) end #-------------------------------------------------------------------------- # new method: clear_gab #-------------------------------------------------------------------------- def clear_gab @gab_window.clear end #-------------------------------------------------------------------------- # alias method: pre_transfer #-------------------------------------------------------------------------- alias scene_map_pre_transfer_gab pre_transfer def pre_transfer scene_map_pre_transfer_gab clear_gab end end # Scene_Map #============================================================================== # # â–¼ End of File # #============================================================================== Input Combo Skills, no fixes here. I modified it so skills your character does not have will not show up in the list. If the character has none of the skills, the window doesn't show up at all. Additionally, pressing a button for a skill that is unusable no longer adds it to the combo. If you HAVE the requirements you CAN spam a command (getting around this), but it will be dealt with as it was before by not firing. I'll update it if I fix that, it would require the 'cost' be removed when the skill is queued. #============================================================================== # # â–¼ Yanfly Engine Ace - Input Combo Skills v1.01 # -- Last Updated: 2012.03.24 # -- Level: Hard # -- Requires: n/a # #============================================================================== $imported = {} if $imported.nil? $imported["YEA-InputComboSkills"] = true #============================================================================== # â–¼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2012.03.24 - Combo skills no longer show up if the character doesn't know them. # Disallow button presses if lacking resources to combo. # 2011.12.26 - Bug Fix: Crash when no action is performed. # 2011.12.22 - Started Script and Finished. # #============================================================================== # â–¼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script enables the usage of Input Combo Skills. When an Input Combo # Skill is activated by an actor, a list of the potential input attacks appears # on the side of the screen. The player then presses the various buttons listed # in the window and attacks will occur in a combo fashion. If a particular # attack combination is met, a special attack will occur. # #============================================================================== # â–¼ 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. # # ----------------------------------------------------------------------------- # Skill Notetags - These notetags go in the skill notebox in the database. # ----------------------------------------------------------------------------- # <combo skill L: x> # <combo skill R: x> # <combo skill X: x> # <combo skill Y: x> # <combo skill Z: x> # Makes the skill with these notetags to become potentially comboable. Replace # x with the ID of the skill you want the button to cause the skill to combo. # The combo skill will be usable even if the user has not learned the skill. # However, if the user is unable to use the skill due to a lack of resources, # then the skill will be greyed out. The skill can be inputted, but if the user # lacks the resources, it will not perform and the skill combo will break. # # <combo max: x> # Sets the maximum number of inputs the player can use for this skill. If this # tag is not present, it will use the default number of maximum inputs that's # pre-defined by the module. # # <combo special string: x> # If the player inputs a sequence that matches the string (any combination of # L, R, X, Y, Z), then the special skill x will be performed. If a combination # is met, then the combo chain will end prematurely even if there are more # inputs left. If the user does not know skill x, then the special combo skill # x will not be performed. # # <combo only> # This makes a skill only usable in a combo and cannot be directly used from a # skill menu. This effect does not affect monsters. Combo skills will still be # unusable if the user does not meet the skill's other requirements (such as a # lack of MP or TP). # #============================================================================== # â–¼ Compatibility # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that # it will run with RPG Maker VX without adjusting. # # While this script doesn't interfere with Active Chain Skills, it will most # likely be unable to used in conjunction with Active Chain Skills. I will not # provide support for any errors that may occur from this, nor will I be # responsible for any damage doing this may cause your game. # #============================================================================== module YEA module INPUT_COMBO #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Combo Skill Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These settings adjust the sound effect played when a skill is selected, # what the minimum time windows are. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This will be the sound effect played whenever an active combo skill has # been selected for comboing. INPUT_COMBO_SOUND = RPG::SE.new("Skill2", 80, 100) # This will be the sound effect played when an input combo matches and # activates a specialized combo. ACHIEVED_COMBO_SOUND = RPG::SE.new("Skill3", 90, 100) # How many frames minimum for combo allowance. Sometimes the battlelog # window will move too fast for the player to be able to combo. This sets # a minimum timer for how long the combo window will stay open. MINIMUM_TIME = 60 # This is the bonus number of frames of leeway that the player gets for # a larger input sequence. This is because the battlelog window may move # too fast for the player to be able to combo. This adds to the minimum # timer for how long the combo window will stay open. TIME_PER_INPUT = 15 # This sets the default number of inputs that a combo skill can have at # maximum. If you wish to exceed this amount or to have lower than this # amount, use a notetag to change the skill's max combo amount. DEFAULT_MAX_INPUT = 5 # This will be the "Window" colour used for a special skill in the display. SPECIAL_SKILL_COLOUR = 17 #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Combo Skill Text - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This section adjusts the text that appears for the combo skills. Adjust # the text to appear as you see fit. Note that the vocab other than the # title can use text codes. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- COMBO_TITLE = "Input Combo Attacks" TITLE_SIZE = 20 L_SKILL_ON = "\eC[17]Q\eC[0]: " L_SKILL_OFF = "\eC[7]Q: " R_SKILL_ON = "\eC[17]W\eC[0]: " R_SKILL_OFF = "\eC[7]W: " X_SKILL_ON = "\eC[17]A\eC[0]: " X_SKILL_OFF = "\eC[7]A: " Y_SKILL_ON = "\eC[17]S\eC[0]: " Y_SKILL_OFF = "\eC[7]S: " Z_SKILL_ON = "\eC[17]D\eC[0]: " Z_SKILL_OFF = "\eC[7]D: " end # INPUT_COMBO end # YEA #============================================================================== # â–¼ Editting anything past this point may potentially result in causing # computer damage, incontinence, explosion of user's head, coma, death, and/or # halitosis so edit at your own risk. #============================================================================== module YEA module REGEXP module SKILL COMBO_MAX = /<(?:COMBO_MAX|combo max):[ ](\d+)>/i COMBO_ONLY = /<(?:COMBO_ONLY|combo only)>/i COMBO_SKILL = /<(?:COMBO_SKILL|combo skill)[ ]([LRXYZ]):[ ](\d+)>/i COMBO_SPECIAL = /<(?:COMBO_SPECIAL|combo special)[ ](.*):[ ](\d+)>/i end # SKILL end # REGEXP end # YEA #============================================================================== # â– DataManager #============================================================================== module DataManager #-------------------------------------------------------------------------- # alias method: load_database #-------------------------------------------------------------------------- class <<self; alias load_database_ics load_database; end def self.load_database load_database_ics load_notetags_ics end #-------------------------------------------------------------------------- # new method: load_notetags_ics #-------------------------------------------------------------------------- def self.load_notetags_ics for skill in $data_skills next if skill.nil? skill.load_notetags_ics end end end # DataManager #============================================================================== # â– RPG::Skill #============================================================================== class RPG::Skill < RPG::UsableItem #-------------------------------------------------------------------------- # public instance variables #-------------------------------------------------------------------------- attr_accessor :combo_only attr_accessor :combo_skill attr_accessor :combo_max attr_accessor :combo_special #-------------------------------------------------------------------------- # common cache: load_notetags_ics #-------------------------------------------------------------------------- def load_notetags_ics @combo_only = false @combo_skill = {} @combo_special = {} @combo_max = YEA::INPUT_COMBO::DEFAULT_MAX_INPUT #--- self.note.split(/[\r\n]+/).each { |line| case line #--- when YEA::REGEXP::SKILL::COMBO_ONLY @combo_only = true when YEA::REGEXP::SKILL::COMBO_SKILL case $1.upcase when "L"; @combo_skill[:L] = $2.to_i when "R"; @combo_skill[:R] = $2.to_i when "X"; @combo_skill[:X] = $2.to_i when "Y"; @combo_skill[:Y] = $2.to_i when "Z"; @combo_skill[:Z] = $2.to_i else; next end when YEA::REGEXP::SKILL::COMBO_MAX @combo_max = $1.to_i when YEA::REGEXP::SKILL::COMBO_SPECIAL @combo_special[$1.to_s.upcase] = $2.to_i #--- end } # self.note.split #--- end end # RPG::UsableItem #============================================================================== # â– Game_Action #============================================================================== class Game_Action #-------------------------------------------------------------------------- # new method: set_input_combo_skill #-------------------------------------------------------------------------- def set_input_combo_skill(skill_id) set_skill(skill_id) @target_index = subject.current_action.target_index @input_combo_skill = true end #-------------------------------------------------------------------------- # alias method: valid? #-------------------------------------------------------------------------- alias game_action_valid_ics valid? def valid? subject.enable_input_combo(true) if @input_combo_skill result = game_action_valid_ics subject.enable_input_combo(false) if @input_combo_skill return result end end # Game_Action #============================================================================== # â– Game_BattlerBase #============================================================================== class Game_BattlerBase #-------------------------------------------------------------------------- # alias method: skill_conditions_met? #-------------------------------------------------------------------------- alias game_battlerbase_skill_conditions_met_ics skill_conditions_met? def skill_conditions_met?(skill) return false if combo_skill_restriction?(skill) return game_battlerbase_skill_conditions_met_ics(skill) end #-------------------------------------------------------------------------- # new method: combo_skill_restriction? #-------------------------------------------------------------------------- def combo_skill_restriction?(skill) return false unless actor? return false unless $game_party.in_battle return false unless skill.combo_only return !@input_combo_enabled end #-------------------------------------------------------------------------- # alias method: hp= #-------------------------------------------------------------------------- alias game_battlerbase_hpequals_ics hp= def hp=(value) game_battlerbase_hpequals_ics(value) return unless SceneManager.scene_is?(Scene_Battle) return unless actor? return if value == 0 SceneManager.scene.refresh_input_combo_skill_window(self) end #-------------------------------------------------------------------------- # alias method: mp= #-------------------------------------------------------------------------- alias game_battlerbase_mpequals_ics mp= def mp=(value) game_battlerbase_mpequals_ics(value) return unless SceneManager.scene_is?(Scene_Battle) return unless actor? return if value == 0 SceneManager.scene.refresh_input_combo_skill_window(self) end #-------------------------------------------------------------------------- # alias method: tp= #-------------------------------------------------------------------------- alias game_battlerbase_tpequals_ics tp= def tp=(value) game_battlerbase_tpequals_ics(value) return unless SceneManager.scene_is?(Scene_Battle) return unless actor? return if value == 0 SceneManager.scene.refresh_input_combo_skill_window(self) end end # Game_BattlerBase #============================================================================== # â– Game_Battler #============================================================================== class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # alias method: on_battle_start #-------------------------------------------------------------------------- alias game_battler_on_battle_start_ics on_battle_start def on_battle_start game_battler_on_battle_start_ics @input_combo_enabled = false end #-------------------------------------------------------------------------- # alias method: on_battle_end #-------------------------------------------------------------------------- alias game_battler_on_battle_end_ics on_battle_end def on_battle_end game_battler_on_battle_end_ics @input_combo_enabled = false end #-------------------------------------------------------------------------- # new method: enable_input_combo #-------------------------------------------------------------------------- def enable_input_combo(active) return unless actor? @input_combo_enabled = active end end # Game_Battler #============================================================================== # â– Window_ComboSkillList #============================================================================== class Window_ComboSkillList < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize dw = [Graphics.width/2, 320].max super(-standard_padding, 0, dw, fitting_height(7)) self.z = 200 self.opacity = 0 hide end #-------------------------------------------------------------------------- # reveal #-------------------------------------------------------------------------- def reveal(battler, skill) @battler = battler @skill = skill @combo_skills = [] for key in skill.combo_skill next if key[1].nil? next if $data_skills[key[1]].nil? next unless @battler.skills.include?($data_skills[key[1]]) @combo_skills.push($data_skills[key[1]]) end return if @combo_skills == [] self.y = Graphics.height - fitting_height(4) self.y -= fitting_height(@combo_skills.size + 2) show activate refresh end #-------------------------------------------------------------------------- # refresh_check #-------------------------------------------------------------------------- def refresh_check(battler) return if @battler != battler refresh end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh contents.clear draw_background_colour draw_horz_line(0) draw_combo_title draw_horz_line(@combo_skills.size * line_height) draw_combo_skills end #-------------------------------------------------------------------------- # draw_background_colour #-------------------------------------------------------------------------- def draw_background_colour dh = line_height * (@combo_skills.size + 2) rect = Rect.new(0, 0, contents.width, dh) back_colour1 = Color.new(0, 0, 0, 192) back_colour2 = Color.new(0, 0, 0, 0) contents.gradient_fill_rect(rect, back_colour1, back_colour2) end #-------------------------------------------------------------------------- # draw_horz_line #-------------------------------------------------------------------------- def draw_horz_line(dy) line_y = dy + line_height - 2 line_colour = normal_color line_colour.alpha = 48 contents.fill_rect(0, line_y, contents.width, 2, line_colour) end #-------------------------------------------------------------------------- # draw_combo_title #-------------------------------------------------------------------------- def draw_combo_title reset_font_settings text = YEA::INPUT_COMBO::COMBO_TITLE contents.font.size = YEA::INPUT_COMBO::TITLE_SIZE contents.font.bold = true contents.font.italic = true draw_text(12, 0, contents.width - 12, line_height, text) reset_font_settings end #-------------------------------------------------------------------------- # draw_combo_skills #-------------------------------------------------------------------------- def draw_combo_skills button_array = [:L, :R, :X, :Y, :Z] dx = 24 dy = line_height for button in button_array next if @skill.combo_skill[button].nil? combo_skill = $data_skills[@skill.combo_skill[button]] next unless @battler.skills.include?(combo_skill) text = text_setting(button, combo_skill) text += sprintf("\eI[%d]", combo_skill.icon_index) text += combo_skill.name draw_text_ex(dx, dy, text) dy += line_height end end #-------------------------------------------------------------------------- # text_setting #-------------------------------------------------------------------------- def text_setting(button, skill) text = "" case button when :L if @battler.usable?(skill) text = YEA::INPUT_COMBO::L_SKILL_ON else text = YEA::INPUT_COMBO::L_SKILL_OFF end when :R if @battler.usable?(skill) text = YEA::INPUT_COMBO::R_SKILL_ON else text = YEA::INPUT_COMBO::R_SKILL_OFF end when :X if @battler.usable?(skill) text = YEA::INPUT_COMBO::X_SKILL_ON else text = YEA::INPUT_COMBO::X_SKILL_OFF end when :Y if @battler.usable?(skill) text = YEA::INPUT_COMBO::Y_SKILL_ON else text = YEA::INPUT_COMBO::Y_SKILL_OFF end when :Z if @battler.usable?(skill) text = YEA::INPUT_COMBO::Z_SKILL_ON else text = YEA::INPUT_COMBO::Z_SKILL_OFF end end return text end end # Window_ComboSkillList #============================================================================== # â– Window_ComboInfo #============================================================================== class Window_ComboInfo < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize super(0, 0, Graphics.width, fitting_height(1)) self.y = Graphics.height - fitting_height(4) - fitting_height(1) self.opacity = 0 self.z = 200 @combos = [] @special = nil hide end #-------------------------------------------------------------------------- # reveal #-------------------------------------------------------------------------- def reveal @combos = [] @special = nil refresh show end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh contents.clear dx = draw_combo_icons draw_special(dx) end #-------------------------------------------------------------------------- # add_combo #-------------------------------------------------------------------------- def add_combo(icon, special = nil) @combos.push(icon) @special = special refresh end #-------------------------------------------------------------------------- # draw_combo_icons #-------------------------------------------------------------------------- def draw_combo_icons dx = 0 for icon in @combos draw_icon(icon, dx, 0) dx += 24 end return dx end #-------------------------------------------------------------------------- # draw_special #-------------------------------------------------------------------------- def draw_special(dx) return if @special.nil? draw_icon(@special.icon_index, dx + 12, 0) colour = text_color(YEA::INPUT_COMBO::SPECIAL_SKILL_COLOUR) change_color(colour) draw_text(dx + 36, 0, contents.width, line_height, @special.name) end end # Window_ComboInfo #============================================================================== # â– Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # alias method: create_all_windows #-------------------------------------------------------------------------- alias scene_battle_create_all_windows_ics create_all_windows def create_all_windows scene_battle_create_all_windows_ics create_combo_skill_window end #-------------------------------------------------------------------------- # new method: create_combo_skill_window #-------------------------------------------------------------------------- def create_combo_skill_window @input_combo_skill_window = Window_ComboSkillList.new @input_combo_info_window = Window_ComboInfo.new @input_combo_skill_counter = 0 end #-------------------------------------------------------------------------- # alias method: use_item #-------------------------------------------------------------------------- alias scene_battle_use_item_ics use_item def use_item @subject.enable_input_combo(true) item = @subject.current_action.item combo_skill_list_appear(true, item) start_input_combo_skill_counter(item) scene_battle_use_item_ics loop do break if break_input_combo?(item) update_basic update_combo_skill_queue end combo_skill_list_appear(false, item) @subject.enable_input_combo(false) end #-------------------------------------------------------------------------- # new method: combo_skill_list_appear #-------------------------------------------------------------------------- def combo_skill_list_appear(visible, skill) return if @subject.nil? return unless @subject.actor? return unless skill.is_a?(RPG::Skill) return if visible && @input_combo_skill_window.visible if visible @break_combo = false @current_combo_skill = skill @total_combo_skills = 0 @combo_skill_queue = [] @combo_skill_string = "" @input_combo_skill_window.reveal(@subject, skill) @input_combo_info_window.reveal else @input_combo_skill_window.hide @input_combo_info_window.hide return if @subject.current_action.nil? @subject.current_action.set_skill(@current_combo_skill.id) end end #-------------------------------------------------------------------------- # new method: refresh_input_combo_skill_window #-------------------------------------------------------------------------- def refresh_input_combo_skill_window(battler) return unless @input_combo_skill_window.visible @input_combo_skill_window.refresh_check(battler) end #-------------------------------------------------------------------------- # new method: start_input_combo_skill_counter #-------------------------------------------------------------------------- def start_input_combo_skill_counter(skill) return unless @input_combo_skill_window.visible @input_combo_skill_counter = YEA::INPUT_COMBO::MINIMUM_TIME bonus_time = skill.combo_max * YEA::INPUT_COMBO::TIME_PER_INPUT @input_combo_skill_counter += bonus_time end #-------------------------------------------------------------------------- # new method: break_input_combo? #-------------------------------------------------------------------------- def break_input_combo?(item) return true if @break_combo return true if @current_combo_skill.nil? return true if @current_combo_skill.combo_skill == {} return false if @combo_skill_queue != [] return true if @total_combo_skills == @current_combo_skill.combo_max return @input_combo_skill_counter <= 0 end #-------------------------------------------------------------------------- # new method: update_combo_skill_queue #-------------------------------------------------------------------------- def update_combo_skill_queue return if @combo_skill_queue == [] action = @combo_skill_queue.shift if !@subject.usable?(action) @break_combo = true return end @subject.current_action.set_input_combo_skill(action.id) @log_window.clear execute_action end #-------------------------------------------------------------------------- # alias method: update_basic #-------------------------------------------------------------------------- alias scene_battle_update_basic_ics update_basic def update_basic scene_battle_update_basic_ics update_input_combo_skill_counter update_input_combo_skill_select end #-------------------------------------------------------------------------- # new method: update_input_combo_skill_counter #-------------------------------------------------------------------------- def update_input_combo_skill_counter return if @input_combo_skill_counter == 0 @input_combo_skill_counter -= 1 end #-------------------------------------------------------------------------- # new method: update_input_combo_skill_select #-------------------------------------------------------------------------- def update_input_combo_skill_select return unless @input_combo_skill_window.visible return if @total_combo_skills >= @current_combo_skill.combo_max if Input.trigger?(:L) check_input_combo_skill(:L) elsif Input.trigger?(:R) check_input_combo_skill(:R) elsif Input.trigger?(:X) check_input_combo_skill(:X) elsif Input.trigger?(:Y) check_input_combo_skill(:Y) elsif Input.trigger?(:Z) check_input_combo_skill(:Z) end end #-------------------------------------------------------------------------- # new method: check_input_combo_skill #-------------------------------------------------------------------------- def check_input_combo_skill(button) skill_id = @current_combo_skill.combo_skill[button] return if skill_id.nil? return if $data_skills[skill_id].nil? return unless @subject.usable?($data_skills[skill_id]) case button when :L; @combo_skill_string += "L" when :R; @combo_skill_string += "R" when :X; @combo_skill_string += "X" when :Y; @combo_skill_string += "Y" when :Z; @combo_skill_string += "Z" end if special_input_combo? icon = $data_skills[skill_id].icon_index @combo_skill_queue.push($data_skills[skill_id]) skill_id = @current_combo_skill.combo_special[@combo_skill_string] combo_skill = $data_skills[skill_id] @input_combo_info_window.add_combo(icon, combo_skill) YEA::INPUT_COMBO::ACHIEVED_COMBO_SOUND.play @total_combo_skills = @current_combo_skill.combo_max else YEA::INPUT_COMBO::INPUT_COMBO_SOUND.play combo_skill = $data_skills[skill_id] @input_combo_info_window.add_combo(combo_skill.icon_index) @total_combo_skills += 1 end @combo_skill_queue.push(combo_skill) return unless @total_combo_skills == @current_combo_skill.combo_max @input_combo_skill_counter = 0 end #-------------------------------------------------------------------------- # new method: special_input_combo? #-------------------------------------------------------------------------- def special_input_combo? combo_hash = @current_combo_skill.combo_special return false unless combo_hash.include?(@combo_skill_string) skill = $data_skills[combo_hash[@combo_skill_string]] return @subject.skills.include?(skill) end end # Scene_Battle #============================================================================== # # â–¼ End of File # #============================================================================== Edited March 25, 2012 by Devon Mullane 1 Share this post Link to post Share on other sites
Tammsyn 8 Posted April 9, 2012 just to ensure i do this right these scripts replace yanflys or set below them? Share this post Link to post Share on other sites
kory_toombs 0 Posted January 18, 2013 I encountered a problem when you try to play the Yanfly system in full screen. Does this deal with this problem? Share this post Link to post Share on other sites
Ocedic 249 Posted January 18, 2013 @kory It might help if you described your problem... at all. Share this post Link to post Share on other sites
Neverward 210 Posted July 30, 2013 (edited) Why has no one answered Tammsyn... I am also curious how to apply these. Also, another important thing to note is that this is an edit of his message system version 1.04 though 1.05 had come out since then, at least thats what I have in my game currently. I'm leery to use it since it's not an edit of the most recent script, and for all I know Yanfly has fixed it since then. Any info someone has on this would be awesome. Edited July 30, 2013 by Neverward Share this post Link to post Share on other sites
Rave 14 Posted December 30, 2013 From what I see, those are full scripts with some lines changed, so most likely you replace them. Share this post Link to post Share on other sites