RMMV [RESOLVED] Yanfly Battle Core and State Importance

Status
Not open for further replies.

BreakerZero

Veteran
Veteran
Joined
Jul 8, 2018
Messages
993
Reaction score
425
First Language
English (USA)
Primarily Uses
RMMV
When using the Yanfly battle core I have every state other than knockouts being displayed in the battle log. For example, if poison is induced it shows the poison text and not the knockout text. The only exception is when a state induces a knockout at the end of a turn (e.g. poison, curse etc.) Is there any way to fix this?
 
Last edited:

BreakerZero

Veteran
Veteran
Joined
Jul 8, 2018
Messages
993
Reaction score
425
First Language
English (USA)
Primarily Uses
RMMV
Okay, so I've found the most logical place to put it... but it is having some rather unanticipated side effects. Specifically, it works a bit too well - plus it breaks the animated sideview extension.

Here's the code in question (with generic placeholders due to Yanfly's license change):

Code:
ext.battle.Window_BattleLog_displayActionResults =
    Window_BattleLog.prototype.displayActionResults;
Window_BattleLog.prototype.displayActionResults = function(subject, target) {
    if (ext.Param.optSpeed) {
      if (target.result().used) {
        this.displayCritical(target);
        this.displayDamage(target);
        this.displayAffectedStatus(target);
        this.displayFailure(target);
      }
    } else {
      ext.battle.Window_BattleLog_displayActionResults.call(this, subject,
          target);
    }
    if (target.isDead()) {
        target.performCollapse();
          if (target.isEnemy()) {
              this.push('addText', 'Defeated ' + target.name() + '!');
          } else {
              this.push('addText', target.name() + ' was knocked out!');
          }
    }
};

This is as close as I have managed to get due to the plugin design, so any ideas on where to put the enemy/actor check for the purpose of this workaround would be appreciated.
 
Last edited:

BreakerZero

Veteran
Veteran
Joined
Jul 8, 2018
Messages
993
Reaction score
425
First Language
English (USA)
Primarily Uses
RMMV
Well, I finally figured it out. It ended up being in an entirely different location than I had anticipated, but by changing the displayHpDamage function I was able to get the desired effect and have an actual report for the KO without regard for end of turn catch-up. Here's the updated function as it is defined in rpg_windows.js:

JavaScript:
Window_BattleLog.prototype.displayHpDamage = function(target) {
    if (target.result().hpAffected) {
        if (target.result().hpDamage > 0 && !target.result().drain) {
            this.push('performDamage', target);
        }
        if (target.result().hpDamage < 0) {
            this.push('performRecovery', target);
        }
        this.push('addText', this.makeHpDamageText(target));
        if (target.hp <= 0) {
            if (target.isActor()) {
                this.push('addText', target.name() + ' was knocked out!');
            } else {
                this.push('addText', 'Defeated ' + target.name() + '!');
            }
        }
    }
};

All that's left is to update all of my builds to reflect this and the fix will be in.

EDIT: And it's done. With that the case is closed.
 
Last edited:

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,389
Reaction score
5,543
First Language
Dutch
Primarily Uses
RMXP

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.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

A side story is almost getting into the next stage. Almost everything in this game has real-life references.
unfinishedbuildingwip1.jpg
Everyday life is full of absurdity. This is just a reflection.
TFW you discover how the script batching works in VNMaker... after you've had the program for almost 3 years.
hAx6iQ3.gif

Writes that the characters have to climb a mountain.

Realized that I have to draw six sets of models where characters are climbing.

At least I know how to draw something. :)
I'm currently scratching my head on how to design plains. What do I even put in plains? Some trees (but not too many or it turns into a forest)? Grass? A few bushes? That's a bit dull.
I'm looking for tutorials but Google didn't seem to find much (or maybe I have the wrong keywords). I don't know how to map plains and I don't know how to learn.

Forum statistics

Threads
111,403
Messages
1,060,873
Members
144,751
Latest member
Louarn
Top