shadow7396 0 Report post Posted September 30, 2014 (edited) Hey i dont know if this part of the forums is where i ask this but i need a part of a script changed that i got online. It's a charset Maker script for rmxp made by Moonpearl/Perlune. FEATURES = [:skin, :eyes, :feet, :legs, :hands, :torso1, :torso2, :shoulders, :hair, :facial_hair1, :facial_hair2, :hat, :back ] OPTIONS = [:picture, :hue, :brightness, :x_offset, :y_offset] DEFAULT_LIBRARY = "Standard" DEFAULT_PICTURES = { "Standard" => ["Standard Pale.png", "Eyes02.png", "Shoes01.png", "Pants01.png", nil, "Shirt01.png", nil, nil, "Hair01.png", nil, nil, nil, nil], "Chubby" => ["Chubby Skin Pale.png", "Eyes01.png", "Boots.png", "Slacks.png", nil, "Sweater.png", "Vest.png", nil, "Coiffed.png", nil, nil, nil, nil] } NAME_NO_PICTURE = "<None>" DIR_DATA = "Data/Charsets" FILENAME_SAVE = "Selection" FILENAME_RENDER = "Render" COLOR1 = Color.new(255, 0, 255, 128) COLOR2 = Color.new(192, 0, 192, 128) HELP_MESSAGE = { "Edit" => "Edit the current selection", "Load..." => "Load previously saved data to the maker", "Save" => "Save current selection for future use", "Library..." => "Select a different graphic library to build charset with", "Default" => "Revert to default selection", "Randomize" => "Randomize each feature for which a selection has been made", "Use as hero" => "Replace the player's graphic with the current render", "To image file" => "Save current render as a .PNG file", "Credits" => "Find out who's behind this great program" } module RPG module Cache class << self def replace(key, bitmap) unless @cache[key].nil? @cache[key].dispose end @cache[key] = bitmap end def part(type, filename, hue = 0, brightness = 0) self.load_bitmap("Graphics/Characters/#{Charset.library}/#{type.display}/", filename, hue, brightness) end alias mp_charset_load_bitmap load_bitmap def load_bitmap(folder_name, filename, hue = 0, brightness = 0) if brightness == 0 return mp_charset_load_bitmap(folder_name, filename, hue) else path = folder_name + filename key = [path, 0, brightness] if not @cache.include?(key) or @cache[key].disposed? @cache[key] = self.load_bitmap(folder_name, filename).clone if brightness > 0 @cache[key].lighten(brightness.to_f / 10) else @cache[key].darken(brightness.abs.to_f / 10) end end if hue == 0 return @cache[key] else key = [path, hue, brightness] if not @cache.include?(key) or @cache[key].disposed? @cache[key] = @cache[ [path, 0, brightness] ].clone @cache[key].hue_change(hue) end return @cache[key] end end end end end def self.warn(message) $game_system.se_play($data_system.decision_se) Graphics.freeze window = Window_Base.new(32, 192, 576, 96) window.contents = Bitmap.new(window.width - 32, window.height - 32) window.contents.draw_text(0, 0, window.width - 32, 32, message, 1) window.contents.draw_text(0, 32, 544, 32, "OK", 1) window.cursor_rect.set(208, 32, 128, 32) window.active = true window.z = 5000 Graphics.transition loop do Input.update Graphics.update window.update if Input.trigger?(Input::C) or Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) break end end Graphics.freeze window.dispose Graphics.transition return end def self.confirm(message) $game_system.se_play($data_system.buzzer_se) Graphics.freeze window = Window_Base.new(32, 192, 576, 96) window.contents = Bitmap.new(window.width - 32, window.height - 32) window.contents.draw_text(0, 0, window.width - 32, 32, message, 1) window.contents.draw_text(0, 32, 272, 32, "OK", 1) window.contents.draw_text(272, 32, 272, 32, "Cancel", 1) window.cursor_rect.set(72, 32, 128, 32) window.active = true window.z = 5000 Graphics.transition index = 0 result = nil while result.nil? Input.update Graphics.update window.update if Input.repeat?(Input::LEFT) or Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) index += 1 index %= 2 window.cursor_rect.set(72 + 272 * index, 32, 128, 32) end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) result = index == 0 end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) result = false end end Graphics.freeze window.dispose Graphics.transition return result end end class Bitmap def darken(factor) factor = 1 - factor for y in 0...self.height for x in 0...self.width color = self.get_pixel(x, y) next if color.alpha == 0 self.set_pixel(x, y, Color.new(color.red * factor, color.green * factor, color.blue * factor, color.alpha) ) end end GC.start end def lighten(factor) p = 255 * factor factor = 1 - factor for y in 0...self.height for x in 0...self.width color = self.get_pixel(x, y) next if color.alpha == 0 self.set_pixel(x, y, Color.new(color.red * factor + p, color.green * factor + p, color.blue * factor + p, color.alpha) ) end end GC.start end end class Bitmask def initialize(size = 1) @data = [0] resize(size) end def [](i) if i >= @size raise RangeError, "Bit ##{i} not defined (max = #{@size - 1}) in Bitmask#[]" end return @data[i >> 5][i & 31] == 1 end def []=(i, b) case b when TrueClass, FalseClass if self[i] == b return nil else @data[i >> 5] ^= 2 ** i return b end else raise TypeError, "TrueClass or FalseClass expected as parameters in Bitmask#[]=" end end def resize(size) while (size >> 5) >= @data.size @data << 0 end @size = size end def to_s str = String.new for i in 0...@size if i & 7 == 0 str << " " end str << @data[i >> 5][i & 31].to_s end return str end end class Dir def self.files(directory = self.pwd, *filters) ary = [] for filename in self.entries(directory) next if File.directory?(filename) or filename == "." or filename == ".." if filters.empty? or filters.include?(File.extname(filename)) ary << filename end end return ary end def self.subdirectories(directory = self.pwd) ary = [] for filename in self.entries(directory) if File.directory?(filename) ary << filename end end return ary end end class File def self.directory?(filename) return false if filename == "." return true if self.extname(filename) == "" return false end end module Charset VIEWPORT = Viewport.new(0, 0, 640, 480) VIEWPORT.z = 1000 class << self attr_reader :data attr_accessor :library def init(library = DEFAULT_LIBRARY) @library = library @data = [] for i in 0...FEATURES.size feature = Feature.new(FEATURES[i]) feature.picture = DEFAULT_PICTURES[@library][i] unless DEFAULT_PICTURES[@library].nil? @data << feature end end def render bitmap = Bitmap.new(128, 192) for feature in @data next if feature.picture == NAME_NO_PICTURE src_bitmap = RPG::Cache.part(feature.type, feature.picture, feature.hue, feature.brightness) start_x = feature.x_offset >= 0 ? 0 : feature.x_offset.abs start_y = feature.y_offset >= 0 ? 0 : feature.y_offset.abs rect = Rect.new(start_x, start_y, 128 - feature.x_offset.abs, 192 - feature.y_offset.abs) start_x = feature.x_offset >= 0 ? feature.x_offset : 0 start_y = feature.y_offset >= 0 ? feature.y_offset : 0 bitmap.blt(start_x, start_y, src_bitmap, rect) end return bitmap end def cache(name) RPG::Cache.replace("Graphics/Characters/#{name}", self.render) end end class Feature attr_reader :type attr_accessor :hue attr_accessor :brightness attr_accessor :x_offset attr_accessor :y_offset def initialize(type) @type = type @picture = nil @hue = 0 @brightness = 0 @x_offset = 0 @y_offset = 0 end def picture if @picture == nil return NAME_NO_PICTURE else return @picture end end def picture=(name) if name == NAME_NO_PICTURE @picture = nil else @picture = name end end end end class Game_Temp alias mp_charset_initialize initialize def initialize mp_charset_initialize Charset.init end end class Sprite_Part < RPG::Sprite def initialize(id, x, y) super(Charset::VIEWPORT) @id = id @_x = x @_y = y self.z = id end def feature return Charset.data[@id] end def refresh if self.feature.picture == NAME_NO_PICTURE self.bitmap = nil return end self.x = @_x + self.feature.x_offset self.y = @_y + self.feature.y_offset self.bitmap = RPG::Cache.part(self.feature.type, self.feature.picture, self.feature.hue, self.feature.brightness) @_whiten_duration = 1 end end class Window_Menu < Window_Selectable attr_reader :options attr_reader :disabled def initialize(x, y, width, max_height, options) @options = options super(x, y, width, [max_height, (@options.size + 1) * 32].min) self.contents = Bitmap.new(width - 32, @options.size * 32) @item_max = @options.size @disabled = Bitmask.new(@item_max) self.index = 0 refresh end def refresh self.contents.clear for i in 0...@options.size self.contents.font.color = @disabled[i] ? disabled_color : normal_color self.contents.draw_text(4, i * 32, width - 32, 32, @options[i]) end end def disable_option(i) return false if @disabled[i] @disabled[i] = true refresh return true end def enable_option(i) return false unless @disabled[i] @disabled[i] = false refresh return true end def update_help @help_window.set_text(HELP_MESSAGE[@options[self.index]], 1) end end class Window_Charset < Window_Base attr_reader :menu_windows attr_accessor :index def initialize super(0,0,640,64) self.contents = Bitmap.new(self.width - 32, self.height - 32) @item_max = 3 x = self.contents.width / @item_max for i in 0...@item_max self.contents.draw_text(x * i + 4, 0, x, 32, case i when 0 "Selection" when 1 "Render" when 2 "?" end ) end @menu_windows = [] for i in 0...@item_max window = Window_Menu.new(16 + x * i, 64, x, 160, case i # Selection Menu when 0 ["Edit", "Load...", "Save", "Library...", "Default", "Randomize"] # Export Menu when 1 ["Use as hero", "To image file"] # ? Menu when 2 ["Credits"] end ) window.visible = false window.active = false window.z = 4000 @menu_windows << window end end def help_window=(help_window) for window in @menu_windows window.help_window = help_window end end def index=(i) unless @index.nil? menu_window.visible = false menu_window.active = false end if i == -1 @index = nil self.cursor_rect.empty return end @index = i x = self.contents.width / @item_max self.cursor_rect.set(x * @index, 0, x, 32) menu_window.visible = true menu_window.active = true end def update return unless self.active super menu_window.update if Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) self.index = (self.index - 1) % @item_max end if Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) self.index = (self.index + 1) % @item_max end end def activate self.active = true self.index = 0 end def deactivate self.active = false self.index = -1 end def menu_window return @menu_windows[self.index] end def option return menu_window.options[menu_window.index] end def dispose for window in @menu_windows window.dispose end super end end class Window_Feature < Window_Selectable def initialize super(0, 64, 96, 352) @item_max = Charset.data.size self.index = -1 self.active = false self.contents = Bitmap.new(width - 32, @item_max * 32) refresh end def feature(i = self.index) return Charset.data[i].type end def refresh self.contents.clear for i in 0...@item_max self.contents.draw_text(4, i * 32, 64, 32, self.feature(i).display ) end end def update return unless self.active super end def activate self.active = true end def deactivate self.active = false end def update_help @help_window.set_text("C: Edit feature B: Return to top menu A: Edit all L/R: Change order", 1) end end class Window_FeatureOption < Window_Selectable attr_accessor :feature_window attr_accessor :edit_all def initialize super(96, 64, 224, 352) self.contents = Bitmap.new(self.width - 32, self.height - 32) @item_max = OPTIONS.size self.index = -1 self.active = false self.visible = true @edit_all = false @need_refresh = false end def feature(i = @feature_window.index) return Charset.data[i] end def option return OPTIONS[self.index] end def refresh @need_refresh = true @pictures = Dir.files("Graphics/Characters/#{Charset.library}/#{feature.type.display}", ".bmp", ".png", ".jpg") @pictures.unshift(NAME_NO_PICTURE) @picture_index = @pictures.index(self.feature.picture) self.contents.clear for i in 0...@item_max if i == 0 and @edit_all self.contents.font.color = disabled_color else self.contents.font.color = system_color end self.contents.draw_text(4, i * 32, 64, 32, OPTIONS[i].display) end for i in 0...@item_max if self.feature.send(OPTIONS[i]).is_a?(Numeric) text = sprintf("%+d", self.feature.send(OPTIONS[i])) else text = self.feature.send(OPTIONS[i]).to_s end if i == 0 and @edit_all self.contents.font.color = disabled_color self.contents.draw_text(64, i * 32, 124, 32, "---", 2) else self.contents.font.color = normal_color self.contents.draw_text(64, i * 32, 124, 32, text, 2) end end end def update return unless self.active super if @edit_all return if option == :picture for i in 0...Charset.data.size update_feature(i) end else update_feature end if option == :picture and feature.picture != NAME_NO_PICTURE if Input.repeat?(Input::Z) picture_index = @picture_index regexp = Regexp.new(feature.picture[0, feature.picture.size - 6] + "\\d{2}.\\w{3}") while @pictures[picture_index] =~ regexp picture_index += 1 if picture_index == @pictures.size $game_system.se_play($data_system.buzzer_se) return end end $game_system.se_play($data_system.cursor_se) @picture_index = picture_index self.feature.picture = @pictures[@picture_index] self.refresh end if Input.repeat?(Input::Y) picture_index = @picture_index regexp = Regexp.new(feature.picture[0, feature.picture.size - 6] + "\\d{2}.\\w{3}") while @pictures[picture_index] =~ regexp picture_index -= 1 if picture_index == 0 $game_system.se_play($data_system.buzzer_se) return end end $game_system.se_play($data_system.cursor_se) @picture_index = picture_index self.feature.picture = @pictures[@picture_index] self.refresh end end end def update_feature(i = @feature_window.index) if Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) case option when :picture @picture_index -= 1 @picture_index %= @pictures.size self.feature(i).picture = @pictures[@picture_index] when :hue feature(i).hue -= 10 feature(i).hue %= 360 else eval("feature(i).#{option} -= 1") end self.refresh return true end if Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) case option when :picture @picture_index += 1 @picture_index %= @pictures.size self.feature(i).picture = @pictures[@picture_index] when :hue feature(i).hue += 10 feature(i).hue %= 360 else eval("feature(i).#{option} += 1") end self.refresh return true end return false end def activate self.active = true self.index = 0 end def deactivate self.active = false self.index = -1 end def update_help @help_window.set_text("<-/->: Adjust parameter C: Apply changes B: Cancel changes L/R: Change order", 1) end def need_refresh if @need_refresh @need_refresh = false return true end return false end end class Window_LoadSelection < Window_Selectable def initialize super(0, 64, 320, 352) self.contents = Bitmap.new(width - 32, height - 32) self.active = false self.visible = false self.z = 1000 @need_refresh = false end def refresh @data = Dir.files(DIR_DATA)#, "*.rxdata") return false if @data.empty? @item_max = @data.size for i in 0...@item_max self.contents.draw_text(4, i * 32, self.width - 32, 32, @data[i]) end end def filename return "#{DIR_DATA}/#{@data[self.index]}" end def update return unless self.active super if Input.repeat?(Input::DOWN) or Input.repeat?(Input::UP) or Input.repeat?(Input::L) or Input.repeat?(Input::R) update_selection end end def update_selection @need_refresh = true file = File.open(self.filename, "r") Charset.library = Marshal.load(file) Charset.data.replace(Marshal.load(file)) file.close end def activate self.active = true self.visible = true self.index = 0 self.update_selection end def deactivate self.active = false self.visible = false end def update_help @help_window.set_text("C: Load current selection B: Cancel selection load", 1) end def need_refresh if @need_refresh @need_refresh = false return true end return false end end class Window_LoadSelection < Window_Selectable def initialize super(0, 64, 320, 352) self.contents = Bitmap.new(width - 32, height - 32) self.active = false self.visible = false self.z = 1000 @need_refresh = false end def refresh @data = Dir.files(DIR_DATA)#, "*.rxdata") return false if @data.empty? @item_max = @data.size for i in 0...@item_max self.contents.draw_text(4, i * 32, self.width - 32, 32, @data[i]) end end def filename return "#{DIR_DATA}/#{@data[self.index]}" end def update return unless self.active super if Input.repeat?(Input::DOWN) or Input.repeat?(Input::UP) or Input.repeat?(Input::L) or Input.repeat?(Input::R) update_selection end end def update_selection @need_refresh = true file = File.open(self.filename, "r") Charset.library = Marshal.load(file) Charset.data.replace(Marshal.load(file)) file.close end def activate self.active = true self.visible = true self.index = 0 self.update_selection end def deactivate self.active = false self.visible = false end def update_help @help_window.set_text("C: Load current selection B: Cancel selection load", 1) end def need_refresh if @need_refresh @need_refresh = false return true end return false end end class Window_LibrarySelection < Window_Selectable def initialize super(0, 64, 320, 352) self.contents = Bitmap.new(width - 32, height - 32) self.active = false self.visible = false self.z = 1000 @need_refresh = false end def refresh @data = Dir.subdirectories("Graphics/Characters") return false if @data.empty? @item_max = @data.size for i in 0...@item_max self.contents.draw_text(4, i * 32, self.width - 32, 32, @data[i]) end end def library return @data[self.index] end def update return unless self.active super if Input.repeat?(Input::DOWN) or Input.repeat?(Input::UP) or Input.repeat?(Input::L) or Input.repeat?(Input::R) update_selection end end def update_selection @need_refresh = true Charset.init(library) end def activate self.active = true self.visible = true self.index = 0 self.update_selection end def deactivate self.active = false self.visible = false end def update_help @help_window.set_text("C: Load current library B: Cancel library selection", 1) end def need_refresh if @need_refresh @need_refresh = false return true end return false end end class Scene_Charset < Scene_Base def setup super @sprites << @charset_window = Window_Charset.new @sprites << @feature_window = Window_Feature.new @sprites << @option_window = Window_FeatureOption.new @option_window.feature_window = @feature_window @sprites << @preview_window = Window_Base.new(320, 64, 320, 352) @sprites << @load_window = Window_LoadSelection.new @sprites << @library_window = Window_LibrarySelection.new @sprites << @help_window = Window_Help.new @help_window.y = 416 @charset_window.help_window = @feature_window.help_window = @option_window.help_window = @load_window.help_window = @library_window.help_window = @help_window @charset_window.activate @preview_window.contents = Bitmap.new(@preview_window.width - 32, @preview_window.height - 32) @preview_window.active = false def @preview_window.refresh self.contents.clear self.contents.draw_text(0, 0, 144, 32, "Selected", 1) if self.active self.contents.draw_text(160, 0, 144, 32, "Preview", 1) end end def @preview_window.activate self.active = true self.refresh end def @preview_window.deactivate self.active = false self.refresh end @preview_window.refresh @option_windows = [] @preview_sprites = [] @selected_sprites = [] bitmap = Bitmap.new(128, 192) for y in 0...4 for x in 0...4 bitmap.fill_rect(x * 32, y * 48, 32, 48, (x + y) % 2 == 0 ? COLOR1 : COLOR2) end end sprite = Sprite.new(Charset::VIEWPORT) sprite.bitmap = bitmap sprite.x = 496 sprite.y = 128 sprite.visible = false def sprite.refresh; return; end @sprites << sprite @preview_sprites << sprite sprite = Sprite.new(Charset::VIEWPORT) sprite.bitmap = bitmap sprite.x = 336 sprite.y = 128 def sprite.refresh; return; end @sprites << sprite for i in 0...FEATURES.size sprite = Sprite_Part.new(i, 496, 128) sprite.visible = false @sprites << sprite @preview_sprites << sprite sprite = Sprite_Part.new(i, 336, 128) @sprites << sprite @selected_sprites << sprite end @selected_animated = [] @preview_animated = [] for i in 0..3 rect = Rect.new(0, i * 48, 32, 48) sprite = RPG::Sprite.new(Charset::VIEWPORT) sprite.x = 336 + i * 32 sprite.y = 344 sprite.src_rect = rect @selected_animated << sprite @sprites << sprite sprite = RPG::Sprite.new(Charset::VIEWPORT) sprite.x = 496 + i * 32 sprite.y = 344 sprite.src_rect = rect sprite.visible = false @preview_animated << sprite @sprites << sprite end refresh_selected refresh_preview if Dir.files(DIR_DATA, ".rxdata").empty? i = @charset_window.menu_windows[0].options.index("Load...") @charset_window.menu_windows[0].disable_option(i) end @blink_count = 0 @frame_count = 0 @frame = 0 @animation_rect = [] for i in 0..15 @animation_rect << Rect.new(i % 4 * 32, i / 4 * 48, 32, 48) end update_animation end def terminate super for sprite in @selected_sprites sprite.dispose end end def refresh_selected for sprite in @selected_sprites sprite.refresh end bitmap = Charset.cache("Render") for sprite in @selected_animated sprite.bitmap = bitmap end end def refresh_preview for sprite in @preview_sprites sprite.refresh end bitmap = Charset.cache("Preview") for sprite in @preview_animated sprite.bitmap = bitmap end end def show_preview for sprite in @preview_sprites + @preview_animated sprite.visible = true end end def hide_preview for sprite in @preview_sprites + @preview_animated sprite.visible = false end end def enable_save enable_export i = @charset_window.menu_windows[0].options.index("Save") @charset_window.menu_windows[0].enable_option(i) end def disable_save i = @charset_window.menu_windows[0].options.index("Save") @charset_window.menu_windows[0].disable_option(i) end def enable_export i = @charset_window.menu_windows[1].options.index("To image file") @charset_window.menu_windows[1].enable_option(i) end def disable_export i = @charset_window.menu_windows[1].options.index("To image file") @charset_window.menu_windows[1].disable_option(i) end def export_disabled? i = @charset_window.menu_windows[1].options.index("To image file") return @charset_window.menu_windows[1].disabled[i] end def save_disabled? i = @charset_window.menu_windows[0].options.index("Save") return @charset_window.menu_windows[0].disabled[i] end def update_animation if @frame_count == 0 @frame_count = 8 @frame += 1 @frame %= 4 end @frame_count -= 1 for i in 0..3 @selected_animated[i].src_rect = @preview_animated[i].src_rect = @animation_rect[i * 4 + @frame] end end def update super if @option_window.need_refresh or @load_window.need_refresh or @library_window.need_refresh refresh_preview end # Confirm Selection if Input.trigger?(Input::C) # If in command window if @charset_window.active case @charset_window.option # Edit sprite when "Edit" $game_system.se_play($data_system.decision_se) @charset_window.deactivate @feature_window.activate @blink_count = 0 @feature_window.index = 0 @option_window.refresh # Default when "Default" return unless RPG.confirm("Lose all changes and revert to default?") Charset.init @feature_window.refresh for window in @option_windows window.refresh end refresh_selected enable_save when "Load..." unless @load_window.refresh return RPG.warn("No saved data found in Data/Charsets!") end $game_system.se_play($data_system.decision_se) @backup_charset = Charset.data.clone @charset_window.deactivate @preview_window.activate @load_window.activate show_preview refresh_preview when "Save" if save_disabled? $game_system.se_play($data_system.buzzer_se) return end i = 0 while File.exist?(filename = sprintf("Data/Charsets/#{FILENAME_SAVE}%03d.rxdata", i)) i += 1 end file = File.open(filename, "wb") Marshal.dump(Charset.library, file) Marshal.dump(Charset.data, file) file.close disable_save i = @charset_window.menu_windows[0].options.index("Load...") @charset_window.menu_windows[0].enable_option(i) return RPG.warn("Current selection saved as #{filename}!") when "Library..." unless @library_window.refresh return RPG.warn("No libraries found in Graphics/Characters!") end $game_system.se_play($data_system.decision_se) @backup_charset = Charset.data.clone @charset_window.deactivate @preview_window.activate @library_window.activate show_preview refresh_preview when "Randomize" $game_system.se_play($data_system.decision_se) @backup_charset = [] for feature in Charset.data @backup_charset << feature.clone next if feature.picture == NAME_NO_PICTURE # Randomize picture feature.picture = Dir.files("Graphics/Characters/#{Charset.library}/#{feature.type.display}").sample end @preview_window.activate show_preview refresh_preview @help_window.set_text("C: Apply changes B: Cancel changes", 1) loop do Input.update Graphics.update update_animation if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) enable_save refresh_selected break end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) Charset.data.replace(@backup_charset) break end end @preview_window.deactivate hide_preview update_animation return # Use charset when "Use as hero" Charset.cache($game_actors[1].character_name) return RPG.warn("Player's character changed to current selection!") when "To image file" if export_disabled? $game_system.se_play($data_system.buzzer_se) return end i = 0 while File.exist?(filename = sprintf("Graphics/Characters/#{FILENAME_RENDER}%03d.png", i)) i += 1 end Charset.render.export(filename) disable_export return RPG.warn("Current selection rendered as #{filename}!") when "Credits" RPG.warn("Charset Maker v1.00 written by Moonpearl") RPG.warn("Using Bitmap Export written by Zeus81") RPG.warn("Graphic libraries provided and maintained by JonBon") return end # If selecting feature to edit elsif @feature_window.active $game_system.se_play($data_system.decision_se) @backup_feature = Charset.data[@feature_window.index].clone @preview_window.activate @feature_window.deactivate @option_window.activate show_preview # If editing selected feature elsif @option_window.active $game_system.se_play($data_system.decision_se) @preview_window.deactivate @option_window.deactivate @feature_window.activate @option_window.edit_all = false @blink_count = 0 refresh_selected hide_preview enable_save # If browsing list of possible selections elsif @load_window.active $game_system.se_play($data_system.decision_se) @load_window.deactivate @preview_window.deactivate @charset_window.activate refresh_selected hide_preview disable_save # If browsing list of libraries elsif @library_window.active $game_system.se_play($data_system.decision_se) @library_window.deactivate @preview_window.deactivate @charset_window.activate refresh_selected hide_preview disable_save end end # Cancel selection if Input.trigger?(Input::B) # If in command window if @charset_window.active $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new # If selecting feature to edit elsif @feature_window.active $game_system.se_play($data_system.cancel_se) @feature_window.deactivate @feature_window.index = -1 @charset_window.activate @option_window.contents.clear # If editing selected feature elsif @option_window.active $game_system.se_play($data_system.cancel_se) @preview_window.deactivate @option_window.deactivate @feature_window.activate # Cancel changes and revert to backup if @option_window.edit_all Charset.data.replace(@backup_charset) else Charset.data[@feature_window.index] = @backup_feature end @option_window.refresh @option_window.edit_all = false hide_preview # If browsing list of possible selections elsif @load_window.active $game_system.se_play($data_system.cancel_se) @load_window.deactivate @preview_window.activate @charset_window.activate Charset.data.replace(@backup_charset) hide_preview # If browsing list of libraries elsif @library_window.active $game_system.se_play($data_system.cancel_se) @library_window.deactivate @preview_window.deactivate @charset_window.activate Charset.data.replace(@backup_charset) hide_preview end end if Input.repeat?(Input::L) return if @feature_window.index == - 1 if @feature_window.index == 0 or @option_window.edit_all $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) Charset.data.insert( @feature_window.index - 1, Charset.data.delete_at(@feature_window.index) ) index = @option_window.index @option_window.index = -1 @option_window.refresh @option_window.active = false @feature_window.index -= 1 @feature_window.refresh @option_window.refresh @option_window.index = index if @feature_window.active refresh_selected else feature = Charset.data[@feature_window.index] Charset.data[@feature_window.index] = @backup_feature refresh_selected Charset.data[@feature_window.index] = feature @option_window.active = true end enable_save end if Input.repeat?(Input::R) return if @feature_window.index == - 1 if @feature_window.index == Charset.data.size - 1 or @option_window.edit_all $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) Charset.data.insert( @feature_window.index + 1, Charset.data.delete_at(@feature_window.index) ) index = @option_window.index @option_window.index = -1 @option_window.refresh @option_window.active = false @feature_window.index += 1 @feature_window.refresh @option_window.refresh @option_window.index = index @option_window.active = true unless @feature_window.active if @feature_window.active refresh_selected else feature = Charset.data[@feature_window.index] Charset.data[@feature_window.index] = @backup_feature refresh_selected Charset.data[@feature_window.index] = feature @option_window.active = true end enable_save end update_animation if @feature_window.active if @blink_count == 0 @blink_count = 16 @selected_sprites[@feature_window.index].whiten end @blink_count -= 1 if Input.trigger?(Input::A) $game_system.se_play($data_system.decision_se) @backup_charset = [] for feature in Charset.data @backup_charset << feature.clone end @option_window.edit_all = true @feature_window.deactivate @feature_window.cursor_rect.set(0, 0, @feature_window.width - 32, Charset.data.size * 32) @preview_window.activate @option_window.activate @option_window.refresh show_preview end if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN) @blink_count = 0 @option_window.refresh end end end end class Scene_Title #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # If battle test if $BTEST battle_test return end # Load database $data_actors = load_data("Data/Actors.rxdata") $data_classes = load_data("Data/Classes.rxdata") $data_skills = load_data("Data/Skills.rxdata") $data_items = load_data("Data/Items.rxdata") $data_weapons = load_data("Data/Weapons.rxdata") $data_armors = load_data("Data/Armors.rxdata") $data_enemies = load_data("Data/Enemies.rxdata") $data_troops = load_data("Data/Troops.rxdata") $data_states = load_data("Data/States.rxdata") $data_animations = load_data("Data/Animations.rxdata") $data_tilesets = load_data("Data/Tilesets.rxdata") $data_common_events = load_data("Data/CommonEvents.rxdata") $data_system = load_data("Data/System.rxdata") # Make system object $game_system = Game_System.new # Reset frame count for measuring play time Graphics.frame_count = 0 # Make each type of game object $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # Set up initial party $game_party.setup_starting_members # Set up initial map position $game_map.setup($data_system.start_map_id) # Move player to initial position $game_player.moveto($data_system.start_x, $data_system.start_y) # Refresh player $game_player.refresh # Run automatic change for BGM and BGS set with map $game_map.autoplay # Update map (run parallel process event) $game_map.update $scene = Scene_Charset.new end end In this script, for each feature there are the five options listed above: picture, hue, brightness, x_offset, y_offset. What i want is a way to get rid of hue and brightness and replace them with certain colors. Is there a way anyone can do that? Edited October 1, 2014 by Bob423 Added spoiler and code tags Share this post Link to post Share on other sites
Saltome 16 Report post Posted October 1, 2014 ...are you sure about this? I see no reason to downgrade the script in such a manner. Share this post Link to post Share on other sites
Bob423 52 Report post Posted October 1, 2014 Yeah, doesn't seem necessary... Also, I suggest using the code and spoiler tags for pasting long scripts. Share this post Link to post Share on other sites
shadow7396 0 Report post Posted October 1, 2014 im new these forum sites so forgive me for not knowing all that needs to be done in a single post. Share this post Link to post Share on other sites
Bob423 52 Report post Posted October 1, 2014 Don't worry about it, I just did it for you :thumbsup: Share this post Link to post Share on other sites
shadow7396 0 Report post Posted October 1, 2014 thanks =) Share this post Link to post Share on other sites
dolarmak 23 Report post Posted October 3, 2014 hey shadow there most certainly is a way to do what you want, but only moon pearl really knows his own script well enough to do that with any kind of speed. and he's not online too often. i'm also not sure he would even do a request. but as Salt and Bob said, why down grade i t, hue isnt that big a deal. Share this post Link to post Share on other sites
shadow7396 0 Report post Posted October 12, 2014 I have another script i need help with. Here it is: #============================================================================== # ** Multiple Message Windows#------------------------------------------------------------------------------# Wachunga# 1.1# 2006-11-10# See https://github.com/wachunga/rmxp-multiple-message-windows for details#==============================================================================#==============================================================================# Settings#==============================================================================# filename of message tail used for speech bubbles# must be in the Graphics/Windowskins/ folderFILENAME_SPEECH_TAIL = "blue-speech_tail.png"# note that gradient windowskins aren't ideal for tails# filenames of message tail and windowskin used for thought bubbles# must also be in the Graphics/Windowskins/ folderFILENAME_THOUGHT_TAIL = "white-thought_tail.png"FILENAME_THOUGHT_WINDOWSKIN = "white-windowskin.png"# used for message.locationTOP = 8BOTTOM = 2LEFT = 4RIGHT = 6class Game_Message# Any of the below can be changed by a Call Script event during gameplay.# E.g. turn letter-by-letter mode off with: message.letter_by_letter = falseattr_accessor :move_duringattr_accessor :letter_by_letterattr_accessor :text_speedattr_accessor :skippableattr_accessor :resizeattr_accessor :floatingattr_accessor :autocenterattr_accessor :show_tailattr_accessor :show_pauseattr_accessor :locationattr_accessor :font_nameattr_accessor :font_sizeattr_accessor :font_colorattr_accessor :font_color_thoughtdef initialize# whether or not messages appear one letter at a time@letter_by_letter = true# note: can also change within a single message with \L# the default speed at which text appears in letter-by-letter mode@text_speed = 1# note: can also change within a single message with \S[n]# whether or not players can skip to the end of (letter-by-letter) messages@skippable = true# whether or not messages are automatically resized based on the message@resize = true# whether or not message windows are positioned above# characters/events by default, i.e. without needing \P every message# (only works if resize messages enabled -- otherwise would look very odd)@floating = true# whether or not to automatically center lines within the message@autocenter = true# whether or not event-positioned messages have a tail (for speech bubbles)# (only works if floating and resized messages enabled -- otherwise would# look very odd indeed)@show_tail = true# whether or not to display "waiting for user input" pause graphic# (probably want this disabled for speech bubbles)@show_pause = false# whether the player is permitted to move while messages are displayed@move_during = true# the default location for floating messages (relative to the event)# note that an off-screen message will be "flipped" automatically@location = TOP# name of font to use for text (any TrueType from Windows/Fonts folder)@font_name = Font.default_name# note that you can use an array of fonts to specify multiple# e.g. ['Verdana', 'MS PGothic']# (if Verdana is not available, MS PGothic will be used instead)# font size for text (default is 22)@font_size = Font.default_size# default font color (same 0-7 as for \c[n])@font_color = 0# font color used just for thought bubbles (\@)@font_color_thought = 1endend#------------------------------------------------------------------------------class Window_Message < Window_Selectabledef initialize(msgindex)super(80, 304, 480, 160)self.contents = Bitmap.new(width - 32, height - 32)self.visible = false#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------self.z = 9000 + msgindex * 5 # permits messages to overlap legibly#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------@fade_in = false@fade_out = false@contents_showing = false@cursor_width = 0self.active = falseself.index = -1#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------@msgindex = msgindex@tail = Sprite.new@tail.bitmap =if @msgindex == 0RPG::Cache.windowskin(FILENAME_SPEECH_TAIL)else# don't use cached version or else all tails# are rotated when multiple are visible at onceBitmap.new("Graphics/Windowskins/"+FILENAME_SPEECH_TAIL)end# keep track of orientation of tail bitmapif @tail.bitmap.orientation == nil@tail.bitmap.orientation = 0end# make origin the center, not top left corner@tail.ox = @tail.bitmap.width/2@tail.oy = @tail.bitmap.height/2@tail.z = 9999@tail.visible = false@windowskin = $game_system.windowskin_name@font_color = $game_system.message.font_color@update_text = true@letter_by_letter = $game_system.message.letter_by_letter@text_speed = $game_system.message.text_speed# id of character for speech bubbles@float_id = nil# location of box relative to speaker@location = $game_system.message.location#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------enddef disposeterminate_message#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# have to check all windows before claiming that no window is showingif $game_temp.message_text.compact.empty?#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------$game_temp.message_window_showing = false#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------end#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------if @input_number_window != nil@input_number_window.disposeendsuperenddef terminate_messageself.active = falseself.pause = falseself.index = -1self.contents.clear# Clear showing flag@contents_showing = false# Clear variables related to text, choices, and number input#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------@tail.visible = false# note that these variables are now indexed arrays$game_temp.message_text[@msgindex] = nil# Call message callbackif $game_temp.message_proc[@msgindex] != nil# make sure no message boxes are displayingif $game_temp.message_text.compact.empty?$game_temp.message_proc[@msgindex].callend$game_temp.message_proc[@msgindex] = nilend@update_text = true#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------$game_temp.choice_start = 99$game_temp.choice_max = 0$game_temp.choice_cancel_type = 0$game_temp.choice_proc = nil$game_temp.num_input_start = 99$game_temp.num_input_variable_id = 0$game_temp.num_input_digits_max = 0# Open gold windowif @gold_window != nil@gold_window.dispose@gold_window = nilendenddef refreshself.contents.clear#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------@x = @y = 0 # now instance variables@float_id = nil@location = $game_system.message.location@windowskin = $game_system.windowskin_name@font_color = $game_system.message.font_color@line_widths = nil@wait_for_input = false@tail.bitmap =if @msgindex == 0RPG::Cache.windowskin(FILENAME_SPEECH_TAIL)elseBitmap.new("Graphics/Windowskins/"+FILENAME_SPEECH_TAIL)endRPG::Cache.windowskin(FILENAME_SPEECH_TAIL)@tail.bitmap.orientation = 0 if @tail.bitmap.orientation == nil@text_speed = $game_system.message.text_speed@letter_by_letter = $game_system.message.letter_by_letter@delay = @text_speed@player_skip = false#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------@cursor_width = 0# Indent if choiceif $game_temp.choice_start == 0@x = 8end# If waiting for a message to be displayed#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------if $game_temp.message_text[@msgindex] != nil@text = $game_temp.message_text[@msgindex] # now an instance variable#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------# Control text processingbeginlast_text = @text.clone@text.gsub!(/\\[Vv][Aa][Rr]\[([0-9]+)\]/) { $game_variables[$1.to_i] }end until @text == last_text@text.gsub!(/\\[Nn]\[([0-9]+)\]/) do$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""end# Change "\\\\" to "\000" for convenience@text.gsub!(/\\\\/) { "\000" }# Change "\\C" to "\001" and "\\G" to "\002"@text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }@text.gsub!(/\\[Gg]/) { "\002" }#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------@text.gsub!(/\\[Nn]\[[Ee]([0-9]+)\]/) do$data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].name : ""end# Change "\\MAP" to map name@text.gsub!(/\\[Mm][Aa][Pp]/) { $game_map.name }# Change "\\L" to "\003" (toggle letter-by-letter)@text.gsub!(/\\[Ll]/) { "\003" }# Change "\\S" to "\004" (text speed)@text.gsub!(/\\[ss]\[([0-9]+)\]/) { "\004[#{$1}]" }# Change "\\D" to "\005" (delay)@text.gsub!(/\\[Dd]\[([0-9]+)\]/) { "\005[#{$1}]" }# Change "\\!" to "\006" (self close)@text.gsub!(/\\[!]/) { "\006" }# Change "\\?" to "\007" (wait for user input)@text.gsub!(/\\[?]/) { "\007" }# Change "\\B" to "\010" (bold)@text.gsub!(/\\[bb]/) { "\010" }# Change "\\I" to "\011" (italic)@text.gsub!(/\\[ii]/) { "\011" }# Get rid of "\\@" (thought bubble)if @text.gsub!(/\\[@]/, "") != nil@windowskin = FILENAME_THOUGHT_WINDOWSKIN@font_color = $game_system.message.font_color_thought@tail.bitmap =if @msgindex == 0RPG::Cache.windowskin(FILENAME_THOUGHT_TAIL)elseBitmap.new("Graphics/Windowskins/"+FILENAME_THOUGHT_TAIL)end@tail.bitmap.orientation = 0 if @tail.bitmap.orientation == nilend# Get rid of "\\+" (multiple messages)@text.gsub!(/\\[+]/, "")# Get rid of "\\^", "\\v", "\\<", "\\>" (relative message location)if @text.gsub!(/\\\^/, "") != nil@location = 8elsif @text.gsub!(/\\[Vv]/, "") != nil@location = 2elsif @text.gsub!(/\\[<]/, "") != nil@location = 4elsif @text.gsub!(/\\[>]/, "") != nil@location = 6end# Get rid of "\\P" (position window to given character)if @text.gsub!(/\\[Pp]\[([0-9]+)\]/, "") != nil@float_id = $1.to_ielsif @text.gsub!(/\\[Pp]\[([a-zA-Z])\]/, "") != nil and$game_temp.in_battle@float_id = $1.downcaseelsif @text.gsub!(/\\[Pp]/, "") != nil or($game_system.message.floating and $game_system.message.resize) and!$game_temp.in_battle@float_id = $game_system.map_interpreter.event_idendif $game_system.message.resize or $game_system.message.autocenter# calculate length of linestext = @text.clonetemp_bitmap = Bitmap.new(1,1)temp_bitmap.font.name = $game_system.message.font_nametemp_bitmap.font.size = $game_system.message.font_size@line_widths = [0,0,0,0]for i in 0..3line = text.split(/\n/)[3-i]if line == nilnextendline.gsub!(/[\001-\007](\[\w+\])?/, "")line.chomp.split(//).each do |c|case cwhen "\000"c = "\\"when "\010"# boldtemp_bitmap.font.bold = !temp_bitmap.font.boldc = ''when "\011"# italicstemp_bitmap.font.italic = !temp_bitmap.font.italicc = ''end@line_widths[3-i] += temp_bitmap.text_size©.widthendif (3-i) >= $game_temp.choice_start# account for indenting@line_widths[3-i] += 8 unless $game_system.message.autocenterendendif $game_temp.num_input_variable_id > 0# determine cursor_width as in Window_InputNumber# (can't get from @input_number_window because it doesn't exist yet)cursor_width = temp_bitmap.text_size("0").width + 8# use this width to calculate line width (+8 for indent)input_number_width = cursor_width*$game_temp.num_input_digits_maxinput_number_width += 8 unless $game_system.message.autocenter@line_widths[$game_temp.num_input_start] = input_number_widthendtemp_bitmap.disposeendresizereposition if @float_id != nilself.contents.font.name = $game_system.message.font_nameself.contents.font.size = $game_system.message.font_sizeself.contents.font.color = text_color(@font_color)self.windowskin = RPG::Cache.windowskin(@windowskin)# autocenter first line if enabled# (subsequent lines are done as "\n" is encountered)if $game_system.message.autocenter and @text != ""@x = (self.width-40)/2 - @line_widths[0]/2end#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------endend#--------------------------------------------------------------------------# * Resize Window#--------------------------------------------------------------------------def resizeif !$game_system.message.resize# reset to defaultsself.width = 480self.height = 160self.contents = Bitmap.new(width - 32, height - 32)self.x = 80 # undo any centeringreturnendmax_x = @line_widths.maxmax_y = 4@line_widths.each do |line|max_y -= 1 if line == 0 and max_y > 1endif $game_temp.choice_max > 0# account for indentingmax_x += 8 unless $game_system.message.autocenterendself.width = max_x + 40self.height = max_y * 32 + 32self.contents = Bitmap.new(width - 32, height - 32)self.x = 320 - (self.width/2) # centerend#--------------------------------------------------------------------------# * Reposition Window#--------------------------------------------------------------------------def repositionif $game_temp.in_battleif "abcd".include?(@float_id) # must be between a and d@float_id = @float_id[0] - 97 # a = 0, b = 1, c = 2, d = 3return if $scene.spriteset.actor_sprites[@float_id] == nilsprite = $scene.spriteset.actor_sprites[@float_id]else@float_id -= 1 # account for, e.g., player entering 1 for index 0return if $scene.spriteset.enemy_sprites[@float_id] == nilsprite = $scene.spriteset.enemy_sprites[@float_id]endchar_height = sprite.heightchar_width = sprite.widthchar_x = sprite.xchar_y = sprite.y - char_height/2else # not in battle...char = (@float_id == 0 ? $game_player : $game_map.events[@float_id])if char == nil# no such character@float_id = nilreturnend# close message (and stop event processing) if speaker is off-screenif char.screen_x <= 0 or char.screen_x >= 640 orchar.screen_y <= 0 or char.screen_y > 480terminate_message$game_system.map_interpreter.command_115returnendchar_height = RPG::Cache.character(char.character_name,0).height / 4char_width = RPG::Cache.character(char.character_name,0).width / 4# record coords of character's centerchar_x = char.screen_xchar_y = char.screen_y - char_height/2endparams = [char_height, char_width, char_x, char_y]# position window and message tailvars = new_position(params)x = vars[0]y = vars[1]# check if any window locations need to be "flipped"if @location == 4 and x < 0# switch to right@location = 6vars = new_position(params)x = vars[0]if (x + self.width) > 640# right is no good either...if y >= 0# switch to top@location = 8vars = new_position(params)else# switch to bottom@location = 2vars = new_position(params)endendelsif @location == 6 and (x + self.width) > 640# switch to left@location = 4vars = new_position(params)x = vars[0]if x < 0# left is no good either...if y >= 0# switch to top@location = 8vars = new_position(params)else# switch to bottom@location = 2vars = new_position(params)endendelsif @location == 8 and y < 0# switch to bottom@location = 2vars = new_position(params)y = vars[1]if (y + self.height) > 480# bottom is no good either...# note: this will probably never occur given only 3 lines of textx = vars[0]if x >= 0# switch to left@location = 4vars = new_position(params)else# switch to right@location = 6vars = new_position(params)endendelsif @location == 2 and (y + self.height) > 480# switch to top@location = 8vars = new_position(params)y = vars[1]if y < 0# top is no good either...# note: this will probably never occur given only 3 lines of textx = vars[0]if x >= 0# switch to left@location = 4vars = new_position(params)else# switch to right@location = 6vars = new_position(params)endendendx = vars[0]y = vars[1]tail_x = vars[2]tail_y = vars[3]# adjust windows if near edge of screenif x < 0x = 0elsif (x + self.width) > 640x = 640 - self.widthendif y < 0y = 0elsif (y + self.height) > 480y = 480 - self.heightelsif $game_temp.in_battle and @location == 2 and (y > (320 - self.height))# when in battle, prevent enemy messages from overlapping battle status# (note that it could still happen from actor messages, though)y = 320 - self.heighttail_y = yend# finalize positionsself.x = xself.y = y@tail.x = tail_x@tail.y = tail_yend#--------------------------------------------------------------------------# * Determine New Window Position#--------------------------------------------------------------------------def new_position(params)char_height = params[0]char_width = params[1]char_x = params[2]char_y = params[3]if @location == 8# topx = char_x - self.width/2y = char_y - char_height/2 - self.height - @tail.bitmap.height/2@tail.bitmap.rotation(0)tail_x = x + self.width/2tail_y = y + self.heightelsif @location == 2# bottomx = char_x - self.width/2y = char_y + char_height/2 + @tail.bitmap.height/2@tail.bitmap.rotation(180)tail_x = x + self.width/2tail_y = yelsif @location == 4# leftx = char_x - char_width/2 - self.width - @tail.bitmap.width/2y = char_y - self.height/2@tail.bitmap.rotation(270)tail_x = x + self.widthtail_y = y + self.height/2elsif @location == 6# rightx = char_x + char_width/2 + @tail.bitmap.width/2y = char_y - self.height/2@tail.bitmap.rotation(90)tail_x = xtail_y = y + self.height/2endreturn [x,y,tail_x,tail_y]end#--------------------------------------------------------------------------# * Update Text#--------------------------------------------------------------------------def update_textif @text != nil# Get 1 text character in c (loop until unable to get text)while ((c = @text.slice!(/./m)) != nil)# If \\if c == "\000"# Return to original textc = "\\"end# If \C[n]if c == "\001"# Change text color@text.sub!(/\[([0-9]+)\]/, "")color = $1.to_iif color >= 0 and color <= 7self.contents.font.color = text_color(color)end# go to next textnextend# If \Gif c == "\002"# Make gold windowif @gold_window == nil@gold_window = Window_Gold.new@gold_window.x = 560 - @gold_window.widthif $game_temp.in_battle@gold_window.y = 192else@gold_window.y = self.y >= 128 ? 32 : 384end@gold_window.opacity = self.opacity@gold_window.back_opacity = self.back_opacityend# go to next textnextend# If \Lif c == "\003"# toggle letter-by-letter mode@letter_by_letter = !@letter_by_letter# go to next textnextend# If \S[n]if c == "\004"@text.sub!(/\[([0-9]+)\]/, "")speed = $1.to_iif speed >= 0@text_speed = speed# reset player skip after text speed change@player_skip = falseendreturnend# If \D[n]if c == "\005"@text.sub!(/\[([0-9]+)\]/, "")delay = $1.to_iif delay >= 0@delay += delay# reset player skip after delay@player_skip = falseendreturnend# If \!if c == "\006"# close message and return from methodterminate_messagereturnend# If \?if c == "\007"@wait_for_input = truereturnendif c == "\010"# boldself.contents.font.bold = !self.contents.font.boldendif c == "\011"# italicsself.contents.font.italic = !self.contents.font.italicend# If new line textif c == "\n"# Update cursor width if choiceif @y >= $game_temp.choice_startwidth = $game_system.message.autocenter ? @line_widths[@y]+8 : @x@cursor_width = [@cursor_width, width].maxend# Add 1 to y@y += 1if $game_system.message.autocenter and @text != ""@x = (self.width-40)/2 - @line_widths[@y]/2else@x = 0# Indent if choiceif @y >= $game_temp.choice_start@x = 8endend# go to next textnextend# Draw textself.contents.draw_text(4 + @x, 32 * @y, 40, 32, c)# Add x to drawn text width@x += self.contents.text_size( c ).width# add text speed to time to display next character@delay += @text_speed unless !@letter_by_letter or @player_skipreturn if @letter_by_letter and !@player_skipendend# If choiceif $game_temp.choice_max > 0@item_max = $game_temp.choice_maxself.active = trueself.index = 0end# If number inputif $game_temp.num_input_variable_id > 0digits_max = $game_temp.num_input_digits_maxnumber = $game_variables[$game_temp.num_input_variable_id]@input_number_window = Window_InputNumber.new(digits_max)@input_number_window.number = number@input_number_window.x =if $game_system.message.autocenteroffset = (self.width-40)/2-@line_widths[$game_temp.num_input_start]/2self.x + offset + 4elseself.x + 8end@input_number_window.y = self.y + $game_temp.num_input_start * 32end@update_text = falseend#--------------------------------------------------------------------------# * Set Window Position and Opacity Level#--------------------------------------------------------------------------def reset_windowif $game_temp.in_battleself.y = 16elsecase $game_system.message_positionwhen 0 # upself.y = 16when 1 # middleself.y = 160when 2 # downself.y = 304endendif $game_system.message_frame == 0self.opacity = 255elseself.opacity = 0end#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# transparent speech bubbles don't look right, so keep opacity at 255# self.back_opacity = 160@tail.opacity = 255#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------enddef updatesuper# If fade inif @fade_inself.contents_opacity += 24if @input_number_window != nil@input_number_window.contents_opacity += 24endif self.contents_opacity == 255@fade_in = falseend#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# return#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------end# If inputting numberif @input_number_window != nil@input_number_window.update# Confirmif Input.trigger?(Input::C)$game_system.se_play($data_system.decision_se)$game_variables[$game_temp.num_input_variable_id] =@input_number_window.number$game_map.need_refresh = true# Dispose of number input window@input_number_window.dispose@input_number_window = nilterminate_messageendreturnend# If message is being displayedif @contents_showing#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# Confirm or cancel finishes waiting for input or messageif Input.trigger?(Input::C) or Input.trigger?(Input::B)if @wait_for_input@wait_for_input = falseself.pause = falseelsif $game_system.message.skippable@player_skip = trueendendif need_reposition?reposition # update message position for character/screen movementif @contents_showing == false# i.e. if char moved off screenreturnendendif @update_text and !@wait_for_inputif @delay == 0update_textelse@delay -= 1endreturnend# If choice isn't being displayed, show pause signif !self.pause and ($game_temp.choice_max == 0 or @wait_for_input)self.pause = true unless !$game_system.message.show_pauseend#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------# Cancelif Input.trigger?(Input::B)if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0$game_system.se_play($data_system.cancel_se)$game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)terminate_messageend#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# personal preference: cancel button should also continueterminate_message#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------end# Confirmif Input.trigger?(Input::C)if $game_temp.choice_max > 0$game_system.se_play($data_system.decision_se)$game_temp.choice_proc.call(self.index)endterminate_messageendreturnend# If display wait message or choice exists when not fading outif @fade_out == false and $game_temp.message_text[@msgindex] != nil@contents_showing = true$game_temp.message_window_showing = truereset_windowrefreshGraphics.frame_resetself.visible = true#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------if show_message_tail?@tail.visible = trueelsif @tail.visible@tail.visible = falseend#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------self.contents_opacity = 0if @input_number_window != nil@input_number_window.contents_opacity = 0end@fade_in = truereturnend# If message which should be displayed is not shown, but window is visibleif self.visible@fade_out = trueself.opacity -= 48#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------@tail.opacity -= 48 if @tail.opacity > 0if need_reposition?reposition # update message position for character/screen movementend#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------if self.opacity == 0self.visible = false@fade_out = false#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------@tail.visible = false if @tail.visible# have to check all windows before claiming that no window is showingif $game_temp.message_text.compact.empty?#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------$game_temp.message_window_showing = false#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------end#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------endreturnendend#--------------------------------------------------------------------------# * Repositioning Determination#--------------------------------------------------------------------------def need_reposition?if !$game_temp.in_battle and $game_system.message.floating and$game_system.message.resize and @float_id != nilif $game_system.message.move_during and @float_id == 0 and(($game_player.last_real_x != $game_player.real_x) or($game_player.last_real_y != $game_player.real_y))# player with floating message moved# (note that relying on moving? leads to "jumpy" message boxes)return trueelsif ($game_map.last_display_y != $game_map.display_y) or($game_map.last_display_x != $game_map.display_x)# player movement or scroll event caused the screen to scrollreturn trueelsechar = $game_map.events[@float_id]if char != nil and((char.last_real_x != char.real_x) or(char.last_real_y != char.real_y))# character movedreturn trueendendendreturn falseend#--------------------------------------------------------------------------# * Show Message Tail Determination#--------------------------------------------------------------------------def show_message_tail?if $game_system.message.show_tail and $game_system.message.floating and$game_system.message.resize and $game_system.message_frame == 0 and@float_id != nilreturn trueendreturn falseenddef update_cursor_rectif @index >= 0n = $game_temp.choice_start + @index#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------if $game_system.message.autocenterx = 4 + (self.width-40)/2 - @cursor_width/2elsex = 8endself.cursor_rect.set(x, n * 32, @cursor_width, 32)#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------elseself.cursor_rect.emptyendendend#------------------------------------------------------------------------------class Game_Characterattr_reader :last_real_x # last map x-coordinateattr_reader :last_real_y # last map y-coordinatealias wachunga_game_char_update updatedef update@last_real_x = @real_x@last_real_y = @real_ywachunga_game_char_updateendend#------------------------------------------------------------------------------class Game_Player < Game_Characteralias wachunga_mmw_game_player_update updatedef update# The conditions are changed so the player can move around while messages# are showing (if move_during is true), but not if user is making a# choice or inputting a number# Note that this check overrides the default one (later in the method)# because it is more generalunless moving? or@move_route_forcing or($game_system.map_interpreter.running? and!$game_temp.message_window_showing) or($game_temp.message_window_showing and!$game_system.message.move_during) or($game_temp.choice_max > 0 or $game_temp.num_input_digits_max > 0)case Input.dir4when 2move_downwhen 4move_leftwhen 6move_rightwhen 8move_upendendwachunga_mmw_game_player_updateendend#------------------------------------------------------------------------------class Game_Tempalias wachunga_mmw_game_temp_initialize initializedef initializewachunga_mmw_game_temp_initialize@message_text = []@message_proc = []endend#------------------------------------------------------------------------------class Sprite_Battler < RPG::Sprite# necessary for positioning messages relative to battlersattr_reader :heightattr_reader :widthend#------------------------------------------------------------------------------class Scene_Battle# necessary for accessing actor/enemy sprites in battleattr_reader :spritesetend#------------------------------------------------------------------------------class Spriteset_Battle# necessary for accessing actor/enemy sprites in battleattr_reader :actor_spritesattr_reader :enemy_spritesend#------------------------------------------------------------------------------class Scene_Map# can't alias these methods unfortunately# (SDK would help compatibility a little)def main# Make sprite set@spriteset = Spriteset_Map.new# Make message window#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------@message_window = []@message_window[0] = Window_Message.new(0)#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------# Transition runGraphics.transition# Main looploop do# Update game screenGraphics.update# Update input informationInput.update# Frame updateupdate# Abort loop if screen is changedif $scene != selfbreakendend# Prepare for transitionGraphics.freeze# Dispose of sprite set@spriteset.dispose# Dispose of message window#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------for mw in @message_windowmw.disposeend#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------# If switching to title screenif $scene.is_a?(Scene_Title)# Fade out screenGraphics.transitionGraphics.freezeendenddef update# Looploop do# Update map, interpreter, and player order# (this update order is important for when conditions are fulfilled# to run any event, and the player isn't provided the opportunity to# move in an instant)$game_map.update$game_system.map_interpreter.update$game_player.update# Update system (timer), screen$game_system.update$game_screen.update# Abort loop if player isn't place movingunless $game_temp.player_transferringbreakend# Run place movetransfer_player# Abort loop if transition processingif $game_temp.transition_processingbreakendend# Update sprite set@spriteset.update# Update message window#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------for mw in @message_windowmw.updateend#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------# If game overif $game_temp.gameover# Switch to game over screen$scene = Scene_Gameover.newreturnend# If returning to title screenif $game_temp.to_title# Change to title screen$scene = Scene_Title.newreturnend# If transition processingif $game_temp.transition_processing# Clear transition processing flag$game_temp.transition_processing = false# Execute transitionif $game_temp.transition_name == ""Graphics.transition(20)elseGraphics.transition(40, "Graphics/Transitions/" +$game_temp.transition_name)endend# If showing message windowif $game_temp.message_window_showingreturnend# If encounter list isn't empty, and encounter count is 0if $game_player.encounter_count == 0 and $game_map.encounter_list != []# If event is running or encounter is not forbiddenunless $game_system.map_interpreter.running? or$game_system.encounter_disabled# Confirm troopn = rand($game_map.encounter_list.size)troop_id = $game_map.encounter_list[n]# If troop is validif $data_troops[troop_id] != nil# Set battle calling flag$game_temp.battle_calling = true$game_temp.battle_troop_id = troop_id$game_temp.battle_can_escape = true$game_temp.battle_can_lose = false$game_temp.battle_proc = nilendendend# If B button was pressedif Input.trigger?(Input::B)# If event is running, or menu is not forbiddenunless $game_system.map_interpreter.running? or$game_system.menu_disabled# Set menu calling flag or beep flag$game_temp.menu_calling = true$game_temp.menu_beep = trueendend# If debug mode is ON and F9 key was pressedif $DEBUG and Input.press?(Input::F9)# Set debug calling flag$game_temp.debug_calling = trueend# If player is not movingunless $game_player.moving?# Run calling of each screenif $game_temp.battle_callingcall_battleelsif $game_temp.shop_callingcall_shopelsif $game_temp.name_callingcall_nameelsif $game_temp.menu_callingcall_menuelsif $game_temp.save_callingcall_saveelsif $game_temp.debug_callingcall_debugendendend#--------------------------------------------------------------------------# * New Message Window Addition#--------------------------------------------------------------------------def new_message_window(index)if @message_window[index] != nil# clear message windows at and after this indexlast_index = @message_window.size - 1last_index.downto(index) do |i|if @message_window != nil@message_window.dispose@message_window = nilendend@message_window.compact!end@message_window.push(Window_Message.new(index))endend#------------------------------------------------------------------------------class Scene_Battle# can't alias these methods unfortunately# (SDK would help compatibility a little)def main# Initialize each kind of temporary battle data$game_temp.in_battle = true$game_temp.battle_turn = 0$game_temp.battle_event_flags.clear$game_temp.battle_abort = false$game_temp.battle_main_phase = false$game_temp.battleback_name = $game_map.battleback_name$game_temp.forcing_battler = nil# Initialize battle event interpreter$game_system.battle_interpreter.setup(nil, 0)# Prepare troop@troop_id = $game_temp.battle_troop_id$game_troop.setup(@troop_id)# Make actor command windows1 = $data_system.words.attacks2 = $data_system.words.skills3 = $data_system.words.guards4 = $data_system.words.item@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])@actor_command_window.y = 160@actor_command_window.back_opacity = 160@actor_command_window.active = false@actor_command_window.visible = false# Make other windows@party_command_window = Window_PartyCommand.new@help_window = Window_Help.new@help_window.back_opacity = 160@help_window.visible = false@status_window = Window_BattleStatus.new#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------@message_window = []@message_window[0] = Window_Message.new(0)#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------# Make sprite set@spriteset = Spriteset_Battle.new# Initialize wait count@wait_count = 0# Execute transitionif $data_system.battle_transition == ""Graphics.transition(20)elseGraphics.transition(40, "Graphics/Transitions/" +$data_system.battle_transition)end# Start pre-battle phasestart_phase1# Main looploop do# Update game screenGraphics.update# Update input informationInput.update# Frame updateupdate# Abort loop if screen is changedif $scene != selfbreakendend# Refresh map$game_map.refresh# Prepare for transitionGraphics.freeze# Dispose of windows@actor_command_window.dispose@party_command_window.dispose@help_window.dispose@status_window.dispose#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------for mw in @message_windowmw.disposeend#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------if @skill_window != nil@skill_window.disposeendif @item_window != nil@item_window.disposeendif @result_window != nil@result_window.disposeend# Dispose of sprite set@spriteset.dispose# If switching to title screenif $scene.is_a?(Scene_Title)# Fade out screenGraphics.transitionGraphics.freezeend# If switching from battle test to any screen other than game over screenif $BTEST and not $scene.is_a?(Scene_Gameover)$scene = nilendenddef update# If battle event is runningif $game_system.battle_interpreter.running?# Update interpreter$game_system.battle_interpreter.update# If a battler which is forcing actions doesn't existif $game_temp.forcing_battler == nil# If battle event has finished runningunless $game_system.battle_interpreter.running?# Rerun battle event set up if battle continuesunless judgesetup_battle_eventendend# If not after battle phaseif @phase != 5# Refresh status window@status_window.refreshendendend# Update system (timer) and screen$game_system.update$game_screen.update# If timer has reached 0if $game_system.timer_working and $game_system.timer == 0# Abort battle$game_temp.battle_abort = trueend# Update windows@help_window.update@party_command_window.update@actor_command_window.update@status_window.update#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------for mw in @message_windowmw.updateend#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------# Update sprite set@spriteset.update# If transition is processingif $game_temp.transition_processing# Clear transition processing flag$game_temp.transition_processing = false# Execute transitionif $game_temp.transition_name == ""Graphics.transition(20)elseGraphics.transition(40, "Graphics/Transitions/" +$game_temp.transition_name)endend# If message window is showingif $game_temp.message_window_showingreturnend# If effect is showingif @spriteset.effect?returnend# If game overif $game_temp.gameover# Switch to game over screen$scene = Scene_Gameover.newreturnend# If returning to title screenif $game_temp.to_title# Switch to title screen$scene = Scene_Title.newreturnend# If battle is abortedif $game_temp.battle_abort# Return to BGM used before battle started$game_system.bgm_play($game_temp.map_bgm)# Battle endsbattle_end(1)returnend# If waitingif @wait_count > 0# Decrease wait count@wait_count -= 1returnend# If battler forcing an action doesn't exist,# and battle event is runningif $game_temp.forcing_battler == nil and$game_system.battle_interpreter.running?returnend# Branch according to phasecase @phasewhen 1 # pre-battle phaseupdate_phase1when 2 # party command phaseupdate_phase2when 3 # actor command phaseupdate_phase3when 4 # main phaseupdate_phase4when 5 # after battle phaseupdate_phase5endend#--------------------------------------------------------------------------# * New Message Window Addition#--------------------------------------------------------------------------def new_message_window(index)if @message_window[index] != nil# clear message windows at and after this indexlast_index = @message_window.size - 1last_index.downto(index) do |i|if @message_window != nil@message_window.dispose@message_window = nilendend@message_window.compact!end@message_window.push(Window_Message.new(index))endend#------------------------------------------------------------------------------class Game_Systemattr_reader :messagealias wachunga_mmw_game_system_init initializedef initializewachunga_mmw_game_system_init@message = Game_Message.newendend#------------------------------------------------------------------------------class Interpreterattr_reader :event_idalias wachunga_mmw_interp_setup setupdef setup(list, event_id)wachunga_mmw_interp_setup(list, event_id)# index of window for the message@msgindex = 0# whether multiple messages are displaying@multi_message = falseenddef setup_choices(parameters)# Set choice item count to choice_max$game_temp.choice_max = parameters[0].size# Set choice to message_textfor text in parameters[0]#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# just add index for array$game_temp.message_text[@msgindex] += text + "\n"#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------end# Set cancel processing$game_temp.choice_cancel_type = parameters[1]# Set callbackcurrent_indent = @list[@index].indent$game_temp.choice_proc = Proc.new { |n| @branch[current_indent] = n }end#--------------------------------------------------------------------------# * Show Text#--------------------------------------------------------------------------def command_101# If other text has been set to message_text#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------if $game_temp.message_text[@msgindex] != nilif @multi_message@msgindex += 1$scene.new_message_window(@msgindex)else# End#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------return false#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------endend@msgindex = 0 if !@multi_message@multi_message = false#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------# Set message end waiting flag and callback@message_waiting = true#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# just adding indexes$game_temp.message_proc[@msgindex] = Proc.new { @message_waiting = false }# Set message text on first line$game_temp.message_text[@msgindex] = @list[@index].parameters[0] + "\n"#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------line_count = 1# Looploop do# If next event command text is on the second line or afterif @list[@index+1].code == 401# Add the second line or after to message_text#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# just adding index$game_temp.message_text[@msgindex]+=@list[@index+1].parameters[0]+"\n"#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------line_count += 1# If event command is not on the second line or afterelse# If next event command is show choicesif @list[@index+1].code == 102# If choices fit on screenif @list[@index+1].parameters[0].size <= 4 - line_count# Advance index@index += 1# Choices setup$game_temp.choice_start = line_countsetup_choices(@list[@index].parameters)end# If next event command is input numberelsif @list[@index+1].code == 103# If number input window fits on screenif line_count < 4# Advance index@index += 1# Number input setup$game_temp.num_input_start = line_count$game_temp.num_input_variable_id = @list[@index].parameters[0]$game_temp.num_input_digits_max = @list[@index].parameters[1]end#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# start multimessage if next line is "Show Text" starting with "\\+"elsif @list[@index+1].code == 101if @list[@index+1].parameters[0][0..1]=="\\+"@multi_message = true@message_waiting = falseend#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------end# Continuereturn trueend# Advance index@index += 1endend#--------------------------------------------------------------------------# * Show Choices#--------------------------------------------------------------------------def command_102# If text has been set to message_text#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# just adding indexif $game_temp.message_text[@msgindex] != nil#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------# Endreturn falseend# Set message end waiting flag and callback@message_waiting = true#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# adding more indexes$game_temp.message_proc[@msgindex] = Proc.new { @message_waiting = false }# Choices setup$game_temp.message_text[@msgindex] = ""#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------$game_temp.choice_start = 0setup_choices(@parameters)# Continuereturn trueend#--------------------------------------------------------------------------# * Input Number#--------------------------------------------------------------------------def command_103# If text has been set to message_text#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# just adding indexif $game_temp.message_text[@msgindex] != nil#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------# Endreturn falseend# Set message end waiting flag and callback@message_waiting = true#------------------------------------------------------------------------------# Begin Multiple Message Windows Edit#------------------------------------------------------------------------------# adding more indexes$game_temp.message_proc[@msgindex] = Proc.new { @message_waiting = false }# Number input setup$game_temp.message_text[@msgindex] = ""#------------------------------------------------------------------------------# End Multiple Message Windows Edit#------------------------------------------------------------------------------$game_temp.num_input_start = 0$game_temp.num_input_variable_id = @parameters[0]$game_temp.num_input_digits_max = @parameters[1]# Continuereturn trueend#--------------------------------------------------------------------------# * Script#--------------------------------------------------------------------------# Fix for RMXP bug: call script boxes that return false hang the game# See, e.g., http://rmxp.org/forums/showthread.php?p=106639#--------------------------------------------------------------------------def command_355# Set first line to scriptscript = @list[@index].parameters[0] + "\n"# Looploop do# If next event command is second line of script or afterif @list[@index+1].code == 655# Add second line or after to scriptscript += @list[@index+1].parameters[0] + "\n"# If event command is not second line or afterelse# Abort loopbreakend# Advance index@index += 1end# Evaluationresult = eval(script)# If return value is falseif result == false# End#------------------------------------------------------------------------------# Begin Edit#------------------------------------------------------------------------------#return false#------------------------------------------------------------------------------# End Edit#------------------------------------------------------------------------------end# Continuereturn trueenddef message$game_system.messageendend#------------------------------------------------------------------------------class Game_Mapattr_accessor :last_display_x # last display x-coord * 128attr_accessor :last_display_y # last display y-coord * 128alias wachunga_mmw_game_map_update updatedef update@last_display_x = @display_x@last_display_y = @display_ywachunga_mmw_game_map_updateenddef namereturn load_data('Data/MapInfos.rxdata')[@map_id].nameendend#------------------------------------------------------------------------------class Bitmapattr_accessor :orientation#--------------------------------------------------------------------------# * Rotation Calculation#--------------------------------------------------------------------------def rotation(target)return if not [0, 90, 180, 270].include?(target) # invalid orientationif @rotation != targetdegrees = target - @orientationif degrees < 0degrees += 360endrotate(degrees)endend#--------------------------------------------------------------------------# * Rotate Square (Clockwise)#--------------------------------------------------------------------------def rotate(degrees = 90)# method originally by SephirothSpawn# would just use Sprite.angle but its rotation is buggy# (see http://www.rmxp.org/forums/showthread.php?t=12044)return if not [90, 180, 270].include?(degrees)copy = self.cloneif degrees == 90# Passes Through all Pixels on Dummy Bitmapfor i in 0...self.heightfor j in 0...self.widthself.set_pixel(width - i - 1, j, copy.get_pixel(j, i))endendelsif degrees == 180for i in 0...self.heightfor j in 0...self.widthself.set_pixel(width - j - 1, height - i - 1, copy.get_pixel(j, i))endendelsif degrees == 270for i in 0...self.heightfor j in 0...self.widthself.set_pixel(i, height - j - 1, copy.get_pixel(j, i))endendend@orientation = (@orientation + degrees) % 360endend and here's a picture of my problem: this script is a multiple message script. now about the photo; when put my text in italics, that square shape appears everytime and my messages get cut off as you can see in the photo Share this post Link to post Share on other sites
Marked 197 Report post Posted October 13, 2014 Please make a new topic for each new problem. I'm not picking on you, that's just the best way to do things and pretty much a universal rule of forums. Topic closed. Don't forgot to re-post your problem in a new topic to get help :thumbsup: . Share this post Link to post Share on other sites