Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Small changes in the script ...

Save-Point

Full Version: Small changes in the script ...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
EDIT:
Hello guys, I wanted to ask a small change in this script message:
Code:
#===============================================================# Mensagem em Evento 1.1
# Autor: Madajuv
#===============================================================
# O script possibilita que um pequeno texto pule de um evento
# ou do jogador no mapa. Pode ser usado para mostrar danos, por
# exemplo. Para usar:
#
# Em mover evento, escolha a opção chamar script e digite:
# @mes = "Mensagem" ou @mes = "100" ou @mes = 100
# Só são aceitos números sem áspas. Mensagens e mensagens com
# números devem vir com áspas.
#
# Ou
#
# Em chamar script (no evento mesmo) digite:
# $game_map.events[ID].mes = "Mensagem"
# ID = Id do evento no mapa
# Para usar este segundo método com o jogador:
# $game_player.mes = "Mensagem"
#--------------------
# Log
#--------------------
# V 1.0:
# -> Base do sistema
# -> Mensagem com tempo fixo
# -> Cor personalizável
# -> Com ou sem borda preta
# -> Eventos ou personagem
#
# V 1.1:
# -> Tudo da V 1.0
# -> Removido bug para entrar nos menus
# ->
#===============================================================
# Edite Aqui:
#---------------------------------------------------------------
module Mada
  # A fonte da mensagem
  MEE_Fonte = "Arial Black"
  # O tamanho da fonte da mensagem
  MEE_Tamanho = 18
  # Contornar a mensagem? true = sim / false = não
  MEE_Contorno = true
  # Cor da mensagem em RGB (Vermelho, Verde, Azul)
  MEE_Cor = [255, 255, 255]
end
#---------------------------------------------------------------
# Fim da edição
#===============================================================
module RPG
  class Sprite < ::Sprite
    def initialize(viewport = nil)
      super(viewport)
      @_whiten_duration = 0
      @_appear_duration = 0
      @_escape_duration = 0
      @_collapse_duration = 0
      @_damage_duration = []
      @_damage_sprite = []
      @_damage_acel = []
      @_animation_duration = 0
      @_blink = false
    end
    def damage(value, critical, evento=false, tempo=40)
      if value.is_a?(Numeric)
        damage_string = value.abs.to_s
      else
        damage_string = value.to_s
      end
      bitmap = Bitmap.new(160, 48)
      evento ? bitmap.font.name = Mada::MEE_Fonte : bitmap.font.name = "Arial Black"
      evento ? bitmap.font.size = Mada::MEE_Tamanho : bitmap.font.size = 32
      if evento && Mada::MEE_Contorno
        bitmap.font.color.set(0, 0, 0)
        bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
        bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
        bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
        bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
      end
      if value.is_a?(Numeric) && value < 0 && !evento
        bitmap.font.color.set(176, 255, 144)
      else
        evento ? bitmap.font.color.set(Mada::MEE_Cor[0], Mada::MEE_Cor[1] , Mada::MEE_Cor[2]) : bitmap.font.color.set(255, 255, 255)
      end
      bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
      if !evento && critical
        bitmap.font.size = 20
        bitmap.font.color.set(0, 0, 0)
        bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
        bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
        bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
        bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
        bitmap.font.color.set(255, 255, 255)
        bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
      end
      @_damage_sprite.push(::Sprite.new(self.viewport))
      @_damage_sprite[@_damage_sprite.size-1].bitmap = bitmap
      @_damage_sprite[@_damage_sprite.size-1].ox = 80
      @_damage_sprite[@_damage_sprite.size-1].oy = 20
      @_damage_sprite[@_damage_sprite.size-1].x = self.x
      @_damage_sprite[@_damage_sprite.size-1].y = self.y
      evento ? @_damage_sprite[@_damage_sprite.size-1].y -= self.oy : @_damage_sprite[@_damage_sprite.size-1].y -= self.oy / 2
      @_damage_sprite[@_damage_sprite.size-1].z = 3000
      @_damage_duration.push(tempo)
      @_damage_acel.push(rand(4)-2)
      #@_damage_acely.push(-
    end
    def update
      super
      if @_whiten_duration > 0
        @_whiten_duration -= 1
        self.color.alpha = 128 - (16 - @_whiten_duration) * 10
      end
      if @_appear_duration > 0
        @_appear_duration -= 1
        self.opacity = (16 - @_appear_duration) * 16
      end
      if @_escape_duration > 0
        @_escape_duration -= 1
        self.opacity = 256 - (32 - @_escape_duration) * 10
      end
      if @_collapse_duration > 0
        @_collapse_duration -= 1
        self.opacity = 256 - (48 - @_collapse_duration) * 6
      end
      for i in 0...@_damage_duration.size
        if @_damage_duration[i] > 0
          @_damage_duration[i] -= 1
          
          case @_damage_duration[i]
          when 38..39
            @_damage_sprite[i].y -= 4
            @_damage_sprite[i].x += @_damage_acel[i]*(1+rand(1))
          when 36..37
            @_damage_sprite[i].y -= 2
            @_damage_sprite[i].x += @_damage_acel[i]
          when 34..35
            @_damage_sprite[i].y += 2
            @_damage_sprite[i].x += @_damage_acel[i]
          when 28..33
            @_damage_sprite[i].y += 4
            @_damage_sprite[i].x += @_damage_acel[i]*(1+rand(1))
          end
          @_damage_sprite[i].opacity = 256 - (12 - @_damage_duration[i]) * 32
          if @_damage_duration[i] == 0
            if @_damage_sprite[i] != nil
              @_damage_sprite[i].bitmap.dispose
              @_damage_sprite[i].dispose
              @_damage_sprite[i] = nil
              @_damage_duration[i] = nil
              @_damage_acel[i] = nil
            end
            @_damage_sprite.compact!
            @_damage_duration.compact!
            @_damage_acel.compact!
            break
          end
        end
      end
      if @_animation != nil and (Graphics.frame_count % 2 == 0)
        @_animation_duration -= 1
        update_animation
      end
      if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
        update_loop_animation
        @_loop_animation_index += 1
        @_loop_animation_index %= @_loop_animation.frame_max
      end
      if @_blink
        @_blink_count = (@_blink_count + 1) % 32
        if @_blink_count < 16
          alpha = (16 - @_blink_count) * 6
        else
          alpha = (@_blink_count - 16) * 6
        end
        self.color.set(255, 255, 255, alpha)
      end
      @@_animations.clear
    end
    def dispose_damage
      for i in 0...@_damage_sprite.size
        if @_damage_sprite[i] != nil
          @_damage_sprite[i].bitmap.dispose
          @_damage_sprite[i].dispose
          @_damage_sprite[i] = nil
          @_damage_duration[i] = nil
          @_damage_acel[i] = nil
        end
      end
      @_damage_sprite.compact!
      @_damage_duration.compact!
      @_damage_acel.compact!
    end
  end
end
class Game_Character
  attr_reader :mes, :mes_t
  def mest(mest, mes_t = 40)
    @mes = mest
    @mes_t = mes_t
  end
  def mes=(mensagem)
    @mes = mensagem.to_s
    @mes_t = 40
  end
end
class Sprite_Character < RPG::Sprite
  alias mada_mee_sc_update update
  def update
    mada_mee_sc_update
    if @character.mes != ''
      unless @character.mes.nil?
        damage(@character.mes, false, true, @character.mes_t)
      end
      @character.mest('')
    end
  end
end

I want him to allow me to use the "\v[ID var]" (this is a command message to show variables) and the command "\c[X]" (this changes the color of the messages).

And I wanted to ask for a adding a command "turn towards event" at this other script:
Code:
#=================================================================
# Mais movimentos para eventos
# Autor: Madajuv
#-----------------------------------------------------------------
# O script adiciona mais 4 comandos para os eventos:
# - Seguir um outro evento
# - Seguir uma posição do mapa
# - Fugir de outro evento
# - Fugir de uma posição do mapa
#-----------------------------------------------------------------
# Para usar:
# Dentro de mover evento, selecione script e digite:
# seguir(tipo, ID ou X, Y)
# ou
# fugir(tipo, ID ou X, Y)
#
# tipo: Se tipo for igual a 0 (zero) o parâmetro será um evento
#   se tipo for diferente de zero o paraâmetro será uma posição
#   do mapa.
# ID: id do evento que se deseja perseguir ou fugir
# X, Y: Coordenadas do mapa.
#
# Exemplos:
#
# seguir(0, 4) --> Isso fará o evento seguir o evento de ID 4.
# fugir(0, 1) --> Isso fará o evento fugir do evento de ID 1.
# seguir(1, 14, 10) --> Isso fará o evento seguir a
#                       posição (14,10) do mapa. 14 = X / 10 = Y
# fugir(99, 45, 72) --> Isso fará o evento fugir da posição
#                       (45,72) do mapa. 45 = X/ 72 = Y
#=================================================================
class Game_Character
  def seguir(tipo, pos_x_id, posy=0)
    if tipo == 0
      sx = @x - $game_map.events[pos_x_id].x
      sy = @y - $game_map.events[pos_x_id].y
    else
      sx = @x - pos_x_id
      sy = @y - posy
    end
    return if sx == 0 && sy == 0
    abs_sx = sx.abs
    abs_sy = sy.abs
    (rand(2) == 0 ? abs_sx += 1 : abs_sy += 1) if abs_sx == abs_sy
    if abs_sx > abs_sy
      sx > 0 ? move_left : move_right
      (sy > 0 ? move_up : move_down) if !moving? && sy != 0
    else
      sy > 0 ? move_up : move_down
      (sx > 0 ? move_left : move_right) if !moving? && sx != 0
    end
  end
  def fugir(tipo, pos_x_id, posy=0)
    if tipo == 0
      sx = @x - $game_map.events[pos_x_id].x
      sy = @y - $game_map.events[pos_x_id].y
    else
      sx = @x - pos_x_id
      sy = @y - posy
    end
    return if sx == 0 && sy == 0
    abs_sx = sx.abs
    abs_sy = sy.abs
    (rand(2) == 0 ? abs_sx += 1 : abs_sy += 1) if abs_sx == abs_sy
    if abs_sx > abs_sy
      sx > 0 ? move_right : move_left
      (sy > 0 ? move_down : move_up) if !moving? && sy != 0
    else
      sy > 0 ? move_down : move_up
      (sx > 0 ? move_right : move_left) if !moving? && sx != 0
    end
  end
end
That's it! I appreciate if you can give me that little help!
can't help you, I don't know Portuguese. Or is that Spanish?
In fact I don't know if anyone else does.
You don't need to know the language to understand the code.

Also as these are two different scripts you might have a better time making two different topics; one for each.

I THINK this will do what you want for \v and \c. It just doesn't fire when I try to test it so I assume I am missing some necessary script.
Code:
#===============================================================# Mensagem em Evento 1.1
# Autor: Madajuv
#===============================================================
# O script possibilita que um pequeno texto pule de um evento
# ou do jogador no mapa. Pode ser usado para mostrar danos, por
# exemplo. Para usar:
#
# Em mover evento, escolha a opção chamar script e digite:
# @mes = "Mensagem" ou @mes = "100" ou @mes = 100
# Só são aceitos números sem áspas. Mensagens e mensagens com
# números devem vir com áspas.
#
# Ou
#
# Em chamar script (no evento mesmo) digite:
# $game_map.events[ID].mes = "Mensagem"
# ID = Id do evento no mapa
# Para usar este segundo método com o jogador:
# $game_player.mes = "Mensagem"
#--------------------
# Log
#--------------------
# V 1.0:
# -> Base do sistema
# -> Mensagem com tempo fixo
# -> Cor personalizável
# -> Com ou sem borda preta
# -> Eventos ou personagem
#
# V 1.1:
# -> Tudo da V 1.0
# -> Removido bug para entrar nos menus
# ->
#===============================================================
# Edite Aqui:
#---------------------------------------------------------------
module Mada
  # A fonte da mensagem
  MEE_Fonte = "Arial Black"
  # O tamanho da fonte da mensagem
  MEE_Tamanho = 18
  # Contornar a mensagem? true = sim / false = não
  MEE_Contorno = true
  # Cor da mensagem em RGB (Vermelho, Verde, Azul)
  MEE_Cor = [255, 255, 255]
end
#---------------------------------------------------------------
# Fim da edição
#===============================================================
module RPG
  class Sprite < ::Sprite
    def initialize(viewport = nil)
      super(viewport)
      @_whiten_duration = 0
      @_appear_duration = 0
      @_escape_duration = 0
      @_collapse_duration = 0
      @_damage_duration = []
      @_damage_sprite = []
      @_damage_acel = []
      @_animation_duration = 0
      @_blink = false
    end
    def damage(value, critical, evento=false, tempo=40)
      if value.is_a?(Numeric)
        damage_string = value.abs.to_s
      else
        damage_string = value.to_s
        damage_string.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
        damage_string.sub!(/\[([0-9]+)\]/, "")
        color = $1.to_i
      end
      bitmap = Bitmap.new(160, 48)
      evento ? bitmap.font.name = Mada::MEE_Fonte : bitmap.font.name = "Arial Black"
      evento ? bitmap.font.size = Mada::MEE_Tamanho : bitmap.font.size = 32
      if evento && Mada::MEE_Contorno
        bitmap.font.color.set(0, 0, 0)
        bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
        bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
        bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
        bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
      end
      if value.is_a?(Numeric) && value < 0 && !evento
        bitmap.font.color.set(176, 255, 144)
      else
        evento ? bitmap.font.color.set(Mada::MEE_Cor[0], Mada::MEE_Cor[1] , Mada::MEE_Cor[2]) : bitmap.font.color.set(255, 255, 255)
        case color
        when 0
          return Color.new(255, 255, 255, 255)
        when 1
          return Color.new(128, 128, 255, 255)
        when 2
          return Color.new(255, 128, 128, 255)
        when 3
          return Color.new(128, 255, 128, 255)
        when 4
          return Color.new(128, 255, 255, 255)
        when 5
          return Color.new(255, 128, 255, 255)
        when 6
          return Color.new(255, 255, 128, 255)
        when 7
          return Color.new(192, 192, 192, 255)
        end
      end
      bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
      if !evento && critical
        bitmap.font.size = 20
        bitmap.font.color.set(0, 0, 0)
        bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
        bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
        bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
        bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
        bitmap.font.color.set(255, 255, 255)
        bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
      end
      @_damage_sprite.push(::Sprite.new(self.viewport))
      @_damage_sprite[@_damage_sprite.size-1].bitmap = bitmap
      @_damage_sprite[@_damage_sprite.size-1].ox = 80
      @_damage_sprite[@_damage_sprite.size-1].oy = 20
      @_damage_sprite[@_damage_sprite.size-1].x = self.x
      @_damage_sprite[@_damage_sprite.size-1].y = self.y
      evento ? @_damage_sprite[@_damage_sprite.size-1].y -= self.oy : @_damage_sprite[@_damage_sprite.size-1].y -= self.oy / 2
      @_damage_sprite[@_damage_sprite.size-1].z = 3000
      @_damage_duration.push(tempo)
      @_damage_acel.push(rand(4)-2)
      #@_damage_acely.push(-
    end
    def update
      super
      if @_whiten_duration > 0
        @_whiten_duration -= 1
        self.color.alpha = 128 - (16 - @_whiten_duration) * 10
      end
      if @_appear_duration > 0
        @_appear_duration -= 1
        self.opacity = (16 - @_appear_duration) * 16
      end
      if @_escape_duration > 0
        @_escape_duration -= 1
        self.opacity = 256 - (32 - @_escape_duration) * 10
      end
      if @_collapse_duration > 0
        @_collapse_duration -= 1
        self.opacity = 256 - (48 - @_collapse_duration) * 6
      end
      for i in 0...@_damage_duration.size
        if @_damage_duration > 0
          @_damage_duration -= 1
          
          case @_damage_duration
          when 38..39
            @_damage_sprite.y -= 4
            @_damage_sprite.x += @_damage_acel*(1+rand(1))
          when 36..37
            @_damage_sprite.y -= 2
            @_damage_sprite.x += @_damage_acel
          when 34..35
            @_damage_sprite.y += 2
            @_damage_sprite.x += @_damage_acel
          when 28..33
            @_damage_sprite.y += 4
            @_damage_sprite.x += @_damage_acel*(1+rand(1))
          end
          @_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
          if @_damage_duration == 0
            if @_damage_sprite != nil
              @_damage_sprite.bitmap.dispose
              @_damage_sprite.dispose
              @_damage_sprite = nil
              @_damage_duration = nil
              @_damage_acel = nil
            end
            @_damage_sprite.compact!
            @_damage_duration.compact!
            @_damage_acel.compact!
            break
          end
        end
      end
      if @_animation != nil and (Graphics.frame_count % 2 == 0)
        @_animation_duration -= 1
        update_animation
      end
      if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
        update_loop_animation
        @_loop_animation_index += 1
        @_loop_animation_index %= @_loop_animation.frame_max
      end
      if @_blink
        @_blink_count = (@_blink_count + 1) % 32
        if @_blink_count < 16
          alpha = (16 - @_blink_count) * 6
        else
          alpha = (@_blink_count - 16) * 6
        end
        self.color.set(255, 255, 255, alpha)
      end
      @@_animations.clear
    end
    def dispose_damage
      for i in 0...@_damage_sprite.size
        if @_damage_sprite != nil
          @_damage_sprite.bitmap.dispose
          @_damage_sprite.dispose
          @_damage_sprite = nil
          @_damage_duration = nil
          @_damage_acel = nil
        end
      end
      @_damage_sprite.compact!
      @_damage_duration.compact!
      @_damage_acel.compact!
    end
  end
end
class Game_Character
  attr_reader :mes, :mes_t
  def mest(mest, mes_t = 40)
    @mes = mest
    @mes_t = mes_t
  end
  def mes=(mensagem)
    @mes = mensagem.to_s
    @mes_t = 40
  end
end
class Sprite_Character < RPG::Sprite
  alias mada_mee_sc_update update
  def update
    mada_mee_sc_update
    if @character.mes != ''
      unless @character.mes.nil?
        damage(@character.mes, false, true, @character.mes_t)
      end
      @character.mest('')
    end
  end
end
Dude, did not work ... bugs gave several different ...
Variables can be converted in the text you send. Instead of making your
Code:
$game_map.events[ID].mes = "Message \v[3]"
You can use
Code:
$game_map.events[ID].mes = "Message #"+$game_variables[3].to_s
to get the data from Variable 0003.

It may take longer, but Madajuv's script wasn't based on the message system.
(08-03-2013, 10:36 PM)MechanicalPen Wrote: [ -> ]You don't need to know the language to understand the code.

Also as these are two different scripts you might have a better time making two different topics; one for each.

I THINK this will do what you want for \v and \c. It just doesn't fire when I try to test it so I assume I am missing some necessary script.
Code:
#===============================================================# Mensagem em Evento 1.1
# Autor: Madajuv
#===============================================================
# O script possibilita que um pequeno texto pule de um evento
# ou do jogador no mapa. Pode ser usado para mostrar danos, por
# exemplo. Para usar:
#
# Em mover evento, escolha a opção chamar script e digite:
# @mes = "Mensagem" ou @mes = "100" ou @mes = 100
# Só são aceitos números sem áspas. Mensagens e mensagens com
# números devem vir com áspas.
#
# Ou
#
# Em chamar script (no evento mesmo) digite:
# $game_map.events[ID].mes = "Mensagem"
# ID = Id do evento no mapa
# Para usar este segundo método com o jogador:
# $game_player.mes = "Mensagem"
#--------------------
# Log
#--------------------
# V 1.0:
# -> Base do sistema
# -> Mensagem com tempo fixo
# -> Cor personalizável
# -> Com ou sem borda preta
# -> Eventos ou personagem
#
# V 1.1:
# -> Tudo da V 1.0
# -> Removido bug para entrar nos menus
# ->
#===============================================================
# Edite Aqui:
#---------------------------------------------------------------
module Mada
# A fonte da mensagem
MEE_Fonte = "Arial Black"
# O tamanho da fonte da mensagem
MEE_Tamanho = 18
# Contornar a mensagem? true = sim / false = não
MEE_Contorno = true
# Cor da mensagem em RGB (Vermelho, Verde, Azul)
MEE_Cor = [255, 255, 255]
end
#---------------------------------------------------------------
# Fim da edição
#===============================================================
module RPG
class Sprite < ::Sprite
def initialize(viewport = nil)
super(viewport)
@_whiten_duration = 0
@_appear_duration = 0
@_escape_duration = 0
@_collapse_duration = 0
@_damage_duration = []
@_damage_sprite = []
@_damage_acel = []
@_animation_duration = 0
@_blink = false
end
def damage(value, critical, evento=false, tempo=40)
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
damage_string.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
damage_string.sub!(/\[([0-9]+)\]/, "")
color = $1.to_i
end
bitmap = Bitmap.new(160, 48)
evento ? bitmap.font.name = Mada::MEE_Fonte : bitmap.font.name = "Arial Black"
evento ? bitmap.font.size = Mada::MEE_Tamanho : bitmap.font.size = 32
if evento && Mada::MEE_Contorno
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
end
if value.is_a?(Numeric) && value < 0 && !evento
bitmap.font.color.set(176, 255, 144)
else
evento ? bitmap.font.color.set(Mada::MEE_Cor[0], Mada::MEE_Cor[1] , Mada::MEE_Cor[2]) : bitmap.font.color.set(255, 255, 255)
case color
when 0
return Color.new(255, 255, 255, 255)
when 1
return Color.new(128, 128, 255, 255)
when 2
return Color.new(255, 128, 128, 255)
when 3
return Color.new(128, 255, 128, 255)
when 4
return Color.new(128, 255, 255, 255)
when 5
return Color.new(255, 128, 255, 255)
when 6
return Color.new(255, 255, 128, 255)
when 7
return Color.new(192, 192, 192, 255)
end
end
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
if !evento && critical
bitmap.font.size = 20
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
end
@_damage_sprite.push(::Sprite.new(self.viewport))
@_damage_sprite[@_damage_sprite.size-1].bitmap = bitmap
@_damage_sprite[@_damage_sprite.size-1].ox = 80
@_damage_sprite[@_damage_sprite.size-1].oy = 20
@_damage_sprite[@_damage_sprite.size-1].x = self.x
@_damage_sprite[@_damage_sprite.size-1].y = self.y
evento ? @_damage_sprite[@_damage_sprite.size-1].y -= self.oy : @_damage_sprite[@_damage_sprite.size-1].y -= self.oy / 2
@_damage_sprite[@_damage_sprite.size-1].z = 3000
@_damage_duration.push(tempo)
@_damage_acel.push(rand(4)-2)
#@_damage_acely.push(-
end
def update
super
if @_whiten_duration > 0
@_whiten_duration -= 1
self.color.alpha = 128 - (16 - @_whiten_duration) * 10
end
if @_appear_duration > 0
@_appear_duration -= 1
self.opacity = (16 - @_appear_duration) * 16
end
if @_escape_duration > 0
@_escape_duration -= 1
self.opacity = 256 - (32 - @_escape_duration) * 10
end
if @_collapse_duration > 0
@_collapse_duration -= 1
self.opacity = 256 - (48 - @_collapse_duration) * 6
end
for i in 0...@_damage_duration.size
if @_damage_duration > 0
@_damage_duration -= 1

case @_damage_duration
when 38..39
@_damage_sprite.y -= 4
@_damage_sprite.x += @_damage_acel*(1+rand(1))
when 36..37
@_damage_sprite.y -= 2
@_damage_sprite.x += @_damage_acel
when 34..35
@_damage_sprite.y += 2
@_damage_sprite.x += @_damage_acel
when 28..33
@_damage_sprite.y += 4
@_damage_sprite.x += @_damage_acel*(1+rand(1))
end
@_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
if @_damage_duration == 0
if @_damage_sprite != nil
@_damage_sprite.bitmap.dispose
@_damage_sprite.dispose
@_damage_sprite = nil
@_damage_duration = nil
@_damage_acel = nil
end
@_damage_sprite.compact!
@_damage_duration.compact!
@_damage_acel.compact!
break
end
end
end
if @_animation != nil and (Graphics.frame_count % 2 == 0)
@_animation_duration -= 1
update_animation
end
if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
update_loop_animation
@_loop_animation_index += 1
@_loop_animation_index %= @_loop_animation.frame_max
end
if @_blink
@_blink_count = (@_blink_count + 1) % 32
if @_blink_count < 16
alpha = (16 - @_blink_count) * 6
else
alpha = (@_blink_count - 16) * 6
end
self.color.set(255, 255, 255, alpha)
end
@@_animations.clear
end
def dispose_damage
for i in 0...@_damage_sprite.size
if @_damage_sprite != nil
@_damage_sprite.bitmap.dispose
@_damage_sprite.dispose
@_damage_sprite = nil
@_damage_duration = nil
@_damage_acel = nil
end
end
@_damage_sprite.compact!
@_damage_duration.compact!
@_damage_acel.compact!
end
end
end
class Game_Character
attr_reader :mes, :mes_t
def mest(mest, mes_t = 40)
@mes = mest
@mes_t = mes_t
end
def mes=(mensagem)
@mes = mensagem.to_s
@mes_t = 40
end
end
class Sprite_Character < RPG::Sprite
alias mada_mee_sc_update update
def update
mada_mee_sc_update
if @character.mes != ''
unless @character.mes.nil?
damage(@character.mes, false, true, @character.mes_t)
end
@character.mest('')
end
end
end



I think you do, after all, how can you read a variable in portuguese or japanese if you only know engligh? you can't
The comments are in Portuguese. But the commands ( def , module, class, if...then...else ) are all in English, even within Japanese scripts such as those by Cogwheel, Claihm, ParaDog, XRXS. I have personally translated these scripts into English by translating the comments alone from Japanese to English.

The hardest one I ever translated was a Random Map Generator by Tonbi due to its scope and actual LACK of instructions on usage.

Whether the name of the variable (such as @mes) is in portuguese, it is not hard to comprehend that mes is short for message. So conversion between scripts of any language is possible.
like a universal language i geuss
DerVVulfman Thanks, as always, killed my problems! More like if I want to change the color of the message?
what's he trying to do with this script?

also, I know an Advanced Messaging script that could change message colour
Pages: 1 2 3