Enemy KO Delay

So I have an enemy in my game, where they are a totem pole.
When you defeat enemies on the totem pole lower than the other ones I want the ones above to be defeated as if they'd all tumble. But in practice it's not working.

So if you defeat the very lowest totem on the pole, the others should be K.O'd instantly.

Here is a gif of how its currently working:


My current code for the troop event:


Things I've tried:
-Calling a parallel comment event,
-Changing the span to moment,
-Changing applying states to applying HP damage that allow knockout.
-Changing conditions to under HP, Don't Run, Turn 0 etc.

The problem I'm having as you can see from the first link, is the enemies attack before the K.O state is applied.

Any help would be appreciated.

Thanks.
The activation condition for your troop event is "don't run" so it won't run. HP 0% on "moment" *should* work.
The activation condition for your troop event is "don't run" so it won't run. HP 0% on "moment" *should* work.

I have tried this, the game stalls when this happens the game 'stalls' on this screen:



Music still plays, the screen still animates, but the battle pauses at this stage, nothing will run.
Try installing this as a plugin:
JavaScript:
_Game_Enemy_performCollapse = Game_Enemy.prototype.performCollapse;
Game_Enemy.prototype.performCollapse = function() {
    _Game_Enemy_performCollapse.apply(this);
    var enemyId = 1;
    if (this._enemyId === enemyId) {
        for (var member of $gameTroop.aliveMembers()) {
            member.addState(1);
            member.performCollapse();
        }
    }
}

Haven't tested this thoroughly (e.g. with YEP plugins), but it should do what you are describing.

Change "enemyId = 1" to the ID of the enemy in the database that should trigger the KO of the rest of the troop.
Don't have the knockout conditional branch in the event, just add knockout to all enemies.
Try installing this as a plugin:
JavaScript:
_Game_Enemy_performCollapse = Game_Enemy.prototype.performCollapse;
Game_Enemy.prototype.performCollapse = function() {
    _Game_Enemy_performCollapse.apply(this);
    var enemyId = 1;
    if (this._enemyId === enemyId) {
        for (var member of $gameTroop.aliveMembers()) {
            member.addState(1);
            member.performCollapse();
        }
    }
}

Haven't tested this thoroughly (e.g. with YEP plugins), but it should do what you are describing.

Change "enemyId = 1" to the ID of the enemy in the database that should trigger the KO of the rest of the troop.

I really appreciate you going to the effort to make me a plugin but this had the same effects as the aforementioned problem. But still, that's incredibly kind of you to go out of your way.

Don't have the knockout conditional branch in the event, just add knockout to all enemies.
This sort of works. However unless I explicitly tell the game to abort battle after dealing the state damage, it'll 'stall' again with the enemy sitting at 0 health and trying to attack.

This is a passable solution though and I can get around this. So thank you.
I really appreciate you going to the effort to make me a plugin but this had the same effects as the aforementioned problem. But still, that's incredibly kind of you to go out of your way.


This sort of works. However unless I explicitly tell the game to abort battle after dealing the state damage, it'll 'stall' again with the enemy sitting at 0 health and trying to attack.

This is a passable solution though and I can get around this. So thank you.
Did you inflict KO on the entire troop?
Did you inflict KO on the entire troop?

Yes, is this the reason why it'll stall? Must it only be on all troops but the one that had been defeated?
No, I thought maybe you'd done the latter. When I did it in MZ, it worked fine, so I'm not sure what the issue is on your end. This is what I did:

1625246198832.png
Do you think any of the YEP battle plugins would interfere with this?
I really appreciate you going to the effort to make me a plugin but this had the same effects as the aforementioned problem.

The battle should end itself with the plugin (and/or via events too). I'm wondering if there's more of an overarching problem with plugins or something that's causing your battle system to hang instead of ending the battle.

S4kqbes7AO.gif
Do you think any of the YEP battle plugins would interfere with this?
If I had to hazard a guess I'd say Battle Core might be.

Original thread: https://forums.rpgmakerweb.com/threads/enemy-ko-delay.138027/