Hello people! I was having a problem with a plugin but I finally solved it changing it location.
I'm also using Yanfly Battle Core Script, now the problem is that this script work fines, except that in combination with the yanfly battle core is doing something weird.
The script is supposed to save the damage taken into a variable, now, for some reason, when I use this script and receive damage, the damage is substracted without a problem, BUT the pop-up always show the damage as 0, even if it clearly did 53 damage.
This is the script:
Now, if I paste this script under the Battle Core, it doesn't save the damage into the variables. If I post it OVER the Battle core, it does store them, but the damage is always shown as 0. Is some way of fixing this? I'm not sure what this script could be interfering with the battle core to show the damage as 0.
I'm also using Yanfly Battle Core Script, now the problem is that this script work fines, except that in combination with the yanfly battle core is doing something weird.
The script is supposed to save the damage taken into a variable, now, for some reason, when I use this script and receive damage, the damage is substracted without a problem, BUT the pop-up always show the damage as 0, even if it clearly did 53 damage.
This is the script:
Ruby:
ActorDamageIDStart = 100
class Game_Battler < Game_BattlerBase
# Make these available to be read by anyone (and set too just in case)
attr_accessor :hp_damage_last, :hp_damage_turn, :hp_damage_battle
alias :initialize_remember_damage :initialize unless $@
def initialize(*args)
initialize_remember_damage(*args)
# Set our last damage taken arguments to zero
@hp_damage_last = @hp_damage_turn = @hp_damage_battle = 0
end
# When the battler takes damage remember that HP damage
alias :execute_damage_remember_damage :execute_damage unless $@
def execute_damage(user)
# Call the original method
execute_damage_remember_damage(user)
# We want to record damage only, not healing
return if @result.hp_damage <= 0
# Remember this actor's last damage taken, override last value
@hp_damage_last = @result.hp_damage
# Add to the cumulative turn damage here
@hp_damage_turn += @result.hp_damage
# And add to the battle cumulative damage here
@hp_damage_battle += @result.hp_damage
end
end
class Game_Actor < Game_Battler
alias :execute_damage_remember_damage_actor :execute_damage unless $@
def execute_damage(user)
# Call the original method so hp damage is applied correctly
execute_damage_remember_damage_actor(user)
# We want to record damage only, not healing
return if @result.hp_damage <= 0
# We want to remember the damage taken in variables too, do so here
index = @actor_id + ActorDamageIDStart
# Remember this actor's last damage taken, override last value
$game_variables[index + 0] = @hp_damage_last
# Add to the cumulative turn damage here
$game_variables[index + 100] = @hp_damage_turn
# And add to the battle cumulative damage here
$game_variables[index + 200] = @hp_damage_battle
end
end
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * Battle Start
#--------------------------------------------------------------------------
alias :battle_start_remember_damage :battle_start unless $@
def battle_start
# Call the original method
battle_start_remember_damage
# And wipe everybody's battle-scope damage
$game_party.members.each { |member| member.hp_damage_battle = 0 }
$game_troop.members.each { |member| member.hp_damage_battle = 0 }
end
#--------------------------------------------------------------------------
# * Start Turn
#--------------------------------------------------------------------------
alias :turn_start_remember_damage :turn_start unless $@
def turn_start
# Call the original method
turn_start_remember_damage
# And wipe everybody's turn-scope damage
$game_party.members.each { |member| member.hp_damage_turn = 0 }
$game_troop.members.each { |member| member.hp_damage_turn = 0 }
end
end
Now, if I paste this script under the Battle Core, it doesn't save the damage into the variables. If I post it OVER the Battle core, it does store them, but the damage is always shown as 0. Is some way of fixing this? I'm not sure what this script could be interfering with the battle core to show the damage as 0.