Critical hit - screen flash

I would like to know how to make it so when an actor/enemy
does a critical hit, the screen flashes instead of flash effect
on the damage popup.
Hello, I made a Plugin that does just that: TSR_TP_Popup.js
@TSR
Thank you for your plugin.
Is there a way to only use the flash screen effect on criticals with your script.
Because as far as i know the only way to have it is to 'Enable Damage Sheet',
and I already have my damage popup sprites/popup animation
with another plugin.
Hello again. You can call the critical effect function externally using:
Code:
Sprite_Damage.prototype.setupCriticalEffect();
You need to turn OFF the Show Critical popup in the Plugin parameter if you don't use my Sprite sheet, but calling that function will show the screen effect, and you can customize it with the Plugin parameters.
Hi TSR
I'm not very used to customize plugins.
So where would I copy that line Sprite_Damage.prototype.setupCriticalEffect();
Would it be in rpg_sprites.js or rpg_objects.js, I know there are several lines
with mentions of critical hits in these files. But under which line of text should I copy it?
Thank you for taking the time to help me out!!
Hello. Don't modify the core js files, edit my Plugin instead.
Search for this in the file:
Code:
if (result.hpAffected) {
         this.createDigits(0, result.hpDamage);
         if (TSR.Param.EnableDamageSheet) {   
           if (critical && TSR.Param.ShowCritical) {
             this.setupCriticalEffect();
             this.createCritical(target);
           }
And put the function outside the condition for Enable Sprite sheet, like this:
Code:
if (result.hpAffected) {
         this.createDigits(0, result.hpDamage);
         if (critical) this.setupCriticalEffect(); \\added this line
         if (TSR.Param.EnableDamageSheet) {   
           if (critical && TSR.Param.ShowCritical) {
             this.setupCriticalEffect();
             this.createCritical(target);
           }
The tricky part is this appear twice in the Plugin for working with or without Yanfly BattleEngine core. So you'll have to change the good part or change both to be sure.
Hi again
It works perfectly now.
Thanks a lot for replying fast and helping me out!

Original thread: https://forums.rpgmakerweb.com/threads/critical-hit-screen-flash.120104/