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

Super015

Veteran
Veteran
Joined
May 12, 2013
Messages
84
Reaction score
14
First Language
Italian
Primarily Uses
RMMV
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;
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
7,629
Reaction score
5,394
First Language
English
Primarily Uses
RMMV
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.
 

JohnDoeNews

Mod on Steam (MV/MZ)
Veteran
Joined
Apr 25, 2017
Messages
1,572
Reaction score
1,178
First Language
Dutch
Primarily Uses
RMMV
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.
 
Last edited:

Super015

Veteran
Veteran
Joined
May 12, 2013
Messages
84
Reaction score
14
First Language
Italian
Primarily Uses
RMMV
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. :kaoswt:
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
7,629
Reaction score
5,394
First Language
English
Primarily Uses
RMMV
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.
 

Super015

Veteran
Veteran
Joined
May 12, 2013
Messages
84
Reaction score
14
First Language
Italian
Primarily Uses
RMMV
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! :kaoeh:
 

JohnDoeNews

Mod on Steam (MV/MZ)
Veteran
Joined
Apr 25, 2017
Messages
1,572
Reaction score
1,178
First Language
Dutch
Primarily Uses
RMMV
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. :kaoswt:
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! :kaoeh:
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

If anyone knows any C# programmers, please send them my way.
Chilling at night in a tavern.
ChillingAtTavern.png

After 'multiple breakdowns', it's finally over. 10/10 will do this again.
Ever notice that villains can reform and become better people, but heroes can only ever die... or live long enough to see themselves become villains?

Isn't that interesting?
xabileug wrote on Kaelan's profile.
Will you be back?


got inspired by Tekken 5's character select screen and made some new music today for my character select screen.

Forum statistics

Threads
129,842
Messages
1,205,649
Members
170,995
Latest member
RamiroWhitehead
Top