Tweaking the Damage Pop-Ups in Yanfly Ace Battle Engine

I'm using Yanfly's Ace Battle Engine https://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/

In my game, most skills do both HP and MP damage.  I am trying to create a small tweak to the way that the damage pop-ups work.  

Basically I would like the positions of the HP damage pop-up and MP damage pop-up to be reversed.   Currently, the MP damage pop-up occurs right on top of the HP damage pop-up; I would like the MP damage pop-up to be the one underneath the HP damage pop-up.

Attached is a screenshot of an example:   the player took 0 HP damage and -1 MP damage.  I want the "0" to be where the "-1" is, and vice versa, so that it matches the HUD (of HP being on top and MP being underneath).

Any help would be very much appreciated, thanks.

popupexample.jpg
The default order is to have HP then MP in the battle engine. However, from what I can see, the problem is because you did 0 damage, which, by default does not display 0 but NULL. What you need to do is swap the order of the pop_ups for NULL and damage, which should just require switching these two sets of lines.

if @result.hit? && [email protected] text = YEA::BATTLE:😛OPUP_SETTINGS[:failed] rules = "DEFAULT" create_popup(text, rules) end#Move these lines above the line above this comment. 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 endThis should fix it so that NULL goes before damage, which would then get you your 0 then -1 pop-up.

Also check it when both do damage. In the default it does set the HP then the MP pop-up in that order, so it should work that way when you have both doing damage.
Hey, sorry I am a little confused...the reason it says "0" is because I changed the setting for Null attacks to simply say "0" instead of Null.   Why would changing the text affect the position of the pop-up?

To be clear, I want the HP damage (regardless of whether it's 0/null/13 damage/etc.) to always be on top, and the MP damage (regardless of whether it's 0/null/13 damage/etc.) to always be on the bottom.
The reason you have to change it is the way I understand it, you changed the display of the NULL to show 0. However, the system still treats it as NULL, and the NULL pop-up is last (or in your case, the pop-up of 0 HP).

Test it with actual damage though to be sure. If it works normally when HP damage is not zero, then the problem is because the system is treating 0 as NULL, and you *have* to move when the NULL pop-up is displayed to fix that. However, if it is still out of order when you do HP damage that is not 0, then there is another issue.
Ah, you're right; if it's not 0 damage, then it works correctly.

I did what you suggested, but the 0 is still showing underneath.  I wonder if I did not understand your instructions...I put the second block of code you referenced above the first block?

-Edit- Nevermind, I figured out you meant above the "end" line...seems like it's working! Even better than I envisioned, since now it doesn't even show anything for 0 damage, which I think is preferable.

Thank you so, so much!
Glad it is working! Though I'm surprised by the nothing for 0, but hey, if you like that better, keep it.
if @result.hit? && [email protected] text = YEA::BATTLE:😛OPUP_SETTINGS[:failed] rules = "DEFAULT" create_popup(text, rules) 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 end endYeah, so there is a small problem. 🙂

Even though I like the 0 not being there when one of them is null, unfortunately when both are 0 now, nothing shows up at all.

So I want to bring back displaying the 0, but not have it show up in the wrong position.  Any ideas?
I think your first if is missing an end. Delete one of the ends at the end of the code snippet and put one after the first if (but before the second).
Thanks!  Ok, so it's not perfect, but close enough I think.   What happens now is:

-if there is HP dmg and MP dmg, both pop up and in the correct order (good)

-if there is only HP damage, only HP dmg pops up (good)

-if there is neither HP nor MP damage, the null / 0 pops up (good)

-if there is only MP damage, then both MP dmg and the null / 0 pops up, and in the wrong order (bad)

This last case is the only thing that is visually inconsistent with what I'm going for, but it's a relatively minor issue.  If you can think of how to fix this in an easy way that'd be awesome, but don't go crazy if it's difficult. 🙂   I truly appreciate all your help.
I did notice something funny. You see, it turns out all we did was swap the order of the failed and the missed steps, which should have done nothing. See, I misread it and thought that line was for damage (That's what I get for doing this quickly on breaks at work).

I'm now stumped I'm afraid. I know there is a way to swap the order of the pop-ups, but I'm not seeing it. I'll keep looking, but I'll be at work most of the day today and tomorrows my 14 hour day at work, so it will be a while.

Maybe another poster will have some luck with that last one?

Original thread: https://forums.rpgmakerweb.com/threads/tweaking-the-damage-pop-ups-in-yanfly-ace-battle-engine.38666/