MZ rpg maker mz argument must be a rectangle

Hey guys, Im getting this error when trying to battle test in MZ. These are my plugins:



The console shows:

rmmz_managers.js:2030 Error: Argument must be a Rectangle
at Window_EnemyVisualSelect.Window_Base.checkRectObject (rmmz_windows.js:42)
at Window_EnemyVisualSelect.Window_Base.initialize (rmmz_windows.js:20)
at Window_EnemyVisualSelect.Window_Base.<computed>.<computed> (VisuMZ_0_CoreEngine.js:8881)
at Window_EnemyVisualSelect.Window_Base.<computed> [as initialize] (VisuMZ_1_MessageCore.js:2521)
at Window_EnemyVisualSelect.initialize (YEP_BattleEngineCore.js:5138)
at new Window_EnemyVisualSelect (YEP_BattleEngineCore.js:5131)
at Sprite_Enemy.createVisualSelectWindow (YEP_BattleEngineCore.js:3239)
at Sprite_Enemy.preSpriteInitialize (YEP_BattleEngineCore.js:3218)
at Sprite_Enemy.Sprite_Battler.initialize (YEP_BattleEngineCore.js:2891)
at Sprite_Enemy.initialize (rmmz_sprites.js:934)

Any idea what I did wrong?
I'm not the best with code but it looks to be indicating that there is an issue with an argument being passed to a function in rmmz_windows.js on line 42.

The argument being passed must be a Rectangle object, but it looks like it's not.
This error message is indicating that there is an issue with the code in the "rmmz_managers.js" file on line 2030. It seems that there is a function or method that expects a Rectangle object as an argument, but instead, it is receiving an invalid argument.

The error message also provides a stack trace that shows the sequence of function calls that led to the error. From the stack trace, it looks like the error occurred during the initialization of a Window object ("Window_EnemyVisualSelect").

You may need to review the code in the "rmmz_managers.js" file, specifically the code around line 2030, to see what might be causing the issue. It's possible that there is an error in the code that creates the Rectangle object, or there might be an issue with how the Rectangle object is being passed as an argument to a function.

Alternatively, if you are using plugins in your RPG Maker MZ project, it's possible that the error is being caused by a plugin conflict. In this case, you may need to disable some of your plugins or reorder them to see if that resolves the issue.

Solution :
  1. Disable all plugins except for the required ones: To determine if a plugin is causing the error, try disabling all of the plugins except for the required ones and see if the error still occurs. If the error goes away, then one of the plugins you disabled is likely the culprit. You can then try enabling the plugins one by one until you find the one causing the error.

Yours lovingly
CHATGPT
You're using YEP plugins, which are for MV. In MV, window constructor functions took x, y, width and height as separate arguments. In MZ, it requires a Rectangle object. If you try to use an MV plugin in MZ, you're trying to stuff four arguments into a function that's expecting a single object containing them. This will result in an error because the engine doesn't know what to do with that.
This error message is indicating that there is an issue with the code in the "rmmz_managers.js" file on line 2030. It seems that there is a function or method that expects a Rectangle object as an argument, but instead, it is receiving an invalid argument.

The error message also provides a stack trace that shows the sequence of function calls that led to the error. From the stack trace, it looks like the error occurred during the initialization of a Window object ("Window_EnemyVisualSelect").

You may need to review the code in the "rmmz_managers.js" file, specifically the code around line 2030, to see what might be causing the issue. It's possible that there is an error in the code that creates the Rectangle object, or there might be an issue with how the Rectangle object is being passed as an argument to a function.

Alternatively, if you are using plugins in your RPG Maker MZ project, it's possible that the error is being caused by a plugin conflict. In this case, you may need to disable some of your plugins or reorder them to see if that resolves the issue.

Solution :
  1. Disable all plugins except for the required ones: To determine if a plugin is causing the error, try disabling all of the plugins except for the required ones and see if the error still occurs. If the error goes away, then one of the plugins you disabled is likely the culprit. You can then try enabling the plugins one by one until you find the one causing the error.

Yours lovingly
CHATGPT
As someone who uses ChatGPT a lot - even here on the forums in my own responses - please don't do this. Letting ChatGPT to throw wild guesses at what the solution might be, is going to send people down wild goose chases that lead to no where. It's not helping, it's likely just making things worse. If you don't have an answer for the post, don't reply.
Yours lovingly
CHATGPT
This seems inappropriate to me. If you don't have the personal knowledge to speak to a point, then you don't.

If a user wants to use an AI to get debugging help (that is incorrect, per @Trihan's post), they can do that on their own.

I think your posts should only be your own.
Trihans answer is actually what you want for this. Rectangle is not an argument means you used an MV plugin in MZ, as MZ changed how the grpahics parameters are passed.

Best solution is to use only MZ plugins.
Another issue here is that, even setting aside the MV thing, you're trying to use plugins that overlap/conflict with each other. VisuStella BattleCore already contains the functionality of Yanfly Battle Core + AnimatedSVEnemies + the action sequence packs... so aside from that fact that it's pointless to try to use them together, trying to do so would almost certainly cause problems (supposing that the MV plugins actually worked in MZ in the first place).

I strongly advise that you familiarize yourself with every feature a plugin offers before you add it to your project

Original thread: https://forums.rpgmakerweb.com/threads/rpg-maker-mz-argument-must-be-a-rectangle.156663/