Sideview Battlers in MZ sometimes do not perform a victory pose after a battle.

Greetings,

I am having an issue related to the battle scene, and it is a very strange one. I've been unable to locate any past discussions on this topic and after several hours of testing and scouring JavaScript I realize I am stumped, so I thought I might post here to see if anyone else has ever encountered this bug.

When playtesting or playing a deployed version of a project I am working on, occasionally after a victorious battle, a specific character will not display her victory pose. Instead, she just continues standing there in her idle stance. This only every happens with this one character. Also, there is a slight screen flash/glitch when this bug occurs.

I am unable to consistently replicate this bug so I cannot pinpoint exactly what is causing it. I am, however, inconsistently able to get this bug to occur when she slays the final enemy in a battle encounter. This is one thing the bug has in common in all appearances: the victory pose bug will only occur if the specific character deals the final attack that ends the encounter.

As for plugins, I am using about two dozen overall, but for the sake of expediency, I can say only 3 have anything to do with the battle scene: Visustella Core Engine, Visustella Battle Core, and a very simple plugin I wrote myself that eliminates the whitening flash effect on enemy battlers.

So, has anyone out there ever ran into this bug before in a project they were working on? Or does anyone have some advice that may assist in fixing this issue? Any help would be greatly appreciated.

Thank you in advance,
-Niniann

Edit: My running theory at the moment is that MZ is failing to load this character's victory pose animation, which is related to the screen tear/glitch that occurs when this bug happens. I think perhaps that this problem could be solved if I add in some time for the game to process whatever it's doing, and then load and display the victory pose animations.

Can anyone point me in the right direction to implementing this wait time? I've tried adding in a this.wait within a couple functions via a new plugin but this always results in a crash due to "this.wait is not a function"

An example of what I've tried:

-New plugin with the following code-

JavaScript:

Game_Actor.prototype.performVictory = function() {
this.setActionState("done");
this.wait(60)
this.requestMotion("victory");
};

Result: Crash after a battle with the game displaying "this.wait is not a function"
Edit: My running theory at the moment is that MZ is failing to load this character's victory pose animation, which is related to the screen tear/glitch that occurs when this bug happens. I think perhaps that this problem could be solved if I add in some time for the game to process whatever it's doing, and then load and display the victory pose animations.
I would submit that's not a great plan, because you need to figure out what's actually causing the issue. Otherwise, it could be creating other problems that aren't immediately visible.

Just accommodating it with a workaround means there's still something wrong in your project.

Does it happen with the VisuStella plugins turned off? Are you using Action Sequences for your skills, so there's the possibility of something incorrectly programmed in one of those?

Result: Crash after a battle with the game displaying "this.wait is not a function"
Correct, the Game_Actor class does not have a wait() method.
ATT_Turan,

Thank you for the reply. Well, I *think* what's causing it is something related to the game needing more time to process, but you're exactly right that I'd be taking action before figuring out for sure what the issue is, and may just be putting a band-aid over a serious wound. Which is a bad plan indeed.

That being said, I can't reply on if the bug still occurs with the Visustella plugins turned off. I will test that immediately though. As an aside, I have tried testing the issue on a brand new project with only the visustella core and battle core, and I cannot get the bug to appear.

It may take a little time for me definitively say whether or not the bug is gone with visustella turned off as I'm not able to reliably reproduce the bug. But I will get to testing that now.

Edit: Forgot to mention that this bug can appear through the use of various skills, I've seen it with several, including the Attack command. There is nothing custom created in regards to the action sequences for all of her skills, particularly Attack, I'm simply using the default that comes shipped with the core/battle engine there.
Well, I *think* what's causing it is something related to the game needing more time to process
And that's possible, but you want to figure out what is causing that processing time - it's not a problem in MZ by default.

And, honestly, it doesn't sound like it to me...especially since it's a specific battler under specific circumstances, that doesn't sound like anything to do with needing time to process something. That signifies to me that the battler is left in some kind of unexpected/erroneous condition.

That's why I asked about Action Sequences.
ATT_Turan,

Apologies, forgot to include my response to the Action Sequences question in my rush to go test the game without the battle core/core engine, lol. In case you didn't see the edit, here is what I posted:

Forgot to mention that this bug can appear through the use of various skills, I've seen it with several, including the Attack command. There is nothing custom created in regards to the action sequences for all of her skills, particularly Attack, I'm simply using the default that comes shipped with the core/battle engine there.

Edit: Currently testing the game without the core engine/battle core, and every battle the first time I encounter a monster ID, the hue is incorrect, and when I select the enemy as a target, it immediately switches to the default hue for that monster picture in the img/sv_battlers folder. The next time I encounter that troop on the map, the hues are correctly set for the monster ID in question.

Really weird, not sure if it's related to my original issue, but this never happens with the core engine/battle core on.

So far I've been unable to replicate the victory pose bug with core/battle core turned off.

Edit2: I was unable to reproduce the bug in about 20 minutes of fighting battles with the battle core turned off. I did however notice something else with the battle core turned back on.

After a few battles with the battle core on, before the no pose bug happened, the battler started to "stutter step" after every battle in the moment right before the victory pose, like the battler was starting to reposition extremely slightly or adjust or something. This happened for 3 or 4 battles, then the screen tear/no victory pose bug occurred in a battle, and after that the stutter step no longer happens, and the battler does a victory pose normally. I do not know how to reproduce this effect but am working on figuring that out, but it may perhaps be a lead up to the no pose bug, and the no pose bug "resets" the battler so that she functions normally for a time after this.

Edit 3: Alright so I've figured out the issue. It is apparently caused by an item within the game that gives +100% resist to the poison status effect. I had it equipped on the one battler the entire time. After switching the item to a different character, the bug is gone from the 1st battler, and now present on the battler with the item. Whenever an enemy that can inflict poison successfully *would* inflict the state on a battler that always resists the state, it would cause the character to glitch out, causing screen tearing and making them unable to do their victory pose on battle end.

As far as I can tell, this is a bug with Visustella's Battle Core. I'll be sending them a bug report sometime soon.

Thank you for your help @ATT_Turan , your ideas here gave me some insight on things to check into. Scoured everything possible that might cause the issue and after about 200 battles, the issue is "solved", lol. In the meantime, I'll just have not create items that give 100% state resists until the bug is fixed.

Original thread: https://forums.rpgmakerweb.com/threads/sideview-battlers-in-mz-sometimes-do-not-perform-a-victory-pose-after-a-battle.161664/