Blizz ABS Auto Frame Bug

Started by Ronivan, November 18, 2013, 06:19:47 am

Previous topic - Next topic

Ronivan

November 18, 2013, 06:19:47 am Last Edit: November 18, 2013, 06:21:05 am by Ronivan
Hello my friends, I decided to develop my project and go to Blizz ABS 2.84. But there was a serious problem with one of my most important scripts, including one made by KK20 here Chaos Project.
The problem is that it has a bug if it is placed below Blizz-ABS v2.84 Part 2, with the following Message:

Script Error in Blizz-ABS v2.84 Part 2 in 2219 in line 'NoMethodError'
Undefined method 'refresh' for # <Game_Player:0xdd597a8>

If I cannot use my script Auto-Frame, I cannot work with Blizz ABS. Even if I put the Script Auto-frames above the Blizz-ABS v2.84 Part 2, it does not work.
Below here is the Script Auto-Frames that I use, if someone can do some modification or can help in anything, again I will be very grateful.

#==============================================================================
# Extra Frames
# por COGHWELL
# Edit by KK20
# http://members.jcom.home.ne.jp/cogwheel/
#==============================================================================
# KK20's Note: The following instructions are no longer relevant to this script.
# The number of frames a character sprite uses is determined by the amount
# configured in the configuration below.
#==============================================================================
module ExtraFramesConfig
 def self.char_frames(name)
   case name
   #--------------------------------------------------------------------------
   # Begin Configuration
   # Format:
   #             when 'filename' then return FRAMES
   #
   # Any names not configured will be assumed to have 4 frames (RMXP default)
   #--------------------------------------------------------------------------
   when '001-A' then return 16
   when '001-B' then return 16
   when 'Measure - Gear 1 L' then return 16
   when 'Measure - Gear 1 R' then return 16
   when 'Measure - Gear 2 LR' then return 16
   when 'Measure - Gear 3 Half Down' then return 16
   when 'ABS Rohan 1 (Guardian)' then return 8
   when 'ABS Rohan 1 (Guardian)_quarter' then return 4
   when 'ABS Rohan 1 (Guardian)_ACT' then return 7
   when 'ABS Rohan 1 (Guardian)_ANI' then return 8
   when 'ABS Rohan 1 (Guardian)_BOW_01' then return 5
   when 'ABS Rohan 1 (Guardian)_dash' then return 8
   when 'ABS Rohan 1 (Guardian)_HIT' then return 3
   when 'ABS Rohan 1 (Guardian)_Holding' then return 6
   when 'ABS Rohan 1 (Guardian)_jump' then return 4
   when 'ABS Rohan 1 (Guardian)_Pickup' then return 3
   when 'ABS Rohan 1 (Guardian)_SWD_01' then return 8
   when 'ABS Rohan 1 (Guardian)_throw' then return 5
   when 'ABS Rohan 1 (Guardian)_TRW' then return 5
   when 'ABS Rohan 1 (Guardian)_SKILL_01' then return 3
   when 'ABS Rohan 1 (Guardian)_skill1' then return 3
   when 'ABS Rohan 1 (Guardian)_Stair' then return 8
   when 'ABS Eowyn 1 (Archer)' then return 8
   when 'ABS Eowyn 1 (Archer)_ANI' then return 8
   when 'ABS Eowyn 1 (Archer)_BOW_01' then return 5
   when 'ABS Eowyn 1 (Archer)_dash' then return 8
   when 'ABS Eowyn 1 (Archer)_HIT' then return 3
   when 'ABS Eowyn 1 (Archer)_Jump' then return 4
   when 'ABS Eowyn 1 (Archer)_Pickup' then return 3
   when 'ABS Eowyn 1 (Archer)_SKILL_01' then return 4
   when 'ABS Eowyn 1 (Archer)_SWD_01' then return 8
   when 'ABS Eowyn 1 (Archer)_throw' then return 4
   when 'ABS Eowyn 1 (Archer)_TRW' then return 4
   when 'ABS Artanis 1 (Alchemist)' then return 8
   when 'ABS Artanis 1 (Alchemist)_ANI' then return 8
   when 'ABS Artanis 1 (Alchemist)_MCE' then return 7
   when 'ABS Artanis 1 (Alchemist)_dash' then return 8
   when 'ABS Artanis 1 (Alchemist)_HIT' then return 3
   when 'ABS Artanis 1 (Alchemist)_Pickup' then return 3
   when 'ABS Artanis 1 (Alchemist)_SKILL_01' then return 4
   when 'ABS Artanis 1 (Alchemist)_TRW' then return 4
   when 'ABS Artanis 1 (Alchemist)_Throw' then return 4
   when 'ABS Artanis 1 (Alchemist)_Quarter' then return 4
   when 'ABS Círdan (Mage)' then return 8
   when 'ABS Círdan (Mage)_ANI' then return 8
   when 'ABS Círdan (Mage)_ROD_01' then return 7
   when 'ABS Círdan (Mage)_dash' then return 8
   when 'ABS Círdan (Mage)_HIT' then return 3
   when 'ABS Círdan (Mage)_Pickup' then return 3
   when 'ABS Círdan (Mage)_SKILL_01' then return 6
   when 'ABS Círdan (Mage)_Quarter' then return 4
   when 'E_Ambernite' then return 4
   when 'E_Ambernite_ANI' then return 4
   when 'E_Ambernite_ACT' then return 9
   when 'E_Ambernite_HIT' then return 4
   when 'E_Ambernite_SKILL' then return 4
   when 'E_AprenticeM 1' then return 8
   when 'E_AprenticeM 1_ANI' then return 8
   when 'E_AprenticeM 1_ACT' then return 7
   when 'E_AprenticeM 1_HIT' then return 3
   when 'E_AprenticeM 1_SKILL' then return 3
   when 'E_AprenticeM 2' then return 8
   when 'E_AprenticeM 2_ANI' then return 8
   when 'E_AprenticeM 2_ACT' then return 7
   when 'E_AprenticeM 2_HIT' then return 3
   when 'E_AprenticeM 2_SKILL' then return 3
   when 'E_ThiefM 1' then return 8
   when 'E_ThiefM 1_ANI' then return 8
   when 'E_ThiefM 1_ACT' then return 6
   when 'E_ThiefM 1_HIT' then return 3
   when 'E_ThiefM 1_SKILL' then return 3
   when 'E_ThiefM 2' then return 8
   when 'E_ThiefM 2_ANI' then return 8
   when 'E_ThiefM 2_ACT' then return 6
   when 'E_ThiefM 2_HIT' then return 3
   when 'E_ThiefM 2_SKILL' then return 3
   when 'E_ThiefM 3' then return 8
   when 'E_ThiefM 3_ANI' then return 8
   when 'E_ThiefM 3_ACT' then return 6
   when 'E_ThiefM 3_HIT' then return 3
   when 'E_ThiefM 3_SKILL' then return 3
   when 'E_Batus' then return 6
   when 'E_Batus_ANI' then return 6
   when 'E_Batus_ACT' then return 5
   when 'E_Batus_HIT' then return 2
   when 'E_Batus_SKILL' then return 3
   when 'E_GPoring' then return 8
   when 'E_GPoring_ANI' then return 8
   when 'E_GPoring_ACT' then return 8
   when 'E_GPoring_HIT' then return 2
   when 'E_Poring' then return 8
   when 'E_Poring_ANI' then return 8
   when 'E_Poring_ACT' then return 8
   when 'E_Poring_HIT' then return 2
   when 'E_Poison Spore' then return 8
   when 'E_Poison Spore_ANI' then return 8
   when 'E_Poison Spore_ACT' then return 5
   when 'E_Poison Spore_HIT' then return 3
   when 'E_Poison Spore_SKILL' then return 3
   when 'E_Rhoda Frog' then return 5
   when 'E_Rhoda Frog_ANI' then return 5
   when 'E_Rhoda Frog_ACT' then return 6
   when 'E_Rhoda Frog_HIT' then return 2
   when 'E_Spore' then return 8
   when 'E_Spore_ANI' then return 8
   when 'E_Spore_ACT' then return 5
   when 'E_Spore_HIT' then return 3
   when 'E_Spore_SKILL' then return 3
   when 'E_Spore2' then return 8
   when 'E_Spore2_ANI' then return 8
   when 'E_Spore2_ACT' then return 5
   when 'E_Spore2_HIT' then return 3
   when 'E_Spore2_SKILL' then return 3
   when 'E_Spore3' then return 8
   when 'E_Spore3_ANI' then return 8
   when 'E_Spore3_ACT' then return 5
   when 'E_Spore3_HIT' then return 3
   when 'E_Spore3_SKILL' then return 3
   when 'E_Willow' then return 5
   when 'E_Willow_ANI' then return 5
   when 'E_Willow_ACT' then return 5
   when 'E_Willow_HIT' then return 2
   #--------------------------------------------------------------------------
   # End of Configuration
   #--------------------------------------------------------------------------
   else
     return 4
   end
 end
end

#==============================================================================
# ■ Game_Character
#==============================================================================
class Game_Character
 #--------------------------------------------------------------------------
 def update
   if jumping?
     update_jump
   elsif moving?
     update_move
   else
     update_stop
   end
   frames = ExtraFramesConfig.char_frames(@character_name)
   if frames != 4
     @anime_count = 20 if @anime_count > 0 and @pattern == @original_pattern
     if @anime_count * (frames - 1) / 4 > 18 - @move_speed * 3
       if not @step_anime and @stop_count > 0
         @pattern = @original_pattern
       else
         @pattern = @pattern % (frames - 1) + 1
       end
       @anime_count = 0
     end
   else
     if @anime_count > 18 - @move_speed * 2
       if not @step_anime and @stop_count > 0
         @pattern = @original_pattern
       else
         @pattern = (@pattern + 1) % 4
       end
       @anime_count = 0
     end
   end
   if @wait_count > 0
     @wait_count -= 1
     return
   end
   if @move_route_forcing
     move_type_custom
     return
   end
   if @starting or lock?
     return
   end
   if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
     case @move_type
     when 1
       move_type_random
     when 2
       move_type_toward_player
     when 3
       move_type_custom
     end
   end
 end
end


#================================================= =============================
# ■ Sprite_Character
#================================================= =============================
class Sprite_Character < RPG::Sprite
 #--------------------------------------------------------------------------
 def update
   super
   if @tile_id != @character.tile_id or
      @character_name != @character.character_name or
      @character_hue != @character.character_hue
     @tile_id = @character.tile_id
     @character_name = @character.character_name
     @character_hue = @character.character_hue
     if @tile_id >= 384
       self.bitmap = RPG::Cache.tile($game_map.tileset_name,
       @tile_id, @character.character_hue)
       self.src_rect.set(0, 0, 32, 32)
       self.ox = 16
       self.oy = 32
     else
       self.bitmap = RPG::Cache.character(@character.character_name,
       @character.character_hue)
       frames = ExtraFramesConfig.char_frames(@character.character_name)
       $game_player.refresh
       if frames != 4
         @cw = bitmap.width / frames
         @ch = bitmap.height / 4
       else
         @cw = bitmap.width / 4
         @ch = bitmap.height / 4
       end
       self.ox = @cw / 2
       self.oy = @ch
     end
   end
   self.visible = (not @character.transparent)
   if @tile_id == 0
     sx = @character.pattern * @cw
     sy = (@character.direction - 2) / 2 * @ch
     self.src_rect.set(sx, sy, @cw, @ch)
   end
   self.x = @character.screen_x
   self.y = @character.screen_y
   self.z = @character.screen_z(@ch)
   self.opacity = @character.opacity
   self.blend_type = @character.blend_type
   self.bush_depth = @character.bush_depth
   if @character.animation_id != 0
     animation = $data_animations[@character.animation_id]
     animation(animation, true)
     @character.animation_id = 0
   end
 end
end

#================================================= =============================
# ■ Window_Base
#================================================= =============================
class Window_Base < Window
 #--------------------------------------------------------------------------
 def draw_actor_graphic(actor, x, y)
   bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
   frames = ExtraFramesConfig.char_frames(actor.character_name)
   if frames != 4
     cw = bitmap.width / frames
     ch = bitmap.height / 4
   else
     cw = bitmap.width / 4
     ch = bitmap.height / 4
   end
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
 end
end

#================================================= =============================
# ■ Window_SaveFile
#================================================= =============================
class Window_SaveFile < Window_Base
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   self.contents.font.color = normal_color
   name = "File #{@file_index + 1}"
   self.contents.draw_text(4, 0, 600, 32, name)
   @name_width = contents.text_size(name).width
   if @file_exist
     for i in 0...@characters.size
       bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
       frames = ExtraFramesConfig.char_frames(@characters[i][0])
       if @characters[i][0][/\[(\d+)\]/]
         cw = bitmap.width / frames
         ch = bitmap.height / 4
       else
       cw = bitmap.width / 4
       ch = bitmap.height / 4
     end
     src_rect = Rect.new(0, 0, cw, ch)
     x = 300 - @characters.size * 32 + i * 64 - cw / 2
     self.contents.blt(x, 68 - ch, bitmap, src_rect)
   end
   hour = @total_sec / 60 / 60
   min = @total_sec / 60 % 60
   sec = @total_sec % 60
   time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
   self.contents.font.color = normal_color
   self.contents.draw_text(4, 8, 600, 32, time_string, 2)
   self.contents.font.color = normal_color
   time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
   self.contents.draw_text(4, 40, 600, 32, time_string, 2)
   end
 end
end

#================================================= =============================
# ■ Game_Player
#================================================= =============================
class Game_Player < Game_Character
 #--------------------------------------------------------------------------
 def anime_update
   frames = ExtraFramesConfig.char_frames(@character_name)
   if frames != 4
     @anime_count = 20 if @anime_count > 0 and @pattern == @original_pattern
     if @anime_count * (frames - 1) / 4 > 18 - @move_speed * 2
       if not @step_anime and @stop_count > 0
         @pattern = @original_pattern
       else
         @pattern = @pattern % ($1.to_i - 1) + 1
       end
       @anime_count = 0
     end
   else
     if @anime_count > 18 - @move_speed * 2
       if not @step_anime and @stop_count > 0
         @pattern = @original_pattern
       else
         @pattern = (@pattern + 1) % 4
       end
       @anime_count = 0
     end
   end
 end
end

KK20

The script won't work without modifications to some of the BlizzABS methods. I've looked at it a bit, but it seems like a difficult fix.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Ronivan

November 18, 2013, 01:17:12 pm #2 Last Edit: November 18, 2013, 01:19:36 pm by Ronivan
Thanks again for the help, but I belive it will not work indeed. Blizz ABS has lots of entries to method $refresh_player or so. Probably it can't be solved this time. I liked Blizz ABS, is a incredible ABS system far mor great than the XAS I'm using, but it seems I can't work with it due to my animation problems. But I'm greateful again for you help.