Hide 0 Damage Pop Ups in Sideview

I've tried googling this and came up short, so I decided to go ahead and ask about it here.

All I want is simply put, a small plugin that causes attacks that deal 0 damage to not show any graphic in sideview battles.

I... think that's all there is to it.
Are you using the default battle system?
Are you using the default battle system?

In the game I am making, no. I'm using Yanfly scripts.
However I have in fact tried a skill with 0 damage using the default battle system and a completely plugin free project, so I do know that this a thing that happens in the default battle system.
I haven't tested this, so no idea if it works or not, and especially no idea of how custom plugins might affect it.  But give it a go ...


//=================================================================================================
// Hide0Damage.js
//=================================================================================================

/*:
* @plugindesc Stops display of 0 damage
* @author Shaz
*
* @help This plugin does not provide plugin commands.
*/

(function() {
var _Sprite_Damage_setup = Sprite_Damage.prototype.setup;
Sprite_Damage.prototype.setup = function(target) {
var result = target.result();
if (!result.hpAffected || result.hpDamage !== 0 || result.missed || result.evaded) {
_Sprite_Damage_setup.call(this, target);
}
};
})();




File name doesn't matter.  I suggest you put it somewhere near the bottom of the plugin list.


Let me know how it goes.


edit: added extra checks for miss and evasion
Alright so I installed it and tested it out on both my own project and my test project.

it worked perfectly in the test project with no plugins.

However, it did not work in the project I am working on...
But after going into Yanfly's Battle Core and commenting out the "Sprite_Damage" Section, It did work.

So thank you.
I would be concerned that commenting out that section of Yanfly's script will cause other problems.  You need to find out why it didn't work, and make the two scripts compatible.


Get rid of my plugin, and change Yanfly's plugin.  Line 8079 is this:


} else if (result.hpAffected) {


Change it to this:

Code:
} else if (result.hpAffected && result.hpDamage !== 0) {
I would be concerned that commenting out that section of Yanfly's script will cause other problems.  You need to find out why it didn't work, and make the two scripts compatible.


Get rid of my plugin, and change Yanfly's plugin.  Line 8079 is this:



} else if (result.hpAffected) {


Change it to this:



} else if (result.hpAffected && result.hpDamage !== 0) {

That works completely fine as well.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/hide-0-damage-pop-ups-in-sideview.67682/