by Dargor
Version 1.3
Introduction
I was tired of squeezed text in the help window when an description is too long. So I made this script!
This script will not squeeze the text. Instead, it will scroll it if it's larger than the help window.
This script also supports some message codes like changing colors, displaying variables and actor names.
You also have the possibility to switch to letter by letter mode!
Features
- Scrolling text
- 3 Scrolling modes: 1 Vertical, 2 Horizontal
- Can add new lines using the \L code
- Customizable scrolling delay
- Letter by letter
- Color message code
- Variable message code
- Actor name message code
Script
Code:
#==============================================================================
# ** Advanced Help
#------------------------------------------------------------------------------
#  © Dargor, 2008-2009
# Â 17/02/09
# Â Version 1.3
#------------------------------------------------------------------------------
# Â VERSION HISTORY:
# Â - 1.0 (02/11/08), Initial release
# Â - 1.1 (03/11/08), Now compatible with the Takentai CBS
# Â - 1.2 (17/02/09), Text can now scroll vertically using Scroll Mode 2
# Â - 1.3 (17/02/09), Now works with text alignment
#------------------------------------------------------------------------------
# Â INSTRUCTIONS:
# Â - Place this script above Main
# Â - Edit the constants in the Advanced Help module and enjoy!
#------------------------------------------------------------------------------
# Â Notes
# Â This script handles the following message codes.
#  - Color    : \C[n]
#  - Variable  : \V[n]
# Â - Actor Name : \N[n]
#  - New Line  : \L
#==============================================================================
Â
#==============================================================================
# ** Advanced Help Configuration Module
#==============================================================================
Â
module Advanced_Help
 # The delay (in frames) before the text starts to scroll
 Scroll_Wait = 120
 # Scroll Mode
 # 0 : Scrolls to left and loops
 # 1 : Scrolls to left and goes back to its origin.
 # 2 : Scrolls down and goes back to its origin when using 2+ lines.
 Scroll_Mode = 0
 # Letter by letter
 Letter_By_Letter = true
end
Â
#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# Â This window shows skill and item explanations along with actor status.
#==============================================================================
Â
class Window_Help < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 alias dargor_vx_help_scroll_update update
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
  super(0, 0, 544, WLH + 32)
  @scroll_wait = 0
  @scroll_mode = Advanced_Help::Scroll_Mode
  @temp_wait = 0
  @text = ''
  @new_text = ''
  @last_text = ''
  @contents_x = 0
  @line_y = 0
 end
 #--------------------------------------------------------------------------
 # * Set Text
 #  text  : character string displayed in window
 #  align : alignment (0..flush left, 1..center, 2..flush right)
 #--------------------------------------------------------------------------
 def set_text(text, align=0)
  @last_text = @text
  if text != @text or align != @align
   self.ox = 0
   self.oy = 0
   self.contents.clear
   @scroll_wait = Advanced_Help::Scroll_Wait
   @text = text
   @new_text = text.dup
   @temp_text = @new_text.dup
   @align = align
   @max_line_y = 0
   @contents_x = 0
   if align == 1
    @contents_x = ((self.width - get_contents_width) / 2) - 16
   elsif align == 2
    @contents_x = (self.width - get_contents_width) - 32
   end
   if @scroll_mode == 2
    ch = (get_contents_height + 1) * WLH
    self.contents = Bitmap.new(self.width - 32, ch)
   else
    cw = [contents.text_size(text).width + 16, 32].max
    self.contents = Bitmap.new(cw, WLH)
   end
   convert_special_characters
  end
 end
 #--------------------------------------------------------------------------
 # * Get the number of lines in the text
 #--------------------------------------------------------------------------
 def get_contents_height
  @temp_text.gsub!(/\\L/)        { @max_line_y += 1 }
  return @max_line_y
 end
 #--------------------------------------------------------------------------
 # * Get the width of the text
 #--------------------------------------------------------------------------
 def get_contents_width
  @temp_text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  @temp_text.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
  @temp_text.gsub!(/\\C\[([0-9]+)\]/i) { "" }
  @temp_text.gsub!(/\\L/)        { "" }
  return self.contents.text_size(@temp_text).width
 end
 #--------------------------------------------------------------------------
 # * Convert Special Characters
 #--------------------------------------------------------------------------
 def convert_special_characters
  @new_text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  @new_text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  @new_text.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
  @new_text.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
  @new_text.gsub!(/\\G/)        { "\x02" }
  @new_text.gsub!(/\\\./)       { "\x03" }
  @new_text.gsub!(/\\\|/)       { "\x04" }
  @new_text.gsub!(/\\!/)        { "\x05" }
  @new_text.gsub!(/\\>/)        { "\x06" }
  @new_text.gsub!(/\\</)        { "\x07" }
  @new_text.gsub!(/\\\^/)       { "\x08" }
  @new_text.gsub!(/\\L/)        { "\x09" }
  @new_text.gsub!(/\\\\/)       { "\\" }
 end
 #--------------------------------------------------------------------------
 # * Update Message
 #--------------------------------------------------------------------------
 def update_message
  # Draw text letter by letter
  if Advanced_Help::Letter_By_Letter
   loop do
    c = @new_text.slice!(/./m)       # Get next text character
    case c
    when nil              # There is no text that must be drawn
     break
    when "\x01"            # \C[n]  (text character color change)
     @new_text.sub!(/\[([0-9]+)\]/, "")
     contents.font.color = text_color($1.to_i)
     next
    when "\x09"
     @contents_x = 0
     @line_y += 1
    else                # Normal text character
     contents.draw_text(@contents_x, @line_y * WLH, 40, WLH, c)
     c_width = contents.text_size(c).width
     @contents_x += c_width
    end
    break
   end
  # Draw the whole text
  else Â
   while (c = @new_text.slice!(/./m)) != nil
    case c
    when nil              # There is no text that must be drawn
     break
    when "\x01"            # \C[n]  (text character color change)
     @new_text.sub!(/\[([0-9]+)\]/, "")
     contents.font.color = text_color($1.to_i)
     next
    when "\x09"
     @contents_x = 0
     @line_y += 1
    else                # Normal text character
     contents.draw_text(@contents_x, @line_y * WLH, 40, WLH, c)
     c_width = contents.text_size(c).width
     @contents_x += c_width
    end
   end
  end
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
  # Draw text
  update_message
  # The usual
  dargor_vx_help_scroll_update
  # Scroll text
  @scroll_wait -= 1
  if @temp_wait > 0
   @temp_wait -= 1
   @temp_wait = -1 if @temp_wait == 0
   return
  else
   if self.oy != 0 && @temp_wait == -1
    self.oy -= 1 if Graphics.frame_count % 2 == 0
    if self.oy % WLH == 0
     @temp_wait = Advanced_Help::Scroll_Wait
     return
    end
    @temp_wait = 0 if self.oy == 0
    return
   end
  end
  if @scroll_mode != 2
   if self.contents.width > self.width && @scroll_wait < 0
    self.ox += 1
    @scroll_wait = Advanced_Help::Scroll_Wait if self.ox == 0
   end
  else
   if self.contents.height + 32 > self.height && @scroll_wait < 0
    self.oy += 1 if Graphics.frame_count % 2 == 0
    if self.oy % WLH == 0
     if self.oy > self.contents.height - WLH
      @temp_wait = Advanced_Help::Scroll_Wait
     else
      @scroll_wait = Advanced_Help::Scroll_Wait
     end
     return
    end
    #@scroll_wait = Advanced_Help::Scroll_Wait if self.oy == 0
   end
  end
  case @scroll_mode
  when 0
   if self.ox > self.contents.width
    self.ox = (-self.contents.width + 64)
   end
  when 1
   if self.ox > self.contents.width + 64
    self.ox = 0
    @scroll_wait = Advanced_Help::Scroll_Wait
   end
  when 2
   if self.oy > self.contents.height - WLH
    @temp_wait = Advanced_Help::Scroll_Wait
    @scroll_wait = Advanced_Help::Scroll_Wait
   end
  end
 end
end
Â
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# Â This class performs battle screen processing.
#==============================================================================
Â
class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_advanced_help_battle_update_basic update_basic
 #--------------------------------------------------------------------------
 # * Basic Update Processing
 #   main : Call from main update method
 #--------------------------------------------------------------------------
 def update_basic(main = false)
  dargor_vx_advanced_help_battle_update_basic(main)
  @help_window.update unless @help_window.nil?
 end
end
Screenshots


Hope you like it!
-Dargor