Hello guys,
I am having a problem using the aforementioned script. When I activate the scene either from a key shortcut or from the menu, I get an interpreter error.
I am having a problem using the aforementioned script. When I activate the scene either from a key shortcut or from the menu, I get an interpreter error.
It's a 1484 error saying no capital for nil.class. I do have the Yanfly menu script.#==============================================================================
# ** MA_Window_ParagraphFormat
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This module inserts into Window_Base and provides a method to format the
# strings so as to go to the next line if it exceeds a set limit. This is
# designed to work with draw_text_ex, and a string formatted by this method
# should go through that, not draw_text.
#==============================================================================
module MA_Window_ParagraphFormat
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Calc Line Width
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def mapf_calc_line_width(line, tw = 0, contents_dummy = false)
return tw if line.nil?
line = line.clone
unless contents_dummy
real_contents = contents # Preserve Real Contents
# Create a dummy contents
self.contents = Bitmap.new(contents_width, 24)
reset_font_settings
end
pos = {x: 0, y: 0, new_x: 0, height: calc_line_height(line)}
while line[/^(.*?)\e(.*)/]
tw += text_size($1).width
line = $2
# Remove all ancillaries to the code, like parameters
code = obtain_escape_code(line)
# If direct setting of x, reset tw.
tw = 0 if ($imported[:ATS_SpecialMessageCodes] && code.upcase == 'X') ||
($imported["YEA-MessageSystem"] && code.upcase == 'PX')
# If I need to do something special on the basis that it is testing,
# alias process_escape_character and differentiate using @atsf_testing
process_escape_character(code, line, pos)
end
# Add width of remaining text, as well as the value of pos[:x] under the
# assumption that any additions to it are because the special code is
# replaced by something which requires space (like icons)
tw += text_size(line).width + pos[:x]
unless contents_dummy
contents.dispose # Dispose dummy contents
self.contents = real_contents # Restore real contents
end
return tw
end