I've been trying to get this working too, using Rhyme's animated enemies (same link as above) and the Yanfly Ace Battle Engine. Testing combat out resulted in errors in the main Yanfly Battle Engine script in reference to popups between the following lines
(848-919):
#--------------------------------------------------------------------------
# alias method: setup_new_effect
#--------------------------------------------------------------------------
alias sprite_battler_setup_new_effect_abe setup_new_effect
def setup_new_effect
sprite_battler_setup_new_effect_abe
setup_popups
end
#--------------------------------------------------------------------------
# new method: setup_popups
#--------------------------------------------------------------------------
def setup_popups
return unless @battler.use_sprite?
@battler.popups = [] if @battler.popups.nil?
return if @battler.popups == []
array = @battler.popups.shift
create_new_popup(array[0], array[1], array[2])
end
#--------------------------------------------------------------------------
# new method: create_new_popup
#--------------------------------------------------------------------------
def create_new_popup(value, rules, flags)
return if @battler == nil
return if flags & @popup_flags != []
array = YEA::BATTLE:
😛OPUP_RULES[rules]
for popup in @popups
popup.y -= 24
end
return unless SceneManager.scene.is_a?(Scene_Battle)
return if SceneManager.scene.spriteset.nil?
view = SceneManager.scene.spriteset.viewportPopups
new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
@popups.push(new_popup)
@popup_flags.push("weakness") if flags.include?("weakness")
@popup_flags.push("resistant") if flags.include?("resistant")
@popup_flags.push("immune") if flags.include?("immune")
@popup_flags.push("absorbed") if flags.include?("absorbed")
end
#--------------------------------------------------------------------------
# alias method: update_effect
#--------------------------------------------------------------------------
alias sprite_battler_update_effect_abe update_effect
def update_effect
sprite_battler_update_effect_abe
update_popups
end
#--------------------------------------------------------------------------
# new method: update_popups
#--------------------------------------------------------------------------
def update_popups
for popup in @popups
popup.update
next unless popup.opacity <= 0
popup.bitmap.dispose
popup.dispose
@popups.delete(popup)
popup = nil
end
@popup_flags = [] if @popups == [] && @popup_flags != []
return unless SceneManager.scene_is?(Scene_Battle)
if @current_active_battler != SceneManager.scene.subject
@current_active_battler = SceneManager.scene.subject
@popup_flags = []
end
end
end # Sprite_Battler
Commenting out that section of the script, I can actually get the combat working in game and the enemies animating fine (idle, defend, attack etc. animations all work), but obviously it's not an actual solution to just cut out that section from the core battle engine script. Besides popups not showing when that happens, I also run into a problem where when the enemy HP reaches 0 and toggles on the death state, the death animation frames cycle referenced by Rhyme's script will play on loop nonstop without the enemy collapsing/disappearing, Commenting out lines 158 & 159 in
Rhyme's Script (self.opacity = 255 & self.visible = true) makes the enemy instantly disappear when dead instead of visibly looping its death frames, but upon killing every enemy in a troop the combat doesn't end and I'm given a choice to heal/use item/attack which crashes the game with a Divide by Zero since there are no targets left to attack :S
I like the simplicity of Rhyme's animation script even though I really only need the enemy idle, damaged, and attack animations so I would love to find a way to make it compatible with Yanfly, even if it results in a compromise (I don't even mind the damage dealt/enemy HP bars etc not showing) but the bug with the sprites not disappearing or following their collapse animations after death and combat not ending once all enemies have been killed is a game-breaker and I don't know how to fix the compatibility issue for the update_popups/@popups/setup_popups errors in lines 848-919 without just removing the problematic lines.
Edit: I may as well post my (slightly modified) Rhyme's animated enemies script, possibly somebody out there has a better modified version of it that's compatible with Yanfly or takes into account the above problems?
Spoiler
#==============================================================================
# ■ Animated Enemy Sprites
# Merry Christmas and happy holidays!
#==============================================================================
# Notebox Tag:
# Enemy: !Flip
#==============================================================================
# Spritesheet Data for referencing
#
# 0. Idle
# 1. Defend
# 2. Weak
# 3. Damaged/Dead
# 4. Attack
# 5. Item
# 6. Skill
# 7. Magic
# 8. Advance (n/a)
# 9. Retreat (n/a)
# 10. Victory (n/a)
# 11. Enter
# 12. Dead
# 13. Credits and/or etc (n/a)
#==============================================================================
# ~rhyme
#==============================================================================
module Animated_Enemy_Sprites
Delay = 15
FrameSize = [3, 14]
DefaultBlink = false
end
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase
attr_accessor 😛ose
#--------------------------------------------------------------------------
# ● Flip
#--------------------------------------------------------------------------
def flip_sprite
return false
end
#--------------------------------------------------------------------------
# ● Reset Pose
#--------------------------------------------------------------------------
def reset_pose
@pose = 0
@pose = 2 if @hp < mhp / 4
if @states != nil
@pose = 2 if @states.size > 0
end
@pose = 1 if guard?
@pose = 3 if dead?
end
#--------------------------------------------------------------------------
# ● Use Item
#--------------------------------------------------------------------------
alias use_item_ani use_item
def use_item(item)
if item.is_a?(RPG::Item)
@pose = 4
else
if item.is_a?(RPG::Skill)
if item.id == attack_skill_id
@pose = 4
elsif item.physical?
@pose = 6
elsif item.magical?
@pose = 7
end
end
end
use_item_ani(item)
end
#--------------------------------------------------------------------------
# ● Perform Damage
#--------------------------------------------------------------------------
alias perform_map_damage_effect_ani perform_map_damage_effect
def perform_map_damage_effect
perform_map_damage_effect_ani
@pose = 3 unless @guarding
end
#--------------------------------------------------------------------------
# ● Upon Damage
#--------------------------------------------------------------------------
alias on_damage_ani on_damage
def on_damage(value)
@pose = 3 unless @guarding
on_damage_ani(value)
end
end
#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● Flip
#--------------------------------------------------------------------------
def flip_sprite
return true if Scan::string($data_enemies[@enemy_id].note, "!Flip")
return super
end
end
#==============================================================================
# ■ Sprite_Battler
#==============================================================================
class Sprite_Battler < Sprite_Base
attr_accessor :battler
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
@effect_type = nil
@effect_duration = 0
@spritesheet = true
@pose = 11
@counter = 0
@delay = Animated_Enemy_Sprites:😀elay
@frame_size = Animated_Enemy_Sprites::FrameSize
end
#--------------------------------------------------------------------------
# ● Frame Update
#--------------------------------------------------------------------------
def update
super
if @battler
@battler.reset_pose if @battler.pose == nil
self.mirror = @battler.flip_sprite
@use_sprite = @battler.use_sprite?
if @spritesheet
update_pose if @pose != 11
end
if Graphics.frame_count % @delay == 0
@counter += 1
if @counter >= @frame_size[0]
@counter = 0
if @pose == 11
update_pose
else
@battler.reset_pose
end
end
end
if @use_sprite
update_bitmap
update_origin
update_position
end
setup_new_effect
setup_new_animation
update_effect
else
@effect_type = nil
end
#self.opacity = 255
#self.visible = true
end
#--------------------------------------------------------------------------
# ● Update bitmap
#--------------------------------------------------------------------------
def update_bitmap
if @spritesheet
@spritesheet_bitmap = Cache.battler(@battler.battler_name + "-spritesheet", @battler.battler_hue)
ss_size = [@spritesheet_bitmap.width, @spritesheet_bitmap.height]
new_bitmap = Bitmap.new(ss_size[0] / @frame_size[0], ss_size[1] / @frame_size[1])
cx = @counter * (ss_size[0] / @frame_size[0])
cy = @pose * (ss_size[1] / @frame_size[1])
crop_rect = Rect.new(cx, cy, ss_size[0], ss_size[1])
new_bitmap.blt(0, 0, @spritesheet_bitmap, crop_rect)
else
new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
end
if bitmap != new_bitmap
self.bitmap = new_bitmap
init_visibility
end
end
#--------------------------------------------------------------------------
# ● Update Pose
#--------------------------------------------------------------------------
def update_pose
oldpose = @pose
newpose = @battler.pose
if newpose != oldpose
@counter = 0
@pose = newpose
end
end
#--------------------------------------------------------------------------
# ● Blink
#--------------------------------------------------------------------------
def update_blink
self.opacity = (@effect_duration % 10 < 5) ? 255 : 0 if Animated_Enemy_Sprites:😀efaultBlink
end
end
#============================================================================
# ▼ Scan
#============================================================================
module Scan
#--------------------------------------------------------------------------
# ● Scan.string(object, string)
#--------------------------------------------------------------------------
def self.string(object, string)
if object[/#{Regexp.quote string}/]
return true
end
return false
end
end