MV A strange error that i dont understand at all.

I delt with this error in a past project that i trashed a while ago due to not understanding what was casuing it, and now that i need to finish this project for a game jam, im in desperate need of help.

This error keeps on poping up at a certian point in my project after going through a few maps, then either trying to save the game or change equipment.
error1.PNG

I have no clue what could be causing this. I tried turning Yanfly core engine off and i still get it, updated MV to its latest version, still get it, i don't know what else to do at this point. Apparently something is wrong with some of the files in the js folder before the plugins folder?

Here are the plugins im using:
error2.PNG

If anyone could help me with this, that would be great.
turn all plugins OFF except YEP and try again, if it doesn't happen, turn
the other 1 by 1 ON, if it crash, more it up, and try again.

if it keeps happening, than there is a conflict.
Yep, check your plugins. This should never happen without plugins, because by default _states is always an array, and therefore does have a contains method. It might be a plugin conflict, in which case you could try changing the plugin load order (click + drag in the Plugin Manager list).

I notice the Yanfly plugins you're using are not in the recommended order, listed here:
I.e. they should be in this order:
  • YEP_CoreEngine
  • YEP_DamageCore
  • YEP_X_CriticalControl
  • YEP_SkillCore
  • YEP_WeaponAnimation
  • YEP_StopMapMovement
Even if this does not turn out to be the problem, it's a good idea to stick to the recommended order!

I also found this thread suggesting that "a plugin that changed status in battle, SRD plugin" can cause this error, maybe it's the battle popup one you're using:

Remember to save your project to apply Plugin Manager changes before testing~
Yep, check your plugins. This should never happen without plugins, because by default _states is always an array, and therefore does have a contains method. It might be a plugin conflict, in which case you could try changing the plugin load order (click + drag in the Plugin Manager list).

I notice the Yanfly plugins you're using are not in the recommended order, listed here:
I.e. they should be in this order:
  • YEP_CoreEngine
  • YEP_DamageCore
  • YEP_X_CriticalControl
  • YEP_SkillCore
  • YEP_WeaponAnimation
  • YEP_StopMapMovement
Even if this does not turn out to be the problem, it's a good idea to stick to the recommended order!

I also found this thread suggesting that "a plugin that changed status in battle, SRD plugin" can cause this error, maybe it's the battle popup one you're using:

Remember to save your project to apply Plugin Manager changes before testing~
Turns out that SRD's plugins are causing this.
Odd, i had those in other projects and this never happened...
I use SRD plugins and I got no errors, as I dont use SRD damage popup.

you can place it below the battle plugins or in between.

as Caethyril said, check the website or use the plugin of ALOE found
above my spoiler, as this shows the plugins you use, than correct them.

but swapping other plugins around or categorize it lower the conflicts.
It's weird to see scripts conflict like that. So the way I see it, a core/engine plugin obliterated an existing function and one or more of your scripts couldn't find it. So instead of aliasing the old function, they just outright nuked the old one.
This error keeps on poping up at a certian point in my project after going through a few maps, then either trying to save the game or change equipment.
does the error happen after loading an old save or when starting a new playtest game?

please remember that you should start a new game after most changes in the plugin manager, because a change there can make the older savefiles incompatible to your new configuration.
It's weird to see scripts conflict like that. So the way I see it, a core/engine plugin obliterated an existing function and one or more of your scripts couldn't find it. So instead of aliasing the old function, they just outright nuked the old one.
aliasing is the right way, but sometimes they override it to improve the function,
because aliasing wont work very well by than, but if another do the same, it can
lose its function or crash if it uses new variables in it.

but most plugins can work together, as the above low plugins shouldn't conflict
right in the blue in the correct order.
aliasing is the right way, but sometimes they override it to improve the function,
because aliasing wont work very well by than, but if another do the same, it can
lose its function or crash if it uses new variables in it.

but most plugins can work together, as the above low plugins shouldn't conflict
right in the blue in the correct order.
Agreed. I just found it odd that OP was facing that issue. I assume the YEP core made the change, if I had to guess. Their scripts are pretty professional, so I'd assume they absolutely know about aliasing, must be they decided that aliasing was not good there. Or it could be an oversight. Never know.
so I'd assume they absolutely know about aliasing, must be they decided that aliasing was not good there
YEP CoreEngine does override functions (mostly because of glitches/bugs) so
all plugins that alias it should go below this one for safety.

specially if there is a bug in the main core script, its safer to override the function
to fix it that way, but you need to check the other plugins if they do the same or not,
so you can either rule this function out or combine it to make it work for personal use.
Like Andar said, first make sure you're testing from a new game! Also, to be super safe, test by starting a battle from the map (e.g. a random encounter, or a map event with a Battle Processing command) rather than using Battle Test from the Database. 👋

If you can reproduce the problem with all plugins turned off except for SRD Battle Popup Customizer, then yes, it's something to do with that plugin specifically. However, since you say this...
Turns out that SRD's plugins are causing this.
Odd, i had those in other projects and this never happened...
I suspect it's actually a conflict with another plugin. In that case you can:
  • Turn off the plugin(s) you suspect may be conflicting (e.g. YEP_CoreEngine);
  • As usual, save your project to apply Plugin Manager changes;
  • Test to see if it works now.
If it does start working like that, you could double-check by turning off all unrelated plugins and see if the conflict still happens. (It is possible, but rare, for 1 conflict to involve more than 2 plugins.) Once you've identified the culprits, here are some possible solutions:
  1. Rearrange the load order to see if that's enough to fix it; or
  2. Remove/replace one (or more) of the conflicting plugins; or
  3. Request/commission a compatibility patch for the conflicting plugins.
If it is a conflict...based on the plugins used by the OP in that thread I linked, my first suggestion would be to try turning off the VE plugins (BasicModule & CastAnimations) to see if that helps. Like others say, though, it might be something else.

Original thread: https://forums.rpgmakerweb.com/threads/a-strange-error-that-i-dont-understand-at-all.178635/