Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Error in DerVV's Animated Battlers

hello!

since i use following script, i get an error in dervv's animated battlers, when i try using skills and magic.
here's the new script
Code:
#==============================================================================
# Learn Skill Script v. 1.05
# by Caldaron (6.10.2006)
#==============================================================================
SDK.log('Learn Skill', 'Caldaron', 1.05, '2006-10-6')

if SDK.state('Learn Skill')
#==============================================================================
  module Learn
  #--------------------------------------------------------------
    Points = false                 # disable learn_points
    Learn_EXP = {1 => 25, 2 => 55}         # skill.id => skill.exp
    Learn_Points = {1 => 10}       # skill.id => skill.learn_points
  #--------------------------------------------------------------
  end
#==============================================================================
class Scene_Learn
  #--------------------------------------------------------------
  def initialize(actor_index = 0)
    @actor_index = actor_index
  end
  #--------------------------------------------------------------
  def main
    @actor = $game_party.actors[@actor_index]
    @actor_window = Window_Learn_Actor.new(@actor)
    @actual_window = Window_Learn_Actual.new(@actor)
    @list_window = Window_Learn_List.new(@actor)
    @help_window = Window_Help.new
    @list_window.help_window = @help_window
    @warning_window = Window_Help.new
    @warning_window.set_text("EXP gehen verloren, trotzdem lernen?", 1)
    @confirm_window = Window_Command.new(144,["Ja", "Nein"])
    @exit_window = Window_Command.new(144,["Ja", "Abbrechen", "Zur?ck"])
    @actor_window.visible = true
    @actual_window.visible = true
    @list_window.visible = true
    @list_window.help_window.visible = true
    @warning_window.visible = false
    @confirm_window.visible = false
    @list_window.active = true
    @confirm_window.active = false
    @exit_window.visible = false
    @exit_window.active = false
    if @actor.learn_current != nil
      @current = $data_skills[@actor.learn_current]
    else
      @current = nil
    end
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.lp_consume == nil
        actor.lp_consume = 0
      end
    end
    @list_window.help_window.y = 416
    @warning_window.y = 160
    @warning_window.z = 200
    @confirm_window.x = 248
    @confirm_window.y = 224
    @confirm_window.z = 200
    @confirm_window.index = 1
    @exit_window.x = 248
    @exit_window.y = 224
    @exit_window.z = 200
    @exit_window.index = 1
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @actor_window.dispose
    @actual_window.dispose
    @list_window.dispose
    @help_window.dispose
    @warning_window.dispose
    @confirm_window.dispose
    @exit_window.dispose
  end
  #--------------------------------------------------------------
  def update
    @actor_window.update
    @actual_window.update
    @list_window.update
    @help_window.update
    @warning_window.update
    @confirm_window.update
    @exit_window.update
    if @list_window.active
      update_list
      return
    end
    if @confirm_window.active
      update_confirm
    end
    if @exit_window.active
      update_exit
    end
  end
  #--------------------------------------------------------------
  def update_list
    if Input.trigger?(Input::B)
      @show_description = false
      @a = Learn::Points ? @actor.learn_exp != 0 ? false : true : false
      if (@actor.lp_consume != 0 and @actor.start != @actor.learn_current and @actor.start != nil and @a)
        @list_window.active = false
        @warning_window.set_text("?nderungen speichern?", 1)
        @warning_window.visible = true
        @exit_window.visible = true
        @exit_window.active = true
      else
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(4)
        for i in 0...$game_party.actors.size
          actor = $game_party.actors[i]
          if actor.start != actor.learn_current
            actor.learn_points -= actor.lp_consume
          end
          actor.lp_consume = 0
        end
      end
    end
    if Input.trigger?(Input::C)
      @skill = @list_window.skill
      if @skill != nil
        if points(@skill) > @a = Learn::Points ? @actor.learn_points : points(@skill)
          $game_system.se_play($data_system.buzzer_se)
          return
        else
          $game_system.se_play($data_system.decision_se)
          if @actor.learn_current != nil and @actor.learn_exp > 0 and @actor.lp_consume == 0
            @list_window.active = false
            @warning_window.visible = true
            @confirm_window.visible = true
            @confirm_window.active = true
            return
          else
            if @current != nil
              @actor.learn_list.push(@current.id)
            end
            @actor.learn_current = @skill.id
            if @actor.learn_current == @actor.start
              backup
            else
              @actor.learn_exp = 0
              @actor.lp_consume = points(@skill)
            end
            $scene = Scene_Learn.new(@actor_index)
          end
        end
      else
        $game_system.se_play($data_system.buzzer_se)
        return
      end
    end
    if Input.trigger?(Input::R)
      $game_system.se_play($data_system.cursor_se)
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_Learn.new(@actor_index)
      return
    end
    if Input.trigger?(Input::L)
      $game_system.se_play($data_system.cursor_se)
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_Learn.new(@actor_index)
      return
    end
  end
  #--------------------------------------------------------------
  def update_confirm
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @warning_window.visible = false
      @confirm_window.visible = false
      @confirm_window.active = false
      @list_window.active = true
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @confirm_window.index
      when 0
        if @current != nil
          @actor.learn_list.push(@current.id)
          end
        @actor.learn_current = @skill.id
        if @actor.learn_current == @actor.start
          backup
        else
        @actor.learn_exp = 0
        @actor.lp_consume = points(@skill)
      end
      $scene = Scene_Learn.new(@actor_index)
      when 1
        @warning_window.visible = false
        @confirm_window.visible = false
        @confirm_window.active = false
        @list_window.active = true
        return
      end
    end
  end
  #--------------------------------------------------------------
  def update_exit
   if Input.trigger?(Input::B)
       $game_system.se_play($data_system.cancel_se)
      @warning_window.visible = false
      @exit_window.visible = false
      @exit_window.active = false
      @list_window.active = true
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @exit_window.index
      when 0
        $scene = Scene_Menu.new(4)
        for i in 0...$game_party.actors.size
          actor = $game_party.actors[i]
          if actor.lp_consume == nil
            actor.lp_consume = 0
          end
          actor.learn_points -= actor.lp_consume
          actor.lp_consume = 0
        end
      when 1
        @warning_window.set_text("EXP gehen verloren, trotzdem lernen?", 1)
        @warning_window.visible = false
        @exit_window.visible = false
        @exit_window.active = false
        @list_window.active = true
        return
      when 2
        backup
        $scene = Scene_Learn.new(@actor_index)
      end
    end
  end
  #--------------------------------------------------------------
  def backup
    @actor.learn_points = @actor.start_points
    @actor.learn_current = @actor.start
    @actor.learn_list = @actor.start_list
    @actor.learn_exp = @actor.start_exp
    @actor.learn_exp_need = @actor.start_exp_need
    @actor.learned_list = @actor.start_learned_list
    @actor.lp_consume = 0
    return
  end
  #--------------------------------------------------------------
  def points(skill)
    if Learn::Points
      if Learn::Learn_Points.has_key?(skill.id)
        return Learn::Learn_Points[skill.id]
      else
        return [[Integer(skill.sp_cost / 20), 0].max, 999].min
      end
    else
      return exp(skill)
    end
  end
  #--------------------------------------------------------------------------
  def exp(skill)
    if Learn::Learn_EXP.has_key?(skill.id)
      return Learn::Learn_EXP[skill.id]
    else
      return [[Integer(skill.sp_cost / 3), 1].max, 999999].min
    end
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Window_Learn < Window_Base
  #--------------------------------------------------------------------------
  attr_accessor :actor_id
  attr_accessor :skill_id
  #--------------------------------------------------------------------------
  def initialize(actor_id, skill_id = 1)
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 128
    @actor_id = actor_id
    @skill_id = skill_id
    refresh
  end
  #--------------------------------------------------------------------------
 def refresh
   @actor = $game_party.actors[@actor_id]
   @name = @actor.name
   @skill = $data_skills[@skill_id]
   @skill = @skill.name
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, 608, 32, "#{@name.to_s} hat #{@skill.to_s} gelernt!", 1)
  end
  #--------------------------------------------------------------------------
  def update
    super
  end  
  #--------------------------------------------------------------------------
end
#==============================================================================
class Window_Learn_Actor < Window_Base
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0,0,640/3,96)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 0, 0)
    draw_actor_learn_level(@actor, 112, 0)
    if Learn::Points
      self.contents.draw_text(0, 32, 96, 32, "Learnpoints:")
      self.contents.draw_text(108, 32, 72, 32, @actor.learn_points.to_s, 1)
    end
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Window_Learn_Actual < Window_Base
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(640/3, 0, 640*2/3, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.draw_text(0, 0, 640*2/3-32, 32, "Lernt :",0)
    if @actor.learn_current != nil
      @current = $data_skills[@actor.learn_current]
      if Learn::Learn_EXP.has_key?(@current.id)
        @actor.learn_exp_need = Learn::Learn_EXP[@current.id]
      else
        @actor.learn_exp_need = [[Integer(@current.sp_cost / 3), 1].max, 999999].min
      end
      draw_actor_learn_current_bar(@actor, 0, 32, 640*2/3-32)
      bitmap = RPG::Cache.icon(@current.icon_name)
      self.contents.blt(132, 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
      self.contents.draw_text(164, 0, 204, 32, @current.name, 0)
    else
      self.contents.draw_text(0, 32, 640*2/3-32, 32, "Nichts",1)
    end
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Window_Learn_List < Window_Selectable
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 96, 640, 320)
    @actor = actor
    @column_max = 2
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  def skill
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    @actor.learn_list.sort!
    if @actor.learn_current != nil
      current = $data_skills[@actor.learn_current]
    else
      current = nil
    end
    for i in 0...@actor.learn_list.size
      skill = $data_skills[@actor.learn_list[i]]
      if skill != nil and not @data.include?(skill) and not @actor.learned_list.include?(skill.id)
        @data.push(skill)
      end
      @data.delete(current)
    end
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills[i]]
      @data.delete(skill)
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if Learn::Points
      if Learn::Learn_Points.has_key?(skill.id)
        @lp_cost = Learn::Learn_Points[skill.id]
      else
        @lp_cost = [[Integer(skill.sp_cost / 20), 0].max, 999].min
      end
    else
      if Learn::Learn_EXP.has_key?(skill.id)
        @lp_cost = Learn::Learn_EXP[skill.id]
      else
        @lp_cost = [[Integer(skill.sp_cost / 3), 1].max, 999999].min
      end
    end
    self.contents.font.color = normal_color
    if Learn::Points
      if @lp_cost <= @actor.learn_points
        self.contents.font.color = normal_color
      else
        self.contents.font.color = disabled_color
      end
    end
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    self.contents.draw_text(x + 232, y, 48, 32, @lp_cost.to_s, 2)
  end
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Window_Base
  def draw_actor_learn_level(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, "Lvl")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 1)
  end
  #--------------------------------------------------------------------------
  def draw_actor_learn_current_bar(actor, x, y, width = 172)
    if actor.learn_exp_need != 0
      rate = actor.learn_exp.to_f / actor.learn_exp_need
    else
      rate = 1
    end
    plus_x = 0
    rate_x = 0
    plus_y = 25
    plus_width = 0
    rate_width = 100
    height = 20
    align1 = 1
    align2 = 2
    align3 = 0
    grade1 = 1
    grade2 = 0
    color1 = Color.new(0, 0, 0, 192)
    color2 = Color.new(255, 255, 192, 192)
    color3 = Color.new(0, 0, 0, 192)
    color4 = Color.new(64, 0, 0, 192)
    color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192)
    color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192)
    if actor.learn_exp_need != 0
      exp = (width + plus_width) * actor.learn_exp * rate_width / 100 / actor.learn_exp_need
    else
      exp = (width + plus_width) * rate_width / 100
    end
    gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y, width, plus_width + width * rate_width / 100, height, exp, align1, align2, align3, color1, color2, color3, color4, color5, color6, grade1, grade2)
    aw = self.contents.text_size(actor.learn_exp.to_s).width
    bw = self.contents.text_size(actor.learn_exp_need.to_s).width
    self.contents.draw_text(width/2 - aw - 4, y, aw, 32, actor.learn_exp.to_s, 2)
    self.contents.font.color = normal_color
    self.contents.draw_text(width/2, y, 12, 32, "/", 1)
    self.contents.draw_text(width/2 + 16, y, bw, 32, actor.learn_exp_need.to_s, 0)
  end
  #--------------------------------------------------------------------------
  def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
    color1, color2, color3, color4, color5, color6, grade1, grade2)
    case align1
    when 1
      x += (rect_width - width) / 2
    when 2
      x += rect_width - width
    end
    case align2
    when 1
      y -= height / 2
    when 2
      y -= height
    end
    self.contents.fill_rect(x, y, width, height, color1)
    self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
    if align3 == 0
      if grade1 == 2
        grade1 = 3
      end
      if grade2 == 2
        grade2 = 3
      end
    end
    if (align3 == 1 and grade1 == 0) or grade1 > 0
      color = color3
      color3 = color4
      color4 = color
    end
    if (align3 == 1 and grade2 == 0) or grade2 > 0
      color = color5
      color5 = color6
      color6 = color
    end
    self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4, color3, color4, grade1)
    if align3 == 1
      x += width - gauge
    end
    self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4, color5, color6, grade2)
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Bitmap
  #--------------------------------------------------------------------------
  def gradation_rect(x, y, width, height, color1, color2, align = 0)
    if align == 0
      for i in x...x + width
        red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
        green = color1.green + (color2.green - color1.green) * (i - x) / (width - 1)
        blue = color1.blue + (color2.blue - color1.blue) * (i - x) / (width - 1)
        alpha = color1.alpha + (color2.alpha - color1.alpha) * (i - x) / (width - 1)
        color = Color.new(red, green, blue, alpha)
        fill_rect(i, y, 1, height, color)
      end
    elsif align == 1
      for i in y...y + height
        red = color1.red +
        (color2.red - color1.red) * (i - y) / (height - 1)
        green = color1.green + (color2.green - color1.green) * (i - y) / (height - 1)
        blue = color1.blue + (color2.blue - color1.blue) * (i - y) / (height - 1)
        alpha = color1.alpha + (color2.alpha - color1.alpha) * (i - y) / (height - 1)
        color = Color.new(red, green, blue, alpha)
        fill_rect(x, i, width, 1, color)
      end
    elsif align == 2
      for i in x...x + width
        for j in y...y + height
          red = color1.red + (color2.red - color1.red) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          green = color1.green + (color2.green - color1.green) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          blue = color1.blue + (color2.blue - color1.blue) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          alpha = color1.alpha + (color2.alpha - color1.alpha) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          color = Color.new(red, green, blue, alpha)
          set_pixel(i, j, color)
        end
      end
    elsif align == 3
      for i in x...x + width
        for j in y...y + height
          red = color1.red + (color2.red - color1.red) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          green = color1.green + (color2.green - color1.green) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          blue = color1.blue + (color2.blue - color1.blue) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          alpha = color1.alpha + (color2.alpha - color1.alpha) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          color = Color.new(red, green, blue, alpha)
          set_pixel(i, j, color)
        end
      end
    end
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  attr_accessor :learn_points
  attr_accessor :learn_current
  attr_accessor :learn_list
  attr_accessor :learn_exp
  attr_accessor :learn_exp_need
  attr_accessor :learned_list
  attr_accessor :lp_consume
  attr_accessor :start
  attr_accessor :start_points
  attr_accessor :start_list
  attr_accessor :start_exp
  attr_accessor :start_exp_need
  attr_accessor :start_learned_list
  #--------------------------------------------------------------------------
  alias caldaron_learn_actor_init initialize
  def initialize(actor_id)
    @learn_points = 0
    @learn_current = nil
    @learn_list = []
    @learn_exp = 0
    @learn_exp_need = 0
    @learned_list = []
    @lp_consume = 0
    @start = nil
    @start_points = 0
    @start_list = []
    @start_exp = 0
    @start_exp_need = 0
    @start_learned_list = []
    caldaron_learn_actor_init(actor_id)
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Scene_Map
  #--------------------------------------------------------------------------
  alias caldaron_learn_map_main main
  def main
    @learn_window = []
    for i in 0...$game_party.actors.size
      @learn_window.push(Window_Learn.new(i))
      @learn_window[i].visible = false
    end
    @wait = 0
    caldaron_learn_map_main
    for i in 0...$game_party.actors.size
      @learn_window[i].update
    end
  end
  #--------------------------------------------------------------------------
  alias caldaron_learn_map_update update
  def update
    if @wait > 0
      @wait -= 1
    end
    if @wait == 0
      for i in 0...$game_party.actors.size
        @learn_window[i].visible = false
      end
    end
    @i = -1
    for i in 0...$game_party.actors.size
      @actor = $game_party.actors[i]
      if @actor.learn_current != nil and @actor.learn_exp >= @actor.learn_exp_need
        @learn_window[i].skill_id = @actor.learn_current
        @learn_window[i].refresh
        @learn_window[i].visible = true
        @actor.learn_exp = 0
        @actor.learn_skill(@actor.learn_current)
        @actor.learned_list.push(@actor.learn_current)
        @actor.learn_current = nil
        @wait = 100
      end
      if @learn_window[i].visible
        @i += 1
        if @i > 0
          @learn_window[i].y = 64 * @i
        end
      end
    end
    caldaron_learn_map_update
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  alias caldaron_learn_battle_start_phase5 start_phase5
  def start_phase5
    caldaron_learn_battle_start_phase5
    exp = 0
    for enemy in $game_troop.enemies
      unless enemy.hidden
        exp += enemy.exp
      end
    end
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        actor.learn_exp += exp
      end
    end
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
class Interpreter
  #--------------------------------------------------------------------------
  def call_learn
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor.start = actor.learn_current
      actor.start_exp = actor.learn_exp
      actor.start_exp_need = actor.learn_exp_need
      actor.start_points = actor.learn_points
      actor.start_list = actor.learn_list
      actor.start_learned_list = actor.learned_list
      actor.lp_consume = 0
    end
    $scene = Scene_Learn.new
  end
  #--------------------------------------------------------------------------
  def command_315
    value = operate_value(@parameters[1], @parameters[2], @parameters[3])
    iterate_actor(@parameters[0]) do |actor|
      actor.exp += value
      actor.learn_exp += value
    end
    return true
  end
  #--------------------------------------------------------------------------
  def add_learn_points(actor_id, n)
    if actor_id.is_a?(Array)
      for i in 0...actor_id.size
        $game_party.actors[i].learn_points += n
      end
    else
      $game_party.actors[actor_id].learn_points += n
    end
  end
  #--------------------------------------------------------------------------
  def add_learn_skill(actor_id, skill_id)
    if actor_id.is_a?(Array)
      for i in 0...actor_id.size
        if skill_id.is_a?(Array)
          for j in 0...skill_id.size
            skill = $data_skills[skill_id[j]].id
            $game_party.actors[i].learn_list.push(skill)
          end
        else
          $game_party.actors[i].learn_list.push(skill_id)
        end
      end
    else
      if skill_id.is_a?(Array)
        for j in 0...skill_id.size
          skill = $data_skills[skill_id[j]].id
          $game_party.actors[actor_id].learn_list.push(skill)
        end
      else
        skill = $data_skills[skill_id]
        $game_party.actors[actor_id].learn_list.push(skill_id)
      end
    end
  end
  #--------------------------------------------------------------------------
end
#==============================================================================
end


and the error occurs in animated battlers - battle, "wrong number of arguments", line 69.
line 69 is this:
Code:
      make_skill_action_result_anim(battler, plus_id)


and this is the full animated battlers - battle script-part:
Code:
#==============================================================================
# ** Animated Battlers - Enhanced   ver. 8.1                       (04-03-2007)
#
#------------------------------------------------------------------------------
#  * (4) Battle System:  The Scene Battle class
#==============================================================================    

#==============================================================================
# ** Scene_Battle 
#------------------------------------------------------------------------------ 
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  alias mnkmain main
  def main
    # Obtain the formation style
    # Only once per battle start
    $formation = $formation_style
    $formation = 0 if $formation_style == nil
    # if Formation is random 
    if $formation == 8 then
      $formation = rand(8).to_i
    end
    mnkmain
  end
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 1 : action preparation)
  #--------------------------------------------------------------------------
  alias mkf_up4s1 update_phase4_step1
  def update_phase4_step1(battler = @active_battler)
    if $rtab_detected == true
      mkf_up4s1(battler)
    else
      mkf_up4s1
    end
    if $scd_detect == true
      if battler != nil
        if battler.sd_casting
          battler.casted = true
        end
      end
    end    
  end
  
  #--------------------------------------------------------------------------
  # *  End Skill Selection
  #--------------------------------------------------------------------------  
  alias mkf_endss end_skill_select
  def end_skill_select
    mkf_endss
    if $rtab_detected
      @active_actor.skill_casted = @skill.id
    else
      @active_battler.skill_casted = @skill.id
    end
  end
  
  #--------------------------------------------------------------------------
  # * Make Skill Action Results (alias used to determine skill used)
  #--------------------------------------------------------------------------
  alias make_skill_action_result_anim make_skill_action_result
  def make_skill_action_result(battler = @active_battler, plus_id = 0)
    @rtab = !@target_battlers
    if $RTAB_Connected_Attacking
      make_skill_action_result_anim(battler, plus_id)
    else
      @rtab ? make_skill_action_result_anim(battler) : make_skill_action_result_anim
    end
    @skill_used = @skill.id
    if $para_spell_detect == true
      if battler.spelling?
        battler.casted = true
      end
    end    
  end
  
  #--------------------------------------------------------------------------
  # * Make Item Action Results (alias used to determine item used)
  #--------------------------------------------------------------------------
  alias make_item_action_result_anim make_item_action_result
  def make_item_action_result(battler = @active_battler)
    @rtab = !@target_battlers
    @rtab ? make_item_action_result_anim(battler) : make_item_action_result_anim
    @item_used = @item.id
    @item_usage = @item.scope
  end
  
  #-------------------------------------------------------------------------- 
  # * Frame Update (main phase step 1 : action preparation) (Casting Routine)
  #--------------------------------------------------------------------------
  alias update_phase4_step1_anim update_phase4_step1
  def update_phase4_step1(battler = @active_battler) 
    @rtab = !@target_battlers
    if $rtab_detected == true
      update_phase4_step1_anim(battler)
      if battler.current_action.kind == 1 and
        (not battler.current_action.forcing or @force != 2)
        if battler.rtp != 0    
          battler.casted = true
        end
      end
    else
      update_phase4_step1_anim
    end
  end
  
  #-------------------------------------------------------------------------- 
  # * Action Animation, Movement
  #--------------------------------------------------------------------------
  alias mnk_update_phase4_step3 update_phase4_step3
  def update_phase4_step3(battler = @active_battler)
    @rtab = !@target_battlers
    target = (@rtab ? battler.target : @target_battlers)[0]

    # Battle Delay System
    if $animbat_at_delay    
      # Fomar's Action Cost Detection
      if $f_acb_detect
        for actor in $game_party.actors
          actor.vitality= 0
        end
        for enemy in $game_troop.enemies
          enemy.vitality= 0
        end
      end
      # Trickster's AT Detection
      if $t_abs_detect
        for actor in $game_party.actors
          actor.at_multiplier= 0
        end
        for enemy in $game_troop.enemies
          enemy.at_multiplier= 0
        end
      end
      # Cogwheel RTAB Detection
      if $rtab_detected
        @rtab_wait_flag = true
      end
    end

    # If enemy is a default battler
    if battler.is_a?(Game_Enemy)
      if $default_enemy
        if @rtab then battler.white_flash = true end
        if @rtab then battler.wait = 10 end
      end
      if $default_enemy_id != nil
        if $default_enemy_id.include?(battler.id)
          if @rtab then battler.white_flash = true end
          if @rtab then battler.wait = 10 end
        end 
      end        
    end
    # If actor is a default battler
    if battler.is_a?(Game_Actor)
      if $default_actor
        if @rtab then battler.white_flash = true end
        if @rtab then battler.wait = 10 end
      end
      if $default_actor_id != nil
        if $default_actor_id.include?(battler.id)
          if @rtab then battler.white_flash = true end
          if @rtab then battler.wait = 10 end
        end 
      end                
    end
    # Reset the 'Do Nothing' flag
    dn_flag = false
    # Set values and poses based on Action 
    case battler.current_action.kind
    when 0  # Attack
      # if Do Nothing, just return
      if battler.current_action.basic == 3
        dn_flag = true
      end
      if dn_flag != true
        rush_type = $rush_attack
        full_moving = true ; if rush_type; full_moving = false; end
        if $move2center_atk.include?(battler.weapon_id); center_move=true ; end
        if $stationary_enemyid.include?(battler.id) and battler.is_a?(Game_Enemy)
          full_moving = false
          center_move = false
          rush_type = false
        end
        
        base_pose = pose_obtain(battler, $p7, $ap7, $ep7)
        base_pose2 = pose_array_obtain(battler, $poses_weapons, $poses_weaps_a, $poses_weaps_e, battler.weapon_id)
        base_pose = base_pose2 if base_pose2 != nil        
        
        if battler.current_action.basic == 2
          # If escaping, disable all movement
          full_moving = false
          center_move = false
          rush_type = false    
          # Set the graphics
          temp_pose = pose_obtain(battler, $poses_escape, $poses_escape_a, $poses_escape_e)
          base_pose = temp_pose if temp_pose != nil
        end
      end
    when 1  # Skill
      rush_type = $rush_skill
      if $moving_skill_atk.include?(@skill_used) ; full_moving = true ; end
      if $move2center_skill.include?(@skill_used) ; center_move = true ; end        
      base_pose = pose_obtain(battler, $p9, $ap9, $ep9)
      base_pose2 = pose_array_obtain(battler, $poses_skills, $poses_skills_a, $poses_skills_e, @skill_used)
      base_pose = base_pose2 if base_pose2 != nil
    when 2  # Item
      rush_type = $rush_item
      if $moving_item_atk.include?(@item_used) or @item_scope == 1..2 ; full_moving = true ; end
      if $move2center_item.include?(@item_used); center_move = true; end
      base_pose = pose_obtain(battler, $p8, $ap8, $ep8)
      base_pose2 = pose_array_obtain(battler, $poses_items, $poses_items_a, $poses_items_e, @item_used)
      base_pose = base_pose2 if base_pose2 != nil
    end

    # Only perform action if 'Do Nothing' flag is off, ie... doing something...
    if dn_flag != true
      # Control Movement and use current pose 
      @moved = {} unless @moved
      return if @spriteset.battler(battler).moving
      if not (@moved[battler] or battler.guarding?)
        offset = offset_value(battler)        
        if rush_type        # Steps forward
          @spriteset.battler(battler).setmove(battler.screen_x - offset, battler.screen_y + 1, battler.screen_z)
        end
        if full_moving      # Runs to target
          @spriteset.battler(battler).setmove(target.screen_x + offset, target.screen_y - 1, target.screen_z + 10)
        end
        if center_move      # Runs to center
          @spriteset.battler(battler).setmove(320+(offset/4), battler.screen_y-1, battler.screen_z)
        end
        @moved[battler] = true
        return
        @spriteset.battler(battler).pose = base_pose
      elsif not battler.guarding?
        @spriteset.battler(battler).pose = base_pose
        @spriteset.battler(battler).setmove(battler.screen_x, battler.screen_y, battler.screen_z)
      end
     
      # Finish Up Skill and Item Use
      case battler.current_action.kind
      when 1
        # Flag system that skill was used
        battler.casted = false
        battler.casting = false
        @spriteset.battler(battler).skill_used = 0
      when 2
        # Flag system that item was used
        @spriteset.battler(battler).item_used = 0
      end
      
      # Battle_Charge value for BattleCry script
      $battle_charge = true
    end

    # Battle Delay System
    if $animbat_at_delay    
      # Fomar's Action Cost Detection
      if $f_acb_detect
        for actor in $game_party.actors
          actor.vitality= 1
        end
        for enemy in $game_troop.enemies
          enemy.vitality= 1
        end
      end
      # Trickster's AT Detection
      if $t_abs_detect
        for actor in $game_party.actors
          actor.at_multiplier= 1.0
        end
        for enemy in $game_troop.enemies
          enemy.at_multiplier= 1.0
        end
      end
      # Cogwheel RTAB Detection
      if $rtab_detected
        @rtab_wait_flag = false
      end
    end
    
    # Done 
    @moved[battler] = false
    @rtab ? mnk_update_phase4_step3(battler) : mnk_update_phase4_step3
  end
  #--------------------------------------------------------------------------
  # * Offset Calculation
  #--------------------------------------------------------------------------
  def offset_value(battler = @active_battler)
    offst = @spriteset.battler(battler).battler_offset
    offst += $rush_offset
    if $sv_mirror == 1
      offset = (battler.is_a?(Game_Actor) ? -(offst) : offst)
    else
      offset = (battler.is_a?(Game_Actor) ? offst : -(offst))
    end
    return offset
  end
  #--------------------------------------------------------------------------
  # * Hit Animation
  #--------------------------------------------------------------------------
  alias mnk_update_phase4_step4 update_phase4_step4
  def update_phase4_step4(battler = @active_battler)
    for target in (@rtab ? battler.target : @target_battlers)
      damage = (@rtab ? target.damage[battler] : target.damage)
      critical = (@rtab ? target.critical[battler] : target.critical)
      if damage.is_a?(Numeric) and damage > 0
        base_pose = pose_obtain(target, $p2, $ap2, $ep2)
        @spriteset.battler(target).pose = base_pose
        if critical == true
          temp_pose = pose_obtain(target, $poses_crit, $poses_crit_a, $poses_crit_e)
          @spriteset.battler(target).pose = temp_pose if temp_pose != nil
        end
      end
    end
    @rtab ? mnk_update_phase4_step4(battler) : mnk_update_phase4_step4
  end
  #-------------------------------------------------------------------------- 
  # * Victory Animation
  #--------------------------------------------------------------------------
  alias mnk_start_phase5 start_phase5
  def start_phase5
    for actor in $game_party.actors
      return if @spriteset.battler(actor).moving
    end
    # See if an actor remains alive
    for actor in $game_party.actors
      unless actor.dead?
        $victory = true
      end
    end
    # See if an enemy remains alive
    for enemy in $game_troop.enemies.reverse
      unless enemy.dead?
        $defeat = true
      end
    end    
    
    mnk_start_phase5
  end
  #--------------------------------------------------------------------------
  # * Change Arrow Viewport
  #--------------------------------------------------------------------------
  alias mnk_start_enemy_select start_enemy_select
  def start_enemy_select
    mnk_start_enemy_select
    @enemy_arrow.dispose
    @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport2)
    @enemy_arrow.help_window = @help_window
  end
  #--------------------------------------------------------------------------
  # * Obtain Pose (Scene Battle version)
  #     battler     : battler performing attack
  #     pose_base   : default pose to return
  #     pose_actor  : list of poses for actors
  #     pose_enemy  : list of poses for enemies
  #--------------------------------------------------------------------------
  def pose_obtain(battler, pose_base, pose_actor, pose_enemy)
    # create Arrays
    pos_a = {}
    pos_e = {}
    # fill created Arrays & Set pose
    pos_a = pose_actor
    pos_e = pose_enemy
    pose_now = pose_base
    # Obtain pose if not a standard pose
    if battler.is_a?(Game_Actor)
      pose_now = pos_e[battler.id] if pos_a[battler.id] != nil
    else
      pose_now = pos_e[battler.id] if pos_e[battler.id] != nil
    end
    return pose_now
  end

  #--------------------------------------------------------------------------
  # * Obtain Pose from hashes (Scene Battle version)
  #     battler     : battler performing attack
  #     hash_base   : hash with default poses
  #     hash_actor  : advanced list of poses for actors
  #     hash_enemy  : advanced list of poses for enemies
  #     condition   : value determining where to get the final pose
  #--------------------------------------------------------------------------
  def pose_array_obtain(battler, hash_base, hash_actor, hash_enemy, condition)
    # create Arrays
    # create Arrays
    hash_b    = {}
    hash_a    = {}
    hash_e    = {}
    pose_temp = {}
    # fill created Arrays & Set pose
    hash_b = hash_base
    hash_a = hash_actor
    hash_e = hash_enemy
    # Setup the temp Array
    if battler.is_a?(Game_Actor)
      pose_temp = hash_a[battler.id] if hash_a.include?(battler.id)
    else
      pose_temp = hash_e[battler.id] if hash_e.include?(battler.id)
    end
    # Obtain the base pose based on condition (or nil)
    pose_now = hash_b[condition] if hash_b.include?(condition)
    # Obtain the optional actor/enemy pose based on condition (unless nil)
    pose_now = pose_temp[condition] if pose_temp.include?(condition)
    # Return the final pose
    return pose_now
  end
end
 
Gutenmorgen, hűbsche Dame.

It's not an error, but a mis-configuration... and the most common one out there apart from sliced & diced battlers.

The whole condition was...
Code:
    if [B][I]$RTAB_Connected_Attacking[/I][/B]
      [B]make_skill_action_result_anim(battler, plus_id)[/B]
    else
      @rtab ? make_skill_action_result_anim(battler) : make_skill_action_result_anim
    end

The switch $RTAB_Connected_Attacking is basically an on/off (or true/false) switch you have to turn on or off in the configuration system. I covered it in the first page of the topic. 8-)

I've tried to have the system auto-detect Battlesystem scripts, including RTAB, Trickster's, Fomar0153's... but the the 'Connected Attacking' script by Cogwheel could not be autodetected :| , and you have to manually set this value yourself.

BTW: I will probably have to point out that the 'Connected Attacking' script by RTAB will not work properly with Caldaron's Learn Skill script. :no: But... Trickster has an SDK script called 'Simple Combos' out there right now. :yes:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top