Is it possible to increase the maximum number of variables?

I did hope that there will be more Variables in RPGMaker MV after it always was limited to 5000. But it seems to be 5000 again.


The problem is that i really need alot of variables in my education game for japanese kanji and alot vocabulary.


There are 2200 Kanji and i need 2 Variables for every Kanji. 1 Variable to count how often it was answered correct and 1 Variable who is counting the wrong answers.


(I really need this because i created a difficult system what is working with this informations to repeat the Kanji and vocabulary in a intelligent way)


So there are 4400 Variables used now for my Kanji and the rest is almost all used by the system.


I would really love to have like 2000 Variables more so i could add more vocabulary and usefull things. I tryed out alot of stuff by using items, characters and other stuff by conditional branches instead of using variables, but this is very complicated and slows down the game and isnt working fine with the system i created to handle vocabulary and kanji. I really love and need more Variables :3 just like 2000 more would be very fine.
For Ace there was a limit breaker script.


I don't know if a limit breaker plugin was made for MV yet.
Use arrays.

http://www.w3schools.com/js/js_arrays.asp
Ignoring the insanity of using over 5k variables, and assuming MV is similar to Ace, could you not simply create additional global variables with a script call?
In VX Ace it would have been:


$new_variable = value


I haven't started studying javascript yet, so I'm uncertain.


Honestly though. if you're using that many, you're doing something wrong...
Ignoring the insanity of using over 5k variables, and assuming MV is similar to Ace, could you not simply create additional global variables with a script call?
In VX Ace it would have been:



$new_variable = value


I haven't started studying javascript yet, so I'm uncertain.


Honestly though. if you're using that many, you're doing something wrong...



I don't think it's that he's doing something wrong, he's just making an "education" based game, which inherently will deal with weird problems "normal" games won't. He does need to keep track of how many times it was answered correct vs incorrect, and there are a LOT of kanji, even for an elementary schoolers level of education. The simplest way, is, in fact, 2 variables for every kanji. But, due to the limit that won't work.


Arrays are a beautiful thing. Complicated as sin, and a pain in the ass sometimes, but beautiful.
You can use something like;

ScriptCall (use this as soon as possible when loading or creating your game):


$gameSystem.rightKanji = $gameSystem.rightKanji || [];
$gameSystem.wrongKanji = $gameSystem.wrongKanji || [];



ScriptCall (use this to increase the value of the right or wrong answers) X is the number of the kanjiVariable... just like the game variables value.:


if($gameSystem.rightKanji[x])
$gameSystem.rightKanji[x]++;
else
$gameSystem.rightKanji[x] = 1;


OR


if($gameSystem.wrongKanji[x])
$gameSystem.wrongKanji[x]++;
else
$gameSystem.wrongKanji[x] = 1;


PS: to decrease replace '++' with '--' and 1 with 0;

for easy manipulation, to read value and do operations in events use:


$gameVariables.setValue(Y, $gameSystem.rightKanji[X]);

OR

$gameVariables.setValue(Y, $gameSystem.wrongKanji[X]);


This will make it so Y game variable will have the number of right/wrong answers for the X kanji. and then you can use it normally on the event 😉  if you change the value don't forget to write it back to the array with the code:
 


$gameSystem.rightKanji[X] = $gameVariables.value(Y);

OR

$gameSystem.wrongKanji[X] = $gameVariables.value(Y);


This will make it so number of right/wrong answers of X kanji is equal to the value stored in Y variable.
With this you can access every kanji with just ONE game variables!!
Hope this helps!
What are the || for in your code:   $gameSystem.rightKanji = $gameSystem.rightKanji || [];


I've seen that in scripts when instantiating objects and arrays but javascript sites show a different way to instantiate those.  I can't find || on any javascript sites outside of being used as an OR operator, which doesn't appear to be the case here.  Sorry for the dumb question.
No, that is the case here. Its basically stating that "$gameSystem.rightKanji" is either itself if instantiated elsewhere, or already, OR it is a new array.
anybody breaking the limit

hidrax11, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


You already have your answer in your own thread.

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-increase-the-maximum-number-of-variables.55297/