MV Cannot exceed \v[600] in message boxes (Problem with YEP_AdvancedSwVar?)

Hi everyone! As the title suggests, when I want to draw the value of variables from 601 onwards, the game crashes!
This is the error message:

JavaScript:
21:47:43.008 YEP_CoreEngine.js:1098 TypeError: Cannot read property 'match' of undefined
    at Game_Variables.isAdvancedVariable (YEP_AdvancedSwVar.js:258)
    at Game_Variables.value (YEP_AdvancedSwVar.js:247)
    at Game_Variables.value (YEP_SelfSwVar.js:315)
    at Window_Message.<anonymous> (rpg_windows.js:282)
    at String.replace (<anonymous>)
    at Window_Message.Window_Base.convertEscapeCharacters (rpg_windows.js:281)
    at Window_Message.Window_Base.convertEscapeCharacters (YEP_MessageCore.js:702)
    at Window_Message.Window_Base.convertEscapeCharacters (YEP_X_MessageEvalText.js:94)
    at Window_Message.convertEscapeCharacters (YEP_MessageCore.js:1293)
    at Window_Message.startMessage (rpg_windows.js:4334)
SceneManager.catchException @ YEP_CoreEngine.js:1098

It seems that the Yanfly plugin is the problem: Advance Switches & Variables
The bug is solved by disabling that plugin, unfortunately I need it and I can't remove it from my game.
I tried to open the plugin but I can't find any reference to the number 600.

Edit:

The error seems to indicate this part of the Yanfly plugin code:

JavaScript:
Yanfly.AdvSwVar.Game_Variables_value = Game_Variables.prototype.value;
Game_Variables.prototype.value = function(variableId) {
  if (this.isAdvancedVariable(variableId)) {
    return this.runAdvancedVariableCode(variableId);
  } else {
    return Yanfly.AdvSwVar.Game_Variables_value.call(this, variableId);
  }
};

Game_Variables.prototype.isAdvancedVariable = function(variableId) {
  if (SceneManager._scene._debugActive) return false;
  if (SceneManager._scene instanceof Scene_Debug) return;
  var name = $dataSystem.variables[variableId];
  if (name.match(/EVAL:[ ](.*)/i)) return true;
  return false;
You seem to have a screenshot missing from your post, we don't see any error message.

Make sure it's from Yanfly's debug screen, or press F8 in the game and go to the Console tab.
What Advanced Switches and Variables does, is run javascript formula when the variable is called upon. If this crashes the game, you most likely have a mistake in the formula bound to the variable. Note that putting a . instead of , is enough to crash the game.

Can we see the formula used in those variables?

---

Another possible cause is your other plugins using those variables for other purposes. Check the parameters of your other plugins to see if any of them uses the variables you've bound to a javascript formula.

---

A third possibility would be if the variables were set to be self variables using the SelfSwVar plugin by yanfly. This probably isn't it, since you'd most likely would have known if this was the case, but a variable can not be set to be both a self var and an advanced var.
What Advanced Switches and Variables does, is run javascript formula when the variable is called upon. If this crashes the game, you most likely have a mistake in the formula bound to the variable. Note that putting a . instead of , is enough to crash the game.

Can we see the formula used in those variables?

---

Another possible cause is your other plugins using those variables for other purposes. Check the parameters of your other plugins to see if any of them uses the variables you've bound to a javascript formula.

---

A third possibility would be if the variables were set to be self variables using the SelfSwVar plugin by yanfly. This probably isn't it, since you'd most likely would have known if this was the case, but a variable can not be set to be both a self var and an advanced var.
I don't have any variables used with "Advanced Switches and Variables", only switches.
I checked in all my plugins and there is no reference to variable 600 or later, they are not even used as self variables. I really can't understand why since 601 it's not possible to insert them in the text code \V[n], besides this problem they work fine. 😅
So I did a simple test with making a new project and sticking just this plugin into it.

I made an event that sets variable 601 to the number 5, then uses Show Text \V[601]

It worked just as expected. So the problem is somewhere in your setup or implementation.

I'd suggest you duplicate what I did, to make sure your copy of MV and the plugin also work in a new project.

Then make sure your Yanfly plugins in your project are arranged in the correct order according to the Yanfly Engine Web site. If that's not a problem, turn off everything except advanced switches and variable, see if it works.

If it still gives an error when that's the only active plugin, start showing us screenshots of your event.
Today, after restarting the PC, I deleted all the variables after 600 and recreated them, now they work as they should... WHAT!? :kaomad2:
How can this be?
I had already tried to recreate them but the problem persisted!
Now everything works but what if the solution is precarious? Could the problem reoccur? I just can't figure out what could have happened! 😐
I don't have any variables used with "Advanced Switches and Variables", only switches.
I checked in all my plugins and there is no reference to variable 600 or later, they are not even used as self variables. I really can't understand why since 601 it's not possible to insert them in the text code \V[n], besides this problem they work fine. 😅
So... You don't have any advanced cars over 601, yet the advanced var plugin crashed when you use var 601 +? That is at least remarkable.

Today, after restarting the PC, I deleted all the variables after 600 and recreated them, now they work as they should... WHAT!? :kaomad2:
How can this be?
I had already tried to recreate them but the problem persisted!
Now everything works but what if the solution is precarious? Could the problem reoccur? I just can't figure out what could have happened! 😐
Well... Problem solved, so I wouldn't worry about it too much. There must have been a mistake you've made somewhere, which you failed to discover before. And that mistake seems to be solved by deleting and remaking those variables.

When an error like this occurs, always track the last things you changed before the error happens. That is most likely where you find your mistake.

Original thread: https://forums.rpgmakerweb.com/threads/cannot-exceed-v-600-in-message-boxes-problem-with-yep_advancedswvar.154747/