I'm working with Yami's Battle Symphony and Yanfly's Battle Engine Ace, and I ran into a small problem.
Before you groan and skip this message because you think it's too involved:
1) My question really doesn't have a lot to do with Yami's or Yanfly's scripts, it's more of a general scripting question.
2) I know what the problem is, and I know what needs to be done to fix it. (I'm a programmer in real life, and I've been tinkering with scripting.) I'm just not sure why my "patch" is not working. It's probably something really simple I've overlooked. Or perhaps, I'm misunderstanding something about RGSS3.
First, I need to give some specifics to help you understand the problem I'm trying to solve.
Using Yami's tags (see below) in the skill notes box, I want my skill to calculate the miss/evade flags, and only show the "hit" animation on the target battler if a hit does in fact occur. Yami's tags allow me to separate the miss/evade and damage calculations, so that's good. When the miss/evade evaluation is performed, I can apply a hit state, and then I can determine if a hit actually occurs or not. It all works, except a weird "NULL" popup message is displayed right before the actual damage is shown. Here are my symphony tags on my skill:
<setup action>move user: forward, waitstance: user, forwardmove user: target, foot, wait</setup action><target action>animation 114: targetstance: user, attackwait: 15skill effect: effect, calcif target.state?(48)stance: target, struckanimation 23: target, waitskill effect: dmgremove state 48: targetendwait: 10</target action><finish action>stance: user, retreatmove user: origin, waitstance: user, idle</finish action>So the "skill effect: effect, calc" line causes a NULL popup to appear, even though no damage has been calculated yet. I traced the NULL popup to Yanfly's Battle Engine Ace script. In the Game_BattlerBase class, he defines a make_miss_popups method that has this code:
def make_miss_popups(user, item) return if dead? if @result.missed text = YEA::BATTLE:
OPUP_SETTINGS[:missed] rules = "DEFAULT" create_popup(text, rules) end if @result.evaded text = YEA::BATTLE:
OPUP_SETTINGS[:evaded] rules = "DEFAULT" create_popup(text, rules) end if @result.hit? && !@result.success text = YEA::BATTLE:
OPUP_SETTINGS[:failed] rules = "DEFAULT" create_popup(text, rules) end if @result.hit? && item.damage.to_hp? if @result.hp_damage == 0 && @result.hp_damage == 0 text = YEA::BATTLE:
OPUP_SETTINGS[:nulled] rules = "DEFAULT" create_popup(text, rules) end endendThe problem with this code is the final if block. In the case of Yami's Battle Symphony, this method is called when the miss/evade flags are computed, and no damage has been calculated yet. So result.hp_damage is 0, which causes it to display the popup. This method needs another check to see if damage has in fact been calculated, and if not, skip the popup. (a case that probably only occurs with Yami's Battle Symphony)
Fortunately, Yami's script adds this very thing (a dmg attribute) to the Game_ActionResult class.
So, I thought I would write a simple patch to override Yanfly's make_miss_popups method and add this check. The problem is, it isn't working. Yanfly's script still uses the original code. It doesn't appear to be calling my new method. I thought by redefining this method, Yanfly's script would call my new method instead of the original one. What am I doing wrong in my patch? Here's the code for my patch script:
class Game_BattlerBase # Override this method that Yanfly added. I keep most of the code intact, but add the extra check at the end. def make_miss_popups(user, item) return if dead? if @result.missed text = YEA::BATTLE:
OPUP_SETTINGS[:missed] rules = "DEFAULT" create_popup(text, rules) end if @result.evaded text = YEA::BATTLE:
OPUP_SETTINGS[:evaded] rules = "DEFAULT" create_popup(text, rules) end if @result.hit? && !@result.success text = YEA::BATTLE:
OPUP_SETTINGS[:failed] rules = "DEFAULT" create_popup(text, rules) end # This adds the result.dmg? check to see if damage has been # calculated. If it hasn't, it skips the NULL popup. if @result.hit? && item.damage.to_hp? && @result.dmg? if @result.hp_damage == 0 && @result.hp_damage == 0 text = YEA::BATTLE:
OPUP_SETTINGS[:nulled] rules = "DEFAULT" create_popup(text, rules) end end end end # Game_BattlerBaseThe order of scripts in my project is:
Yanfly's Battle Engine Ace
Yami's Battle Symphony
Yami Skill Effect Tags
Yami Holder Battler Add-on
My patch
Here are the links to the scripts I'm using:
https://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/
https://github.com/suppayami/rmvxa-collection/blob/master/battle-symphony/battle-symphony-116c.rb
https://github.com/suppayami/rmvxa-collection/tree/master/battle-symphony/add-on
Anyone know why it is still using the original code in Yanfly's script instead of my overridden method?
Before you groan and skip this message because you think it's too involved:
1) My question really doesn't have a lot to do with Yami's or Yanfly's scripts, it's more of a general scripting question.
2) I know what the problem is, and I know what needs to be done to fix it. (I'm a programmer in real life, and I've been tinkering with scripting.) I'm just not sure why my "patch" is not working. It's probably something really simple I've overlooked. Or perhaps, I'm misunderstanding something about RGSS3.
First, I need to give some specifics to help you understand the problem I'm trying to solve.
Using Yami's tags (see below) in the skill notes box, I want my skill to calculate the miss/evade flags, and only show the "hit" animation on the target battler if a hit does in fact occur. Yami's tags allow me to separate the miss/evade and damage calculations, so that's good. When the miss/evade evaluation is performed, I can apply a hit state, and then I can determine if a hit actually occurs or not. It all works, except a weird "NULL" popup message is displayed right before the actual damage is shown. Here are my symphony tags on my skill:
<setup action>move user: forward, waitstance: user, forwardmove user: target, foot, wait</setup action><target action>animation 114: targetstance: user, attackwait: 15skill effect: effect, calcif target.state?(48)stance: target, struckanimation 23: target, waitskill effect: dmgremove state 48: targetendwait: 10</target action><finish action>stance: user, retreatmove user: origin, waitstance: user, idle</finish action>So the "skill effect: effect, calc" line causes a NULL popup to appear, even though no damage has been calculated yet. I traced the NULL popup to Yanfly's Battle Engine Ace script. In the Game_BattlerBase class, he defines a make_miss_popups method that has this code:
def make_miss_popups(user, item) return if dead? if @result.missed text = YEA::BATTLE:
Fortunately, Yami's script adds this very thing (a dmg attribute) to the Game_ActionResult class.
So, I thought I would write a simple patch to override Yanfly's make_miss_popups method and add this check. The problem is, it isn't working. Yanfly's script still uses the original code. It doesn't appear to be calling my new method. I thought by redefining this method, Yanfly's script would call my new method instead of the original one. What am I doing wrong in my patch? Here's the code for my patch script:
class Game_BattlerBase # Override this method that Yanfly added. I keep most of the code intact, but add the extra check at the end. def make_miss_popups(user, item) return if dead? if @result.missed text = YEA::BATTLE:
Yanfly's Battle Engine Ace
Yami's Battle Symphony
Yami Skill Effect Tags
Yami Holder Battler Add-on
My patch
Here are the links to the scripts I'm using:
https://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/
https://github.com/suppayami/rmvxa-collection/blob/master/battle-symphony/battle-symphony-116c.rb
https://github.com/suppayami/rmvxa-collection/tree/master/battle-symphony/add-on
Anyone know why it is still using the original code in Yanfly's script instead of my overridden method?
Last edited by a moderator:

