shadow7396 0 Report post Posted October 13, 2014 I have a script i need help with. Here it is: #==============================================================================# ** Multiple Message Windows#------------------------------------------------------------------------------# Wachunga# 1.1# 2006-11-10# See https://github.com/w...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/foru...ad.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/...ead.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
Moonpearl 32 Report post Posted October 14, 2014 What version of RPG Maker are you using? And what OS? Share this post Link to post Share on other sites
shadow7396 0 Report post Posted October 14, 2014 (edited) how do i check it? or do you mean version as in VX, VX ace, Xp, etc? Edited October 14, 2014 by shadow7396 Share this post Link to post Share on other sites
Moonpearl 32 Report post Posted October 15, 2014 Anything you can tell me. Share this post Link to post Share on other sites
shadow7396 0 Report post Posted October 19, 2014 im using rmxp and thats all i know Share this post Link to post Share on other sites
Moonpearl 32 Report post Posted October 19, 2014 You don't know whether you're using Windows 7 or 8? Share this post Link to post Share on other sites
shadow7396 0 Report post Posted October 20, 2014 oh im using windows 7 Share this post Link to post Share on other sites