Battle Error

Hello,
I'm experiencing an error during battles and I'm not sure how to resolve it.
Essentially, after selecting the commands for each character (and the battle should start), this error occurs. - Can you help me out?

YEP_CoreEngine.js:1098 TypeError: Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.
at Bitmap.gradientFillRect (rpg_core.js:1289)
at Bitmap.gradientFillRect (YEP_CoreEngine.js:1014)
at Window_BattleStatus.Window_Base.drawGauge (YEP_CoreEngine.js:2418)
at Window_BattleStatus.Window_Base.drawActorHp (rpg_windows.js:555)
at Window_BattleStatus.drawGaugeAreaWithoutTp (YEP_CoreEngine.js:2749)
at Window_BattleStatus.drawGaugeArea (rpg_windows.js:5525)
at Window_BattleStatus.drawItem (rpg_windows.js:5496)
at Window_BattleStatus.processStatusRefresh (YEP_BattleEngineCore.js:5318)
at Window_BattleStatus.updateStatusRequests (YEP_BattleEngineCore.js:5309)
at Scene_Battle.updateStatusWindowRequests (YEP_BattleEngineCore.js:4557)
Which actions are causing this error message ? Attack only or does it include guard, item use, or skills? In addition, it would be good to upload a screenshot of the plugin list.
The most common cause for such errors are plugins in the wrong order, a second possibility is incompatible plugins - both cases can usually be identified by the full plugin list from the plugin manager.
However in some rare cases it can also be a windows error, for example if an update replaced the display driver with a MS one, or a few other things.
Plugin list - (is it too many?)

Schermata 2023-05-29 alle 11.44.55.png
Schermata 2023-05-29 alle 11.45.10.png
Schermata 2023-05-29 alle 11.45.14.png




Apologies, I don't speak English very well, and I may not have explained myself properly. Let me rephrase the sentence:

The battle starts without any issues.
Actor 1 chooses an action (in my case, only Skills, Item, and Escape are available thanks to the Aesica AES_CommandControl plugin), selecting either Skills or Item and then deciding on the specific skill or item to use. The game functions normally at this point. Then, it moves on to Actor 2 and so on.
However, when I give the final confirmation for Actor 4, the mentioned error occurs.

If the Escape key is pressed, there are no problems, which leads me to think that the error, although I'm unsure of its nature, is related to the battle.
Then the error has most likely nothing to do with the actors or the skills, but with the Battle initialisation or UI after that.

What are the whited-out plugins in your third picture?
can you go to your project js directory and use notepad to open rpg_core.js, then tell us the version number at the end of the title line?

Does the error happen on battletest, on new game with new fight and/or after loading a savefile to fight?
Have you confirmed if a certain skill is causing the problem? It could be due to an error in the damage formula or targeting.
Then the error has most likely nothing to do with the actors or the skills, but with the Battle initialisation or UI after that.

What are the whited-out plugins in your third picture?
can you go to your project js directory and use notepad to open rpg_core.js, then tell us the version number at the end of the title line?

Does the error happen on battletest, on new game with new fight and/or after loading a savefile to fight?
The whited-out plugins are unknown, I made them with ChatGPT.
They are used for small tasks, none of which have anything to do with battle.

Here: rpg_core.js v1.6.2

I have tried both starting a new game and loading a saved file, and the error remains the same.
I just used the battle test and a different error appeared... sigh:

YEP_CoreEngine.js:1098 TypeError: Cannot read property 'width' of null
at Game_Map.width (rpg_objects.js:5663)
at Game_Map.isValid (rpg_objects.js:5908)
at Game_Map.regionId (rpg_objects.js:6006)
at Game_Player.Game_CharacterBase.regionId (rpg_objects.js:6637)
at Game_Screen.updateRegionZoom (SRD_AutoCamera.js:2253)
at Game_Screen.updateZoom (SRD_AutoCamera.js:2249)
at Game_Screen.update (rpg_objects.js:803)
at Scene_Battle.update (rpg_scenes.js:2253)
at Scene_Battle.update (YEP_CoreEngine.js:1431)
at Scene_Battle.update (YEP_BattleEngineCore.js:4550)
Have you confirmed if a certain skill is causing the problem? It could be due to an error in the damage formula or targeting.
All skills were working fine before this issue occurred, so I don't think that's the cause.

As Andar mentioned, it seems to be related to the battle initialization. I'm currently working with SRDude's HUD Maker these days to make a customized Battle UI, and the problem started after making these modifications...
The whited-out plugins are unknown, I made them with ChatGPT.
They are used for small tasks, none of which have anything to do with battle.
Please disable them for all tests.
ChatGPT creates a lot of crap programs that sometimes only accidentally work, and due to how it creates those things they can effect anything, not only what they are supposed to do.
Basically with those plugins active bughunting is much more difficult.

I expected battletest to fail - it is known to cause problems with a lot of plugins. The question was more to check where the original error happens than anything else.

can you tell us what your primary display/graphics chip is (name of your display card for example), if you have a secondary chip or not (most modern computers have them) and if the driver for it was programmed by microsoft or by the card manufacturer?
Please disable them for all tests.
ChatGPT creates a lot of crap programs that sometimes only accidentally work, and due to how it creates those things they can effect anything, not only what they are supposed to do.
Basically with those plugins active bughunting is much more difficult.

I expected battletest to fail - it is known to cause problems with a lot of plugins. The question was more to check where the original error happens than anything else.

can you tell us what your primary display/graphics chip is (name of your display card for example), if you have a secondary chip or not (most modern computers have them) and if the driver for it was programmed by microsoft or by the card manufacturer?
I tried disabling all the ChatGPT's plugins, but the error still remains.

As for your last question, I'm quite a noob, ahahah, but I can try:
The chip could be "Intel Iris Pro." Regarding the driver, I'm not sure where to search... I'm using macOS.
The error is because the game has tried to fill a gradient between two points, but one of those points is either:
  • Infinite, e.g. due to a division by zero, or
  • Not a number, e.g. undefined or "123" (string).
Specifically, the traceback implies that the gradient is for an HP gauge in the battle status window, so the invalid input is current HP / max HP. (Unless a plugin has changed that, but that would be strange.)

In case it helps, you can check the HP and max HP values of all party members:
  • Start a play-test or battle-test.
  • Get the game to crash with this error.
  • Open the dev tools window (if it's not already open) by pressing F8.
  • Make sure you are on the Console tab.
  • Copy this into the console and press Enter:

    console.table($gameParty.members().map(m => ({ Name: m.name(), HP: m.hp, "Max HP": m.mhp })));
E.g. I checked this at the start of battle in a new project and saw this:

console.png


The battle starts without any issues.
Actor 1 chooses an action (in my case, only Skills, Item, and Escape are available thanks to the Aesica AES_CommandControl plugin), selecting either Skills or Item and then deciding on the specific skill or item to use. The game functions normally at this point. Then, it moves on to Actor 2 and so on.
However, when I give the final confirmation for Actor 4, the mentioned error occurs.
This sounds like the end of the "input" phase, and/or the start of the "turn" phase. Does the problem happen even if you pick different actions?

You can try turning off all plugins, save your project to apply Plugin Manager changes, then test. If the problem disappears, check any plugin-related tags or script calls you are using. You can also try turning plugins on again in groups, to try to discover which one(s) cause the problem.

I notice you're using YEP Battle Engine Core. Are you using any action sequences?

Also, I notice you have a plugin named "AnimatedSVEnemies" near the bottom of the list. Since you're using YEP Battle Engine Core it may be a better idea to use YEP Animated Sideview Enemies instead?
You can try turning off all plugins, save your project to apply Plugin Manager changes, then test. If the problem disappears, check any plugin-related tags or script calls you are using. You can also try turning plugins on again in groups, to try to discover which one(s) cause the problem.

I notice you're using YEP Battle Engine Core. Are you using any action sequences?

Also, I notice you have a plugin named "AnimatedSVEnemies" near the bottom of the list. Since you're using YEP Battle Engine Core it may be a better idea to use YEP Animated Sideview Enemies instead?
As far as I remember, AnimatedSVEnemies was causing you to get an error message while working with YEP_CoreEngine, so using yanfly plugins together will creates less problems.

1685373855572.png

Schermata 2023-05-29 alle 17.19.20.png


It shows me this. The error occurs even when the leader is alone.

Thank you for your suggestions, I'll try to focus on the gauges I've created,
the problem seems to be there at last.
As far as I remember, AnimatedSVEnemies was causing you to get an error message while working with YEP_CoreEngine, so using yanfly plugins together will creates less problems.

View attachment 263616
Ok, thank you, but the plugin I have now is called "YEP_X_AnimatedSVEnemies" (i removed the other one), do I need to rename it to 2animatedSVEnemies"?
even when the leader is alone.
Is he?
The fact that you get an undefined after the table might point to the existance of an undefined actor in the party.
and that is actually a common mistake if someone deleted actors in the actor database before removing them from the starting party in the system tab (which starts with four actors)

How many actors do you have? If it is less than 4, please add temporary actors and check if their names appear in the startting party tab.

EDIT:
NEVER rename plugin files, that usually breaks them
Ok, thank you, but the plugin I have now is called "YEP_X_AnimatedSVEnemies" (i removed the other one), do I need to rename it to 2animatedSVEnemies"?
1685374862836.png

just turn off this.
1685374918602.png

and use this like that
Is he?
The fact that you get an undefined after the table might point to the existance of an undefined actor in the party.
and that is actually a common mistake if someone deleted actors in the actor database before removing them from the starting party in the system tab (which starts with four actors)

How many actors do you have? If it is less than 4, please add temporary actors and check if their names appear in the startting party tab.

EDIT:
NEVER rename plugin files, that usually breaks them
Schermata 2023-05-29 alle 17.44.36.png


EDIT:

I also tried to disable HUD Maker and the error persist. 🙁

View attachment 263623
just turn off this.
View attachment 263625
and use this like that
That's what I've done, thanks! 👍
Okay guys, I did it! 😀

Thanks a lot to everyone for the help. I probably messed up with the Menu Editor, so I reset everything and it started working again. The error disappeared!

Schermata 2023-05-29 alle 18.17.51.png
...huh. Well, great! Hopefully it stays fixed~ 😮‍💨

Just a note: I checked the code of Rexal's plugin and it is supposed to be named "animatedSVEnemies.js", i.e. lower-case a. Like Andar mentioned, renaming plugin files is usually a bad idea: it breaks their ability to see their own parameters, which will often cause some kind of crash/malfunction. It also makes them harder for others to identify when you ask for help.

Original thread: https://forums.rpgmakerweb.com/threads/battle-error.157900/