Battle sound incompatibility between Lecode's Damage Sequence and Yanfly's VX Ace battle engine
BMM Archive · July 15, 2026
Original Source
- Original title: Battle sound incompatibility between Lecode's Damage Sequence and Yanfly's VX Ace battle engine
- Original author: rockless8
- Original date: January 16, 2025
- Source thread: https://forums.rpgmakerweb.com/threads/battle-sound-incompatibility-between-lecodes-damage-sequence-and-yanflys-vx-ace-battle-engine.174744/
- Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSS3 Scripts (RMVX Ace) > RGSS3 Script Requests
Summary
Hi all, When used together, Lecode's Damage Sequence and Yanfly's battle system for VX Ace for the most part work, but cause a noticeable problem: the sounds for actor and enemy damage in battle become silent. I've tested these scripts together in a blank project and they appear to conflict with each other in this particular way, when either is removed the actor and enemy damage sounds in battle are restored. Notably, this doesn't seem to be an issue stemming from Yanfly's Core script and is definitely incompatibility between the...
Archived First Post
When used together, Lecode's Damage Sequence and Yanfly's battle system for VX Ace for the most part work, but cause a noticeable problem: the sounds for actor and enemy damage in battle become silent.
I've tested these scripts together in a blank project and they appear to conflict with each other in this particular way, when either is removed the actor and enemy damage sounds in battle are restored. Notably, this doesn't seem to be an issue stemming from Yanfly's Core script and is definitely incompatibility between the battle system and the damage sequence script. Could somebody with more RGSS3 knowledge than I have find what's causing this strange incompatibility?
I've provided Lecode's script here because it is currently inaccessible on the original post:
if true
#==============================================================================
#- Damage Sequence
#- By Lecode
#- Version 1.1
#------------------------------------------------------------------------------
# This script allows you to synchronize skills and items' damage with their
# animations. To put it simply, the player can now deal damage
# during an animation. Thus, you can decide to make
# real multiple-hits skills or to deal damage at
# a specifique frame. (animation's frame)
#------------------------------------------------------------------------------
# INSTRUCTION: Skills and Items notetags
#------------------------------------------------------------------------------
# The tag is:
# <damage sequence>
# [frame,formula,effects?,crit?,never_miss?]
# [frame,formula,effects?,crit?,never_miss?]
# ......
# </damage sequence>
#
# Specify the frames where damages are dealt.
# You can also specify if you allow the skill/item to:
# - Apply effects (effects?)
# - Try to crit (crit?)
# - Certain hit (nerver_miss?)
# Also, you can set a custom damage formula for that specific frame.
# Replace "formula" with "" or nil to use the default formula.
# Example:
=begin
<damage sequence>
[2, nil, false, true, false]
[5,"a.agi*3", true, false, true]
[10,"", false, true, false]
</damage sequence>
Inflicts damage at frames 2, 5 and 10.
The first hit use the default formula and doesn't apply effects.
The second one use a special formula (a.agi*3), apply effects, is garanted,
but can't try a critical effect.
The last hit use the default formula and doesn't apply effects.
=end
#------------------------------------------------------------------------------
# Notes
#------------------------------------------------------------------------------
# The script is compatible with the default battle system and
# with Yanfly's battle engine.
# Let me know if you face some compatibility issues.
# PERHAPS I will solve them.
#------------------------------------------------------------------------------
# Terms of Use
#------------------------------------------------------------------------------
# Credits to Lecode
# Free for non-commercial projects
# Contact me for commercial use
#------------------------------------------------------------------------------
# Versions:
# 1.0 - Initial release
# 1.1 - Added the possibility to control critical
# and guaranted hits, and formula. Also, merge all tags into
# an unique one.
#==============================================================================
$imported = {} if $imported.nil?
module Lecode
module DamageSequence
Allow_Blink_Effects = true
end
end
#==============================================================================
class RPG::UsableItem
attr_accessor :leds_frame
def leds_initialize
@leds_frame = -1
@dmg_sequence = []
@formula_sequence = Hash.new(@damage.formula)
@effects_sequence = Hash.new(true)
@crit_sequence = Hash.new(true)
@nvmiss_sequence = Hash.new(false)
#-
read = false
lines = []
self.note.split(/[\r\n]+/).each { |line|
case line
when /<damage sequence>/
read = true
when /<\/damage sequence>/
read = false
else
if read
lines.push(line)
end
end
}
#-
lines.each { |line|
array = eval(line.gsub("\s",""))
frame = array[0]
formula = array[1]
@dmg_sequence.push(frame)
@formula_sequence[frame] = formula if !formula.nil? && formula != ""
@effects_sequence[frame] = array[2]
@crit_sequence[frame] = array[3]
@nvmiss_sequence[frame] = array[4]
}
end
def leds_hit?(frame)
@dmg_sequence.include?(frame)
end
def leds_effects?
@effects_sequence[@leds_frame]
end
def leds_crit?
@crit_sequence[@leds_frame]
end
def leds_nvmiss?
@nvmiss_sequence[@leds_frame]
end
def leds_formula
@formula_sequence[@leds_frame]
end
def leds_valid?
self.note =~ /<damage sequence>/i
end
end
class Scene_Battle
alias ledmgseq_create_spriteset create_spriteset
def create_spriteset
ledmgseq_create_spriteset
#- Attach actors to their sprites
@spriteset.leds_update_actor_sprites
end
alias ledmgseq_use_item use_item
def use_item
$game_temp.leds_from_default_method = true
ledmgseq_use_item
$game_temp.leds_from_default_method = false
end
alias ledmgseq_show_anim show_animation
def show_animation(targets, animation_id)
item = @subject.current_action.item
#-
before_ledmg_sequence(item,targets)
ledmgseq_show_anim(targets, animation_id)
after_ledmg_sequence(item,targets)
end
def before_ledmg_sequence(item,targets)
#- Prepare the sequence
return unless item.leds_valid?
ndata = {:user => @subject, :item => item}
targets.each { |target|
sprite = target.leds_sprite
next if sprite.nil?
sprite.set_leds_data(ndata)
target.under_leds = true
}
end
def after_ledmg_sequence(item,targets)
#- End of sequence
return unless item.leds_valid?
targets.each { |target|
sprite = target.leds_sprite
next if sprite.nil?
sprite.reset_leds_data
target.under_leds = false
}
end
alias ledmgseq_invoke_item invoke_item
def invoke_item(target, item)
#- Prevent tagged skills to deal damage
#- in a normal way
if item.leds_valid? && !$imported["YEA-BattleEngine"]
return if $game_temp.leds_from_default_method
end
ledmgseq_invoke_item(target, item)
end
#- Another prevention in case of
#- Yea BattleEngine is used
alias ledmgseq_ica invoke_counter_attack
def invoke_counter_attack(target,item)
if $imported["YEA-BattleEngine"]
if item.leds_valid?
return if $game_temp.leds_from_default_method
end
end
ledmgseq_ica(target,item)
end
#- Another prevention in case of
#- Yea BattleEngine is used
alias ledmgseq_imr invoke_magic_reflection
def invoke_magic_reflection(target,item)
if $imported["YEA-BattleEngine"]
if item.leds_valid?
return if $game_temp.leds_from_default_method
end
end
ledmgseq_imr(target,item)
end
#- Another prevention in case of
#- Yea BattleEngine is used
alias ledmgseq_aie apply_item_effects
def apply_item_effects(target,item)
if $imported["YEA-BattleEngine"]
if item.leds_valid?
return if $game_temp.leds_from_default_method
end
end
ledmgseq_aie(target,item)
end
#- Called by Sprite_Battler
def execute_ledmg_sequence(target,user,item,frame)
return unless item.leds_hit?(frame)
#- Process Hit
item.leds_frame = frame
item.damage.formula = item.leds_formula
$game_temp.leds_from_default_method = false
if $imported["YEA-BattleEngine"]
#- Use a special method
invoke_item_single_hit(target,item)
else
#- Use the default method for compatibility
#- purposes
invoke_item(target,item)
end
$game_temp.leds_from_default_method = true
item.leds_frame = -1
end
def invoke_item_single_hit(target, item)
if rand < target.item_cnt(@subject, item)
invoke_counter_attack(target, item)
elsif rand < target.item_mrf(@subject, item)
invoke_magic_reflection(target, item)
else
apply_item_effects(apply_substitute(target, item), item)
end
@subject.last_target_index = target.index
end
alias ledmgseq_check_substitute check_substitute
def check_substitute(target, item)
return false if item.leds_nvmiss?
ledmgseq_check_substitute(target, item)
end
end
class Game_Battler
attr_accessor :under_leds
attr_accessor :leds_fix_targets
alias ledmgseq_initialize initialize
def initialize(*args)
@under_leds = false
ledmgseq_initialize(*args)
end
def leds_sprite
scene = SceneManager.scene
return nil unless SceneManager.scene_is?(Scene_Battle)
return scene.spriteset.actor_sprites.find { |s| s.leds_battler == self } if actor?
return scene.spriteset.enemy_sprites.find { |s| s.leds_battler == self }
end
alias ledmgseq_iea item_effect_apply
def item_effect_apply(user, item, effect)
ledmgseq_iea(user, item, effect) if item.leds_effects?
#- Fix: Yea's BE pops a "NULL"
@result.clear if $imported["YEA-BattleEngine"]
end
alias ledmgseq_iue item_user_effect
def item_user_effect(user, item)
ledmgseq_iue(user, item) if item.leds_effects?
#- Fix: Yea's BE pops a "NULL"
@result.clear if $imported["YEA-BattleEngine"]
end
alias ledmgseq_item_hit item_hit
def item_hit(user,item)
return 1 if item.leds_nvmiss?
ledmgseq_item_hit(user,item)
end
alias ledmgseq_item_eva item_eva
def item_eva(user,item)
return 0 if item.leds_nvmiss?
ledmgseq_item_eva(user,item)
end
alias ledmgseq_item_cri item_cri
def item_cri(user,item)
return 0 unless item.leds_crit?
ledmgseq_item_cri(user,item)
end
end
class Game_Actor
alias ledmgseq_pde perform_damage_effect
def perform_damage_effect
ledmgseq_pde
return unless @under_leds
return if Lecode::DamageSequence::Allow_Blink_Effects
@sprite_effect_type = nil
end
end
class Game_Enemy
alias ledmgseq_pde perform_damage_effect
def perform_damage_effect
ledmgseq_pde
return unless @under_leds
return if Lecode::DamageSequence::Allow_Blink_Effects
@sprite_effect_type = nil
end
end
class Sprite_Battler
attr_accessor :leds_battler
attr_reader :leds_data
alias ledmgseq_initialize initialize
def initialize(*args)
ledmgseq_initialize(*args)
@leds_data = {}
@leds_battler = nil
return if @battler.nil?
@leds_battler = @battler
end
def set_leds_data(data)
@leds_data = data
end
def reset_leds_data
@leds_data.clear
end
alias ledmgseq_update_animation update_animation
def update_animation
ledmgseq_update_animation
return unless animation?
if @ani_duration % @ani_rate == 0
if @ani_duration > 0
#- Call damage for each frame
call_ledmg_sequence
end
end
end
def call_ledmg_sequence
frame_index = @animation.frame_max
frame_index -= (@ani_duration + @ani_rate - 1) / @ani_rate
#- call damage sequence
unless cant_call_ledmg_sequence?
user = @leds_data[:user]
item = @leds_data[:item]
scene = SceneManager.scene
scene.execute_ledmg_sequence(@leds_battler,user,item,frame_index)
end
end
def cant_call_ledmg_sequence?
return true if @leds_data.empty?
return true if @leds_battler.nil?
return true unless SceneManager.scene_is?(Scene_Battle)
return false
end
end
class Game_Temp
attr_accessor :leds_from_default_method
alias ledmgseq_initialize initialize
def initialize
@leds_from_default_method = false
ledmgseq_initialize
end
end
class Spriteset_Battle
attr_reader :actor_sprites
attr_reader :enemy_sprites
def leds_update_actor_sprites
$game_party.battle_members.each_with_index { |m,i|
sprite = @actor_sprites[i]
next if sprite.nil?
sprite.leds_battler = m
}
end
end
module DataManager
class <<self; alias ledmgseq_load_database load_database; end
def self.load_database
ledmgseq_load_database
($data_skills+$data_items).each { |obj|
next if obj.nil?
obj.leds_initialize
}
end
end # DataManager
end
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadLicense / Terms Note
# Terms of Use #------------------------------------------------------------------------------ # Credits to Lecode # Free for non-commercial projects
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...