[XP] Window Message Mod

Started by ThallionDarkshine, December 13, 2012, 08:14:08 pm

Previous topic - Next topic

ThallionDarkshine

December 13, 2012, 08:14:08 pm Last Edit: December 17, 2012, 06:24:18 pm by ThallionDarkshine
Window Message Mod
Authors: ThallionDarkshine
Version: 2.1
Type: Message Add-on
Key Term: Message Add-on



Introduction

This is a small Window_Message mod I made a while ago to allow letter-by-letter text. It now also includes a way to create text animations such as growing, shrinking, rotating, or shaking text. You can also format text with things like bold, underline, etc.

New feature! You can now create text gradients!

Text Animations:

  • Grow

  • Rotate (rock back and forth)

  • Shrink

  • Shake

  • Float

  • Hue Rotate

  • Bounce

  • Letter Grow

  • Letter Swivel

  • Letter Shrink

  • Letter Colorize

  • Letter Fade

  • Letter Bounce

  • Letter Float



Formatting Properties

  • Bold

  • Italic

  • Underline

  • Overline (pretty much useless but I made it anyways)

  • Strikethrough




Features


  • Specify how many letters are added at a time, and at what interval they are added.

  • Specify word-by-word text

  • Message shortcut to change letter-by-letter options from default.

  • Create animated text!

  • Format text, making it bold, italic, etc.




Screenshots

I'll put some up if requested, but all this does is allow letter-by-letter text.


Demo

None yet.


Script

Spoiler: ShowHide

# Instructions on use of this script
#   - To change the letter-by-letter mode, use:
#       \l[CHAR_AMOUNT, FRAMES]
#         CHAR_AMOUNT - How many chars to add to the string every time it updates
#           note - Use 0 for word-by-word or any negative number for no letter-by-letter
#         FRAMES - How often to add CHAR_AMOUNT characters to the string
#   - To create animated text, use:
#       \a[TYPE]
#         TYPE - Which type of animation the text should have
#           0  - Turn off Animation
#           1  - Grow
#           2  - Rock
#           3  - Shrink
#           4  - Shake
#           5  - Float
#           6  - Color Rotate
#           7  - Bounce
#           8  - Fade
#           9  - Letter Grow (one at a time)
#           10 - Letter Grow (two at a time)
#           11 - Letter Swivel
#           12 - Letter Colorize
#           13 - Letter Fade (one at a time)
#           14 - Letter Fade (two at a time)
#           15 - Letter Shrink (one at a time)
#           16 - Letter Shrink (two at a time)
#           17 - Letter Bounce
#           18 - Letter Float
#      note - you can use simply \a to turn off the animation
#   - Formatting Stuff
#       Bold - <b></b>
#       Italic - <i></i>
#       Underline - <u></u>
#       Overline - <o></o>
#       Strikethrough - <s></s>
#   - To create gradient text, use:
#       <grad=COLOR1:COLOR2></grad>
#         COLOR1 - The left color.
#         COLOR2 - The right color.
#         note - colors can be specified either as RED, GREEN, BLUE or as COLOR_ID
#           or as #RRGGBB (hexadecimal)
#   - The \c[COLOR] command now allows you to specify colors as either RED, GREEN,
#       BLUE or as COLOR_ID or as #RRGGBB (hexadecimal)
#   - To make the letter-by-letter feature wait for a certain length at a some
#       point in the message, use:
#       \w[DURATION]
#         DURATION - How long to delay. Use 0 to wait for the accept button to
#           be pressed.
#         note - You can also use simply \w to wait for the accept button to be
#           pressed.

class Window_Message
 # text mode:
 #   0 - Normal
 #   1 - Letter-by-Letter
 #   2 - Word-by-Word
 DEFAULT_MODE = 1
 # default amount of characters at a time
 DEFAULT_CHARS = 1
 # default number of frames to characters
 DEFAULT_FRAMES = 5
 
 def get_text
   text = $game_temp.message_text
   @wait_points = []
   @wait_count = nil
   if text.gsub!(/\\l(?:\[([\-\d]+)(?:\s*\,\s*([\-\d]+))?\])?/, '') != nil
     @l_l = true
     @l_amnt = $1.nil? ? Window_Message::DEFAULT_CHARS : $1.to_i
     @l_frames = $2.nil? ? Window_Message::DEFAULT_FRAMES : $2.to_i
     @frames = 0
     @length = 0
     if @l_amnt < 0
       @l_l = false
     end
   else
     case Window_Message::DEFAULT_MODE
     when 0:
       @l_l = false
     when 1:
       @l_l = true
       @l_amnt = Window_Message::DEFAULT_CHARS
       @l_frames = Window_Message::DEFAULT_FRAMES
       @frames = 0
       @length = 0
     when 2:
       @l_l = true
       @l_amnt = 0
       @l_frames = Window_Message::DEFAULT_FRAMES
       @frames = 0
       @length = 0
     end
   end
   @text = ""
   begin
     last_text = text.clone
     text.gsub!(/\\[Vv]\[([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" }
   unformatted = text.clone
   unformatted.gsub!(/\\[Cc]\[((?:\d+(?:\s*\,\s*\d+)*)|(?:\#[\da-f]{6}))\]/, "")
   unformatted.gsub!(/\\[Aa]\[(\d+)\]/, "")
   unformatted.gsub!(/\<\/?[a-z]+\>/, '')
   unformatted.gsub!(/\<\/?grad\=((?:\d+(?:\s*\,\s*\d+)*)|(?:\#[\da-f]{6}))\:((?:\d+(?:\s*\,\s*\d+)*)|(?:\#[\da-f]{6}))\>/, '')
   unformatted.gsub!(/\\[Gg]/, '')
   # Change "\\C" to "\001"
   text.gsub!(/\\[Cc]\[((?:\d+(?:\s*\,\s*\d+)*)|(?:\#[\da-f]{6}))\]/) { "\001[#{$1}]" }
   if text.gsub!(/\\[Gg]/, '') != nil and @l_l
     @gold_window = Window_Gold.new
     @gold_window.x = 560 - @gold_window.width
     if $game_temp.in_battle
       @gold_window.y = 192
     else
       @gold_window.y = self.y >= 128 ? 32 : 384
     end
     @gold_window.opacity = self.opacity
     @gold_window.back_opacity = self.back_opacity
   end
   tmp = unformatted.gsub(/[\n\r]/, '')
   while !(ind=tmp.index(/\\[Ww](?:\[(\d+)\])?/)).nil?
     unformatted.sub!(/\\[Ww](?:\[(\d+)\])?/, "")
     tmp.sub!(/\\[Ww](?:\[(\d+)\])?/, "")
     text.sub!(/\\[Ww](?:\[(\d+)\])?/, "")
     @wait_points.push([ind, ($1.nil? ? 0 : $1.to_i)])
   end
   x, y = 0, 0
   gradients = []
   @gradients = []
   # Get 1 text character in c (loop until unable to get text)
   while ((c = text.slice!(/./m)) != nil)
     @text += c
     if c == "\001" or c == "\002"
       next
     end
     if c == "<"    
       if text.index(/grad\=((?:\d+(?:\s*\,\s*\d+)*)|(?:\#[\da-f]{6}))\:((?:\d+(?:\s*\,\s*\d+)*)|(?:\#[\da-f]{6}))\>/) == 0
         gradient = [$1, $2, 4 + x, 32 * y, 0, 32]
         gradients.push(gradient)
         @text = @text.split('')
         @text = (@text.length == 1 ? "" : @text[0..@text.length - 2].join(''))
         text.sub!(/(grad\=((?:\d+(?:\s*\,\s*\d+)*)|(?:\#[\da-f]{6}))\:((?:\d+(?:\s*\,\s*\d+)*)|(?:\#[\da-f]{6}))\>)/, '')
         next
       elsif text.index('/grad>') == 0
         unless gradients.length == 0 or gradients.last[0].nil?
           gradient = gradients.pop()
           w = [gradient[4], x + 4 - gradient[2]].max
           h = [gradient[5], y * 32 - gradient[3]].max
           rect = Rect.new(gradient[2], gradient[3], w, h)
           @gradients.push([gradient[0], gradient[1], rect])
         end
         @text = @text.split('')
         @text = @text[0..@text.length - 2].join('')
         text.sub!(/(\/?[a-z]+\>)/, '')
         next
       end
       if text.index(/\/?[a-z]+\>/) == 0
         text.sub!(/(\/?[a-z]+\>)/, '')
         @text += $1
       end
     end
     if c == "\n"
       unless gradients.length == 0 or gradients.last[0].nil?
         gradients[-1][4] = [gradients[-1][3], x + 4 - gradients[-1][1]].max
         gradients[-1][5] += 32
       end
       x = 0
       y += 32
       if y >= $game_temp.choice_start
         x = 8
       end
     end
     x += self.contents.text_size(c).width
   end
   unless gradients.length == 0 or gradients.last[0].nil?
     gradient = gradients.pop()
     w = [gradient[4], x + 4 - gradient[2]].max
     h = [gradient[5], y * 32 - gradient[3]].max
     rect = Rect.new(gradient[2], gradient[3], w, h)
     @gradients.push([gradient[0], gradient[1], rect])
   end
   @unformatted = unformatted.clone
   @length = unformatted.length unless @l_l
 end
 
 alias tdks_message_refresh refresh
 def refresh
   if !$game_temp.message_text.nil?
     get_text
     @animations.each { |ani| ani.bitmap.dispose;ani.dispose } unless @animations.nil?
     @letter_animations.each { |ani| ani.dispose } unless @letter_animations.nil?
   end
   @animations = []
   @letter_animations = []
   self.contents.clear
   self.contents.font.color = normal_color
   x = y = 0
   @cursor_width = 0
   # Indent if choice
   if $game_temp.choice_start == 0
     x = 8
   end
   # If waiting for a message to be displayed
   if @text != nil
     self.contents.font = Font.new
     self.contents.font.underline = false
     self.contents.font.overline = false
     self.contents.font.strikethrough = false
     text = @text.clone
     real_index = 0
     index = 1
     animation = [0, []]
     lanimation = [0, []]
     p_bold = p_italic = p_underline = p_overline = p_strikethrough = []
     # Control text processing
     begin
       last_text = text.clone
       text.gsub!(/\\[Vv]\[([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" }
     if @length == @text.length
       text.gsub!(/\\[Aa]/) { "\002" }
     else
       text.gsub!(/\\[Aa](?:\[(\d+)\])?/, "")
     end
     # Get 1 text character in c (loop until unable to get text)
     while ((c = text.slice!(/./m)) != nil)
       break if @length == 0
       real_index += 1
       # If \\
       if c == "\000"
         # Return to original text
         c = "\\"
       end
       # If \C[n]
       if c == "\001"
         # Change text color
         text.sub!(/\[((?:\d+(?:\s*\,\s*\d+)*)|(?:\#[\da-f]{6}))\]/, "")
         self.contents.font.color = get_color($1)
         # go to next text
         next
       end
       if c == "\002" and @length == @text.length
         if animation[0] != 0
           animation[1][-1].width = x + 4 - animation[1][-1].x
           @animations.push(animation)
         elsif lanimation[0] != 0
           @letter_animations.push(lanimation)
         end
         animation = [0, []]
         lanimation = [0, []]
         if text.index(/\[(\d+)\]/) == 0
           text.sub!(/\[(\d+)\]/, "")
           type = $1.to_i
           if type == 0
             animation[1] = []
           elsif type <= 8
             animation[0] = $1.to_i
             animation[1].push(Rect.new(4 + x, 32 * y, 0, 32))
           else
             lanimation[0] = $1.to_i - 8
           end
         else
           animation[0] = 0
           lanimation[0] = 0
         end
         next
       end
       if c == "<"
         if text.index('b>') == 0
           p_bold.push(self.contents.font.bold)
           self.contents.font.bold = true
         elsif text.index('i>') == 0
           p_italic.push(self.contents.font.italic)
           self.contents.font.italic = true
         elsif text.index('u>') == 0
           p_underline.push(self.contents.font.underline)
           self.contents.font.underline = true
         elsif text.index('o>') == 0
           p_overline.push(self.contents.font.overline)
           self.contents.font.overline = true
         elsif text.index('s>') == 0
           p_strikethrough.push(self.contents.font.strikethrough)
           self.contents.font.strikethrough = true
         end
         if text.index('/b>') == 0
           self.contents.font.bold = p_bold.pop
         elsif text.index('/i>') == 0
           self.contents.font.italic = p_italic.pop
         elsif text.index('/u>') == 0
           self.contents.font.underline = p_underline.pop
         elsif text.index('/o>') == 0
           self.contents.font.overline = p_overline.pop
         elsif text.index('/s>') == 0
           self.contents.font.strikethrough = p_strikethrough.pop
         end
         font = self.contents.font
         if text.index(/\/?[a-z]+\>/) == 0
           text.sub!(/\/?[a-z]+\>/, '')
           next
         end
       end
       # If new line text
       if c == "\n"
         # Update cursor width if choice
         if y >= $game_temp.choice_start
           @cursor_width = [@cursor_width, x].max
         end
         if animation[0] != 0
           animation[1][-1].width = x + 4 - animation[1][-1].x
         end
         # Add 1 to y
         y += 1
         x = 0
         # Indent if choice
         if y >= $game_temp.choice_start
           x = 8
         end
         if animation[0] != 0
           animation[1].push(Rect.new(x + 4, y * 32, 0, 32))
         end
         # go to next text
         next
       end
       # Draw text
       self.contents.draw_text(4 + x, 32 * y, 40, 32, c)
       # Add x to drawn text width
       size = self.contents.text_size(c)
       if lanimation[0] != 0
         lanimation[1].push(Rect.new(x + 4, y * 32, size.width, 32))
       end
       x += size.width
       index += 1
       break if index > @length
     end
     if animation[0] != 0
       animation[1][-1].width = x + 4 - animation[1][-1].x
       @animations.push(animation)
     elsif lanimation[0] != 0
       @letter_animations.push(lanimation)
     end
   end
   # If choice
   if $game_temp.choice_max > 0
     @item_max = $game_temp.choice_max
     self.active = true
     self.index = 0
   end
   # If number input
   if $game_temp.num_input_variable_id > 0
     digits_max = $game_temp.num_input_digits_max
     number = $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 = self.x + 8
     @input_number_window.y = self.y + $game_temp.num_input_start * 32
   end
   $game_temp.message_text = nil
   overlay_grad = Win32API.new('overlay_grad.dll', 'overlay_grad', 'liiiiiiiiii', 'b')
   @gradients.reverse.each { |i|
     c1 = get_color(i[0])
     c2 = get_color(i[1])
     overlay_grad.call(self.contents.__id__, i[2].x, i[2].y, i[2].width, i[2].height, c1.red, c1.green, c1.blue, c2.red, c2.green, c2.blue)
   }
   if @length == @text.length
     @animations = @animations.map { |ani| AnimationSprite.new(ani[0], self.x + 16, self.y + 16, self.z + 1, ani[1], self.contents) }
     @letter_animations = @letter_animations.map { |ani| AnimationLetters.new(ani[0], self.x + 16, self.y + 16, self.z + 1, ani[1], self.contents) }
     @animations.each { |i| i.opacity = (@fade_in ? 0 : 255) }
     @letter_animations.each { |i| i.opacity = (@fade_in ? 0 : 255) }
   end
 end
 
 def get_color(str)
   if !str.index(',').nil?
     return Color.new(*str.split(/\s*\,\s*/))
   elsif str[0..0] == '#'
     return Color.new(str[1..2].hex, str[3..4].hex, str[5..6].hex)
   else
     return text_color(str.to_i)
   end
 end
 
 alias tdks_message_update update
 def update
   super
   if !@wait_count.nil?
     if @wait_count > 0
       @wait_count -= 1
       @wait_count = nil if @wait_count == 0
     else
       self.pause = true if !self.pause
       @wait_count = nil if Input.trigger?(Input::C)
     end
     return
   end
   # If letter-by-letter
   if !(@fade_in or (@fade_out == false and $game_temp.message_text != nil)) and @l_l and self.contents_opacity == 255
     @frames += 1
     if Input.trigger?(Input::C)
       @length = @text.length
     end
     return unless @frames % @l_frames == 0
     prev_len = @length
     unless @l_amnt == 0
       @length = [@length + @l_amnt, @text.length].min
     else
       s_text = @unformatted[0...@length]
       e_text = @unformatted[@length...@unformatted.length].clone
       e_text.gsub!(/\A[\n\r]+/, '')
       if e_text.index(/\w+/) == 0
         e_text.sub(/(\w+)/, '')
         @length += $1.length
         e_text = @unformatted[@length...@unformatted.length]
         if e_text.index(/[^\w]+/) == 0
           e_text.sub(/([^\w]+)/, '')
           tmp = $1.gsub(/[\n\r]/, '')
           @length += tmp.length
         end
       elsif e_text.index(/[^\w]+/) == 0
         e_text.sub(/([^\w]+)/, '')
         tmp = $1.gsub(/[\n\r]/, '')
         @length += tmp.length
         e_text = @unformatted[@length...@unformatted.length]
         if e_text.index(/\w+/) == 0
           e_text.sub(/(\w+)/, '')
           @length += $1.length
         end
       end
     end
     unless Input.trigger?(Input::C)
       if (wait = @wait_points.detect { |i| i[0].between?(prev_len, @length) }) != nil
         frames = wait[1]
         @wait_points.delete(wait)
         @wait_count = frames
         @length = wait[0]
       end
     end
     len = @unformatted.gsub(/[\n\r]/, '').length
     if @length >= len
       @length = @text.length
       @l_l = false
     end
     refresh
     return
   end
   @animations.each { |ani| ani.update } unless @animations.nil? or @animations.empty? or @fade_out
   @letter_animations.each { |ani| ani.update } unless @letter_animations.nil? or @fade_out
   # If fade in
   if @fade_in
     self.contents_opacity += 24
     @animations.each { |i| i.opacity = self.contents_opacity } unless @animations.nil?
     @letter_animations.each { |i| i.opacity = self.contents_opacity } unless @letter_animations.nil?
     if @input_number_window != nil
       @input_number_window.contents_opacity += 24
     end
     if self.contents_opacity == 255
       @fade_in = false
     end
     return
   end
   # If inputting number
   if @input_number_window != nil
     @input_number_window.update
     # Confirm
     if 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 = nil
       terminate_message
     end
     return
   end
   # If message is being displayed
   if @contents_showing
     # If choice isn't being displayed, show pause sign
     if $game_temp.choice_max == 0
       self.pause = true
     end
     # Cancel
     if 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_message
       end
     end
     # Confirm
     if 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)
       end
       terminate_message
     end
     return
   end
   # If display wait message or choice exists when not fading out
   if @fade_out == false and $game_temp.message_text != nil
     @contents_showing = true
     $game_temp.message_window_showing = true
     reset_window
     @fade_in = true
     refresh
     Graphics.frame_reset
     self.visible = true
     self.contents_opacity = 0
     if @input_number_window != nil
       @input_number_window.contents_opacity = 0
     end
     return
   end
   # If message which should be displayed is not shown, but window is visible
   if self.visible
     @fade_out = true
     self.opacity -= 48
     @animations.each { |i| i.opacity = self.opacity } unless @animations.nil?
     @letter_animations.each { |i| i.opacity = self.opacity } unless @letter_animations.nil?
     if self.opacity == 0
       self.visible = false
       @animations.each { |i| i.bitmap.dispose;i.dispose }
       @letter_animations.each { |i| i.dispose }
       @fade_out = false
       $game_temp.message_window_showing = false
     end
     return
   end
 end
end

class Font
 attr_accessor :underline, :overline, :strikethrough
 attr_accessor :outline, :outline_color, :outline_distance
 attr_accessor :shadow, :shadow_color, :shadow_ox, :shadow_oy
 
 alias tdks_message_init initialize
 def initialize(*args)
   tdks_message_init(*args)
   @underline = false
   @overline = false
   @strikethrough = false
   @outline, @outline_color, @outline_distance = false, Color.new(0, 0, 0), 0
   @shadow, @shadow_color, @shadow_ox, @shadow_oy = false, Color.new(127, 127, 127, 170), 2, 2
 end
end

class Bitmap
 alias tdks_message_draw_text draw_text
 def draw_text(*args)
   unless args[0].is_a?(Rect)
     args[0..3] = Rect.new(*args[0..3])
   end
   args[2] = 0 if args[2].nil?
   args[3] = 1 if args[3].nil?
   case args[3]
   when 0
     args[0].height = text_size(args[1]).height
   when 1
     h = text_size(args[1]).height
     args[0].y += (args[0].height - h) / 2
     args[0].height = h
   when 2
     h = text_size(args[1]).height
     args[0].y += args[0].height
     args[0].height = h
   end
   text = args[1].clone
   text = text.split(/[\n\r]/)
   rect = args[0].clone
   case args[3]
   when 1
     amnt = (text.length / 2.0).floor
     text[0...amnt].each { |ln| rect.y -= text_size(ln).height } if amnt > 0
     rect.y += text_size(text[0]).height / 2 if amnt % 2 == 1
   when 2
     text.each { |ln| rect.y -= text_size(ln).height }
   end
   text.each { |ln|
     orig_x = rect.x
     size = text_size(ln)
     case args[2]
     when 1
       rect.x += (rect.width - size.width) / 2
     when 2
       rect.x += rect.width - size.width
     end
     if font.shadow
       prev_color = font.color.clone
       font.color = font.shadow_color
       tdks_message_draw_text(rect.x + font.shadow_ox, rect.y + font.shadow_oy, rect.width, rect.height, ln)
       font.color = prev_color
     end
     if font.outline
       prev_color = font.color.clone
       font.color = font.outline_color
       (-font.outline_distance..font.outline_distance).each { |ox|
         (-font.outline_distance..font.outline_distance).each { |oy|
           next if ox == 0 and oy == 0
           tdks_message_draw_text(rect.x + ox, rect.y + oy, rect.width, rect.height, ln)
         }
       }
       font.color = prev_color
     end
     tdks_message_draw_text(rect, ln)
     if font.overline
       fill_rect(rect.x, rect.y + (size.height / 15.0).ceil, size.width, (size.height / 15.0).ceil, font.color)
     end
     if font.strikethrough
       fill_rect(rect.x, rect.y + size.height / 2, size.width, (size.height / 15.0).ceil, font.color)
     end
     rect.y += size.height
     if font.underline
       fill_rect(rect.x, rect.y - (2 * size.height / 15.0).ceil, size.width, (size.height / 15.0).ceil, font.color)
     end
     rect.x = orig_x
   }
 end
 
 def draw_gradient_text(c1, c2, *args)
   unless args[0].is_a?(Rect)
     args[0..3] = Rect.new(*args[0..3])
   end
   rect = args[0]
   tmp = Bitmap.new(rect.width, rect.height)
   tmp.draw_text(tmp.rect, *args[1...args.length])
   overlay_grad = Win32API.new('overlay_grad.dll', 'overlay_grad', 'liiiiiiiiii', 'b')
   overlay_grad.call(tmp.__id__, args[0].x, args[0].y, args[0].width, args[0].height, c1.red, c1.green, c1.blue, c2.red, c2.green, c2.blue)
   blt(rect.x, rect.y, tmp, tmp.rect)
 end
end

class AnimationSprite < Sprite
 def initialize(type, x, y, z, rects, src_bitmap)
   super()
   @type = type
   rects.delete_if { |rect| rect.width == 0 or rect.height == 0 }
   ry = rects.min { |i, e| i.y <=> e.y }.y
   rx = rects.min { |i, e| i.x <=> e.x }.x
   h = rects.max { |i, e| i.y + i.height <=> e.y + e.height }
   h = h.y + h.height - ry
   w = rects.max { |i, e| i.x + i.width <=> e.x + e.width }
   w = w.x + w.width - rx
   self.x, self.y, self.z = x + rx, y + ry, z
   self.ox, self.oy = w / 2, h / 2
   self.x += ox
   self.y += oy
   self.bitmap = Bitmap.new(w, h)
   rects.each { |rect|
     bitmap.blt(rect.x - rx, rect.y - ry, src_bitmap, rect)
     src_bitmap.fill_rect(rect, Color.new(0, 0, 0, 0))
   }
   @frames = 0
   @fplus = 1
   case @type
   when 4:
     @shake = [0, 0]
     @shaked = 1
   when 6:
     @frames = -40
   when 7:
     @frames = 2
   end
 end
 
 def update
   return if self.disposed?
   @frames += @fplus
   case @type
   when 1:
     z = 1.0 + @frames * 0.1 / 20
     @fplus = -1 if @frames == 20
     @fplus = 1 if @frames == 0
     self.zoom_x = z
     self.zoom_y = z
   when 2:
     a = @frames * 5.0 / 12
     @fplus = -1 if @frames == 12
     @fplus = 1 if @frames == -12
     self.angle = a
   when 3:
     z = 1.0 - @frames * 0.1 / 20
     @fplus = -1 if @frames == 20
     @fplus = 1 if @frames == 0
     self.zoom_x = z
     self.zoom_y = z
   when 4:
     shake_power = 1
     shake_speed = 10
     delta = (shake_power * shake_speed * @fplus) / 15.0 + rand(3) - 1
     @shake[0] += delta
     if @shake[0] > shake_power
       @fplus = -1
     end
     if @shake[0] < - shake_power
       @fplus = 1
     end
     delta = (shake_power * shake_speed * @shaked) / 15.0 + rand(3) - 1
     @shake[1] += delta
     if @shake[1] > shake_power
       @shaked = -1
     end
     if @shake[1] < - shake_power
       @shaked = 1
     end
     self.ox = self.bitmap.width / 2 + @shake[0]
     self.oy = self.bitmap.height / 2 + @shake[1]
   when 5:
     amnt = 5
     amnt *= Math.sin(Math::PI * @frames / 30.0)
     self.oy = self.bitmap.height / 2 + amnt
   when 6:
     if @frames < 0
       a = 255 + @frames * 255 / 40
       self.color.set(255, 0, 0, a)
       return
     end
     r = g = b = 0
     tmp = (@frames % 360) * 255 / 360
     while tmp < 0
       tmp += 255
     end
     if tmp < 85
       g = tmp * 3
       r = (85 - tmp) * 3
     elsif tmp < 170
       b = (tmp - 85) * 3
       g = (170 - tmp) * 3
     else
       r = (tmp - 170) * 3
       b = (255 - tmp) * 3
     end
     self.color.set(r, g, b)
   when 7:
     amnt = 10
     amnt *= Math.sin(Math::PI * @frames / 30.0).abs
     self.oy = self.bitmap.height / 2 + amnt - 5
   when 8:
     self.opacity = 255 - 170 * @frames / 20
     @fplus = -1 if @frames == 20
     @fplus = 1 if @frames == 0
   end
 end
end

class AnimationLetters
 def initialize(type, x, y, z, rects, src_bitmap)
   @type = type
   @sprites = []
   @data = []
   tmp_data = get_tmp_data(type, rects.length)
   rects.each { |rect|
     sprite = Sprite.new
     sprite.x, sprite.y, sprite.z = x + rect.x, y + rect.y, z
     sprite.bitmap = Bitmap.new(rect.width, rect.height)
     sprite.bitmap.blt(0, 0, src_bitmap, rect)
     sprite.ox, sprite.oy = rect.width / 2, rect.height / 2
     sprite.x += sprite.ox
     sprite.y += sprite.oy
     src_bitmap.fill_rect(rect, Color.new(0, 0, 0, 0))
     @sprites.push(sprite)
     @data.push(get_data(type, tmp_data))
   }
   case @type
   when 4:
     @frames = -40
   else
     @frames = 0
   end
   @fplus = 1
 end
 
 def get_tmp_data(type, length)
   case type
   when 1, 5, 7:
     data = Array.new(length) { |i| i }
     @duration = length * 31
     @no_end = true
   when 2, 6, 8:
     len = (length / 2.0).floor
     data = Array.new(len) { |i| i }
     data = data.concat(data.clone)
     if len % 2 == 1
       data.push(rand(len))
     end
     @duration = len * 31
     @no_end = true
   when 9, 10:
     data = Array.new(length) { |i| i }
   when 11, 12:
     tmp = Array.new(length) { |i| i }
     data = []
     length.times {
       ind = rand(tmp.length)
       data.push(tmp[ind])
       tmp.delete_at(ind)
     }
   else
     data = []
   end
   data
 end
 
 def get_data(type, tmp_data)
   data = {}
   case type
   when 1, 2, 5, 6, 7, 8:
     tmp = rand(tmp_data.length)
     data[:start] = tmp_data[tmp] * 31 + rand(11) - 5
     data[:middle] = data[:start] + 15
     while data[:start] < 0
       data[:start] += @duration
     end
     data[:end] = (data[:middle] + 15) % @duration
     tmp_data.delete_at(tmp)
   when 4:
     data[:hue] = rand(255)
     data[:mod] = rand(5) - 2
     while data[:mod] == 0
       data[:mod] = rand(5) - 2
     end
   when 9, 10, 11, 12:
     data[:end] = false
     len = tmp_data.length
     ind = tmp_data.shift
     len += ind
     data[:offset] = -ind * Math::PI / len
   end
   data
 end
 
 def update
   return if @sprites.any? { |i| i.disposed? }
   @frames += @fplus
   case @type
   when 1, 2:
     @frames %= @duration
     @sprites.each_with_index { |sprite, i|
       data = @data[i]
       cur_frames = @frames
       start = data[:start]
       middle = data[:middle]
       endf = data[:end]
       while endf < start
         endf += @duration
       end
       while middle < start
         middle += @duration
       end
       while cur_frames < start
         cur_frames += @duration
       end
       while cur_frames > endf
         cur_frames -= @duration
       end
       while (cur_frames - start) > @duration
         cur_frames -= @duration
       end
       while (start - cur_frames) > @duration
         cur_frames += @duration
       end
       if cur_frames.between?(start, middle)
         @no_end = false
         z = 1.0 + (cur_frames - start) * 0.5 / (middle - start)
         sprite.zoom_x = sprite.zoom_y = z
       elsif cur_frames.between?(middle, endf) and !@no_end
         z = 1.0 + (endf - cur_frames) * 0.5 / (endf - middle)
         sprite.zoom_x = sprite.zoom_y = z
       else
         sprite.zoom_x = sprite.zoom_y = 1.0
       end
       mod = rand(5) - 2
       @data[i][:start] += mod
       @data[i][:middle] += mod
       @data[i][:end] += mod
     }
   when 3:
     a = @frames * 10.0 / 12
     @fplus = -1 if @frames == 30
     @fplus = 1 if @frames == -30
     @sprites.each { |i| i.angle = a }
   when 4:
     if @frames < 0
       a = 255 + @frames * 255 / 40
       @sprites.each_with_index { |sprite, i|
         @data[i][:hue] += @data[i][:mod]
         color = get_color(@data[i][:hue])
         color.alpha = a
         sprite.color = color
       }
       return
     end
     @sprites.each_with_index { |sprite, i|
       @data[i][:hue] += @data[i][:mod]
       color = get_color(@data[i][:hue])
       sprite.color = color
     }
   when 5, 6:
     @frames %= @duration
     @sprites.each_with_index { |sprite, i|
       data = @data[i]
       cur_frames = @frames
       start = data[:start]
       middle = data[:middle]
       endf = data[:end]
       while endf < start
         endf += @duration
       end
       while middle < start
         middle += @duration
       end
       while cur_frames < start
         cur_frames += @duration
       end
       while cur_frames > endf
         cur_frames -= @duration
       end
       while (cur_frames - start) > @duration
         cur_frames -= @duration
       end
       while (start - cur_frames) > @duration
         cur_frames += @duration
       end
       if cur_frames.between?(start, middle)
         @no_end = false
         sprite.opacity = 255 - (cur_frames - start) * 170 / (middle - start)
       elsif cur_frames.between?(middle, endf) and !@no_end
         sprite.opacity = 255 - (endf - cur_frames) * 170 / (endf - middle)
       else
         sprite.opacity = 255
       end
       mod = rand(5) - 2
       @data[i][:start] += mod
       @data[i][:middle] += mod
       @data[i][:end] += mod
     }
   when 7, 8:
     @frames %= @duration
     @sprites.each_with_index { |sprite, i|
       data = @data[i]
       cur_frames = @frames
       start = data[:start]
       middle = data[:middle]
       endf = data[:end]
       while endf < start
         endf += @duration
       end
       while middle < start
         middle += @duration
       end
       while cur_frames < start
         cur_frames += @duration
       end
       while cur_frames > endf
         cur_frames -= @duration
       end
       while (cur_frames - start) > @duration
         cur_frames -= @duration
       end
       while (start - cur_frames) > @duration
         cur_frames += @duration
       end
       if cur_frames.between?(start, middle)
         @no_end = false
         z = 1.0 - (cur_frames - start) * 0.5 / (middle - start)
         sprite.zoom_x = sprite.zoom_y = z
       elsif cur_frames.between?(middle, endf) and !@no_end
         z = 1.0 - (endf - cur_frames) * 0.5 / (endf - middle)
         sprite.zoom_x = sprite.zoom_y = z
       else
         sprite.zoom_x = sprite.zoom_y = 1.0
       end
       mod = rand(5) - 2
       @data[i][:start] += mod
       @data[i][:middle] += mod
       @data[i][:end] += mod
     }
   when 9, 11:
     @sprites.each_with_index { |sprite, i|
       data = @data[i]
       mod = 10 * Math.sin(Math::PI * @frames / 45.0 + data[:offset]).abs - 5
       mod2 = 10 * Math.sin(Math::PI * (@frames + 1) / 45.0 + data[:offset]).abs - 5
       if mod > 0 and mod <= 10 * Math.sin(Math::PI * 6 / 30.0).abs - 5 and mod2 > 0
         @data[i][:end] = true
       else
         next unless @data[i][:end]
       end
       sprite.oy = sprite.bitmap.height / 2 + mod
     }
   when 10, 12:
     @sprites.each_with_index { |sprite, i|
       data = @data[i]
       mod = 5 * Math.sin(Math::PI * @frames / 30.0 + data[:offset])
       mod2 = 5 * Math.sin(Math::PI * (@frames + 1) / 30.0 + data[:offset])
       #p 10 * Math.sin(Math::PI * 2 * 3 / 30.0) - 5
       #p mod
       if mod > 0 and mod <= 5 * Math.sin(Math::PI * 6 / 30.0) and mod2 > 0
         @data[i][:end] = true
       else
         next unless @data[i][:end]
       end
       sprite.oy = sprite.bitmap.height / 2 + mod
     }
   end
 end
 
 def get_color(hue)
   r = g = b = 0
   tmp = hue % 255
   while tmp < 0
     tmp += 255
   end
   if tmp < 85
     g = tmp * 3
     r = (85 - tmp) * 3
   elsif tmp < 170
     b = (tmp - 85) * 3
     g = (170 - tmp) * 3
   else
     r = (tmp - 170) * 3
     b = (255 - tmp) * 3
   end
   return Color.new(r, g, b)
 end
 
 def opacity=(val)
   @sprites.each { |i| i.opacity = val }
 end
 
 def dispose
   @sprites.each { |i| i.bitmap.dispose;i.dispose }
 end
end



Instructions

You can configure default message options. Instructions on how to configure are in the script.
Instructions on the different message tags you can use are also in the script.
A dll is now required for the gradient text feature. It is found here.


Compatibility

Probably won't work with any other custom message scripts, but if you like, I'll try to tweak it to work with that specific script.


Credits and Thanks


  • ThallionDarkshine




Author's Notes

A dll is now required for the gradient text feature. It is found here.

Heretic86

Im sure you have plans to add more to it, as most scripters do.

If I might make a humble suggestion: we've all seen many features as far as displaying text goes.  Displaying Icons, Enemy Names, Colorize, Wait Timers, etc are all things we've seen.  Personally, I'd like to see a Message Mod that does something totally new that hasn't been done before.  Well, at least as far as the scripts we have available. 

With that being said, one of the things I have not seen yet is Animated Text.  My definition of that being the characters themselves are literally moved around once they appear on screen.  For example, rapidly shaking characters can be used to imply a sense of Fear.  Or a "Floating" set of characters to put emphasis on a word, and floating just being moving the characters around to appear to "Float" like they are on water.  Maybe even possibly changing the Text Font Size where a character or a word grows slightly and shrinks back to its original size, also using for emphasis.  Or a very subtle "Wavy" warping of characters similar to the Backgrounds in RMVX.  Maybe even gradually rotate a characters color.

Try Super Mario RPG on the old school Super Nintendo I believe had text characteristics that I havent seen available for RMXP yet.  Things of that nature would make this script quite unique.  But these are all things that are really up to you if you feel like putting them in.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

ThallionDarkshine

I have an idea of how to do the animated text. I'll probably add in a collection of sprites to Window_Message, and have those animate in different ways. This would allow many animations, such as text size changing, hue rotating, words rocking back and forth, and so on. I may also add in the wavy characteristics of RMVX, as I have written a dll function to handle the wave distort.

Right now I'll be working on the regular formatting options, because most people like them and this script probably isn't compatible with other message scripts.

Heretic86

This might help with "Wavy Text" also...

Quote
Spoiler: ShowHide
#========================================
# XP Wave Effect
#----------------------------------------
#by:      zecomeia
#date:    01/03/2010
#for:     RGSS
#version: 1.0
#www.colmeia-do-ze.blogspot.com
#----------------------------------------
=begin
Reproduction of the VX's wave effect
(see the help file of the RPGMaker VX
in the RGSS manual reference topic)
=end

#==============#
# Sprite class #
#==============#
class Sprite
 
  include Math
 
  attr_accessor   :wave_amp
  attr_accessor   :wave_length
  attr_accessor   :wave_speed
  attr_accessor   :wave_phase
  attr_accessor   :temp_bitmap
 
  alias initialize default_initialize rescue nil
  alias default_initialize initialize
  def initialize(viewport=nil)
    @wave_amp = 2
    @wave_length = 72
    @wave_speed = 720
    @wave_phase = 0.25
    default_initialize(viewport)
    @temp_bitmap = nil
  end
 
  alias update default_update rescue nil
  alias default_update update 
  def update()
    # the wave effect only works if wave_amp
    # propertie is a number more than zero
    wave_effect if @wave_amp > 0
    default_update()
  end
 
  # Return the width of image, because when use
  # obj.bitmap.width the value will be more than
  # the original value(because effect)
  def width()
    return (self.bitmap.width - @wave_amp * 2)
  end
   
  #---------------
  # Wave Effect
  #---------------
  def wave_effect()
    return if self.bitmap.nil?
    @temp_bitmap = self.bitmap if @temp_bitmap.nil?
    cw = @temp_bitmap.width + (@wave_amp * 2)
    ch = @temp_bitmap.height
    # Follow the VX wave effect, each horizontal line
    # has 8 pixel of height. This device provides less
    # lag in game.
    divisions = @temp_bitmap.height / 8
    divisions += 1 if @temp_bitmap.height % 8 != 0
    self.bitmap = Bitmap.new(cw, ch)
    for i in 0..divisions
      x = @wave_amp * Math.sin(i * 2 * PI / (@wave_length / 8).to_i + Math.deg_to_rad(@wave_phase))
      src_rect = Rect.new(0, i*8, @temp_bitmap.width, 8)
      dest_rect = Rect.new(@wave_amp + x, i * 8, @temp_bitmap.width, 8)
      self.bitmap.stretch_blt(dest_rect, @temp_bitmap, src_rect)
    end
    # frame rate: VX = 60 | XP = 40
    # wave speed compatibility VX to XP: wave_speed * 60/40
    # then: wave_speed * 1.5
    @wave_phase += @wave_speed * 1.5 / @wave_length
    @wave_phase -= 360 if @wave_phase > 360
    @wave_phase += 360 if @wave_phase < 0
  end
 
end

#=============#
# module Math #
#=============#
module Math
 
  #-------------------------------
  # Conversion Degree to Radian
  #-------------------------------
  def Math.deg_to_rad(deg)
    return (deg * PI) / 180.0
  end
 
end


Non DLL wavy goodness, but this applies to Actor Sprites.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

ThallionDarkshine

That script is actually really interesting. Supposedly VX only divides sprites into lines with a height of 8 to decrease lag. That would actually really speed up my dll! Anyways, I have added many animation options such as:

  • Color Rotate

  • Grow/Shrink

  • Rotate (rock back and forth)

  • Bounce

  • Float

  • Shake



I'll update the main post with the new script after putting documentation on different message codes and such in the script.

LiTTleDRAgo

can you make gradient text or glowing text?

Quote from: Heretic86 on December 14, 2012, 07:56:55 pm
This might help with "Wavy Text" also...

Spoiler: ShowHide
#========================================
# XP Wave Effect
#----------------------------------------
#by:      zecomeia
#date:    01/03/2010
#for:     RGSS
#version: 1.0
#www.colmeia-do-ze.blogspot.com
#----------------------------------------
=begin
Reproduction of the VX's wave effect
(see the help file of the RPGMaker VX
in the RGSS manual reference topic)
=end

#==============#
# Sprite class #
#==============#
class Sprite
 
  include Math
 
  attr_accessor   :wave_amp
  attr_accessor   :wave_length
  attr_accessor   :wave_speed
  attr_accessor   :wave_phase
  attr_accessor   :temp_bitmap
 
  alias initialize default_initialize rescue nil
  alias default_initialize initialize
  def initialize(viewport=nil)
    @wave_amp = 2
    @wave_length = 72
    @wave_speed = 720
    @wave_phase = 0.25
    default_initialize(viewport)
    @temp_bitmap = nil
  end
 
  alias update default_update rescue nil
  alias default_update update 
  def update()
    # the wave effect only works if wave_amp
    # propertie is a number more than zero
    wave_effect if @wave_amp > 0
    default_update()
  end
 
  # Return the width of image, because when use
  # obj.bitmap.width the value will be more than
  # the original value(because effect)
  def width()
    return (self.bitmap.width - @wave_amp * 2)
  end
   
  #---------------
  # Wave Effect
  #---------------
  def wave_effect()
    return if self.bitmap.nil?
    @temp_bitmap = self.bitmap if @temp_bitmap.nil?
    cw = @temp_bitmap.width + (@wave_amp * 2)
    ch = @temp_bitmap.height
    # Follow the VX wave effect, each horizontal line
    # has 8 pixel of height. This device provides less
    # lag in game.
    divisions = @temp_bitmap.height / 8
    divisions += 1 if @temp_bitmap.height % 8 != 0
    self.bitmap = Bitmap.new(cw, ch)
    for i in 0..divisions
      x = @wave_amp * Math.sin(i * 2 * PI / (@wave_length / 8 ).to_i + Math.deg_to_rad(@wave_phase))
      src_rect = Rect.new(0, i*8, @temp_bitmap.width, 8 )
      dest_rect = Rect.new(@wave_amp + x, i * 8, @temp_bitmap.width, 8 )
      self.bitmap.stretch_blt(dest_rect, @temp_bitmap, src_rect)
    end
    # frame rate: VX = 60 | XP = 40
    # wave speed compatibility VX to XP: wave_speed * 60/40
    # then: wave_speed * 1.5
    @wave_phase += @wave_speed * 1.5 / @wave_length
    @wave_phase -= 360 if @wave_phase > 360
    @wave_phase += 360 if @wave_phase < 0
  end
 
end

#=============#
# module Math #
#=============#
module Math
 
  #-------------------------------
  # Conversion Degree to Radian
  #-------------------------------
  def Math.deg_to_rad(deg)
    return (deg * PI) / 180.0
  end
 
end


Non DLL wavy goodness, but this applies to Actor Sprites.


fixed

ThallionDarkshine

I'm not quite sure on the gradient text thing, but I'll work on it. And with the glowing text, do you mean like a glow that fades as you get farther from the text. If so, then I'll try to do it, but I can't give you any promises.

Heretic86

December 15, 2012, 02:26:28 pm #7 Last Edit: December 15, 2012, 02:47:55 pm by Heretic86
Another one that might help with Gradient Lettering...

Spoiler: ShowHide
  #--------------------------------------------------------------------------
  # * Draw Line - Gradient Color Line
  #   - start_x
  #   - start_y
  #   - end_x
  #   - end_y
  #   - start_color (Color.new(R,G,B, Opacity))
  #   - width     [optional - default to 1 pixel]
  #   - end_color [optional - default to start_color]
  #--------------------------------------------------------------------------
  def draw_line(start_x, start_y, end_x, end_y,
                start_color, width = 1, end_color = start_color)
    # Define Line Length in Positive Values
    distance = (start_x - end_x).abs + (start_y - end_y).abs
    # If not a Gradient
    if end_color == start_color
    for i in 1..distance
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
      y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
      self.contents.fill_rect(x, y, width, width, start_color)
    end
    else
    for i in 1..distance
      x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
      y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
      r = start_color.red   * (distance-i)/distance + end_color.red   * i/distance
      g = start_color.green * (distance-i)/distance + end_color.green * i/distance
      b = start_color.blue  * (distance-i)/distance + end_color.blue  * i/distance
      a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
      self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
    end
    end
  end
end


I know it is for drawing lines, but someone smart might be able to do somethign useful with this as far as drawing letters.  I think that there might need to be some bitmap caching involved for performance.

Now, let me go check this thing out!

++Level Up!


---

Suggestions:

Allow us to use "\a" to close the last Animation instead of "\a[0]".  This is to save space because the Message Text Box auto inserts \n characters, and even one or two characters creates limitations to text display usefulness.

Don't require Animation Tags to be closed.  Right now, the text does not appear to function unless the animation tags close.  That is to say "This is \a[4]Text." would animate the same as "This is \a[4]Text\a[0].", and just auto close on the last letter.  The period "." character would also be included in the animation effect.

Question:  The Text Effects only appear to start animating once the message is completely displayed.  Other than that, this script is truly AWESOME!

---

Legal:

Would you have any objections to allowing portions of your code being used to modify other Message Systems?  I'd like to include these animation effects with my Timed User Inputs, Scripts, and Windows. May I have permission to do so, provided credit to you for the Animation Effects is provided?
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

ThallionDarkshine

December 15, 2012, 03:23:03 pm #8 Last Edit: December 15, 2012, 05:19:49 pm by ThallionDarkshine
I have come up with a method for gradient lettering, and will probably include it in the next update, once I figure out a good way for users to specify the endpoints' color.
You can use any parts of my script in other message systems, as long as you credit me.
I'll try to stop requiring animation tags to be closed.
I would like to make the text effects start before the text has completed displaying, but it would be pretty hard to determine which animations had already been created. I will try to figure out a way to do that though.

Anyways, I finished the next part of the whole formatting section, fixed a large problem with letter by letter text and animation used together, and fixed the bounce animation so that it starts at the same position as it would normally be drawn. I'll edit the main post with the new script in a few minutes after I finish the documentation.

Edit:
I finished the new features that you requested.
Now ending animation tags are not needed. \a does the same thing now as \a[0]. Creating gradient text is now possible. Main post will be updated momentarily with the new script.

Heretic86

It crashes on me even with the DLL in the same folder as game.exe

QuoteScript 'New Msg' line 321: RuntimeError occurred.
LoadLibrary: overlay_grad
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

ThallionDarkshine

I updated the script in the main post. I think it might have been something because I didn't put the '.dll' in the filename. It was working fine for me, but that might have been the problem.

Heretic86

Still no luck.  Same error as above.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

ThallionDarkshine

What OS are you running?

And can you post your project? I can't reproduce the error on my computer.

LiTTleDRAgo

Quote from: ThallionDarkshine on December 15, 2012, 12:33:24 pm
I'm not quite sure on the gradient text thing, but I'll work on it. And with the glowing text, do you mean like a glow that fades as you get farther from the text. If so, then I'll try to do it, but I can't give you any promises.


glowing like this

http://i.imgur.com/PhAgO.png
http://i.imgur.com/DfpEK.png
http://i.imgur.com/aXPqh.png

ThallionDarkshine

Sorry, but I can't do anything like that. I wish there was a way, and I'll keep experimenting, but I don't know of any way to do that.

Heretic86

Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

ThallionDarkshine

December 16, 2012, 08:29:38 am #16 Last Edit: December 16, 2012, 08:30:43 am by ThallionDarkshine
Sorry, but I tried that and it doesn't give me any errors no matter which version of the script in your project I use.

What operating system do you have?

Edit:
Maybe you could just try renaming the dll to something else and then changing it in the script. Maybe it just doesn't like my name for the dll.

G_G

Just verifying that it works perfectly fine for me as well.

ThallionDarkshine

December 16, 2012, 10:06:35 am #18 Last Edit: December 16, 2012, 10:12:30 am by ThallionDarkshine
Huh, that's really weird then. Why does it work for everyone (me and g_g) except Heretic?

And now that someone has confirmed that there is no massive bug with loading dlls, I don't feel like I have to fix something before releasing v1.1.
This version fixes an error with multi-line animations, allows users to specify gradient colors in rgb, and fixes a bug with gradients inside of one another.

Heretic86

XP 32bit, and yes, Admin privies.  Dunno.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)