Hello everyone, I used rpg maker mz for more than 200 hours but after updating my plugins from VisuStella, when I playtest my game I have "RangeError Maximum call stack size exceeded". What is it ? And what can I do ?
"Maximum call stack size exceeded"
Javascript/Plugin SupportI've moved this thread to Javascript/Plugin Support . Thank you.
Max call stack size exceeded error is usually caused by an infinite loop within the code. Not sure what exactly in your plugins though.
as said above this error is caused by a recursive loop.
there are very few things that can cause it, so you should be able to hopefully find the cause quickly:
1) installed a plugin twice into the plugin manager (just carefully check your list)
2) wrong order of plugins that are supposed to work together (yes, it does matter which plugin is above which other plugin)
3) incompatible plugins (this can be difficult to find because you have to disable one plugin after another until you find both involved plugins, and then sort them out or make them compatible again)
there are very few things that can cause it, so you should be able to hopefully find the cause quickly:
1) installed a plugin twice into the plugin manager (just carefully check your list)
2) wrong order of plugins that are supposed to work together (yes, it does matter which plugin is above which other plugin)
3) incompatible plugins (this can be difficult to find because you have to disable one plugin after another until you find both involved plugins, and then sort them out or make them compatible again)
Thanks for your help. I tried everything but nothing changes...
In almost all cases, a stack overflow is caused because a function ends up calling itself during execution (either directly or indirectly). In this case, as the error message repeatedly says "at Scene_Boot.<computed> (VisuMZ_1_MessageCore.js:2251)" I'd assume that that exact part of the script, for some reason, repeatedly calls itself over and over again.
Now, unfortunately I can't say why that happens, but a few possible reasons have already been mentioned. However, I can think about a few other possible reasons on top of that:
1) if it is a function that evaulates some user-defined code (like for example the function that evaulates the damage formula) and that code somehow ends up calling the function that evaulates the code, this could cause an infinite loop. Now, this is rather specific, but the easiest (and admittably unrealistic) example I could think of would be writing the following into an MV damage formula:
"this.evalDamageFormula(b)"
During evaulation, that would call the function that does the evaluation and as such trigger another evaluation, that triggers another evaluation. etc. etc. Again, I know that is a stupid example but stuff like this can sometimes happen.
2) something is wrong with the plugin itself. There is a chance, that during updating, something went wrong and a part of the code is now not working properly anymore. If that is the case, you would have to manually look for the error and fix it which is ... annoying but unavoidable in that case.
One situation where this can also happen is, if one were using several plugins and the one that was further up in the list had some non-functional code that, for some reason, got overwritten and effectively "patched" by one of the plugins further down. By deactivating that plugin, however, the error emerges.
Now, unfortunately I can't say why that happens, but a few possible reasons have already been mentioned. However, I can think about a few other possible reasons on top of that:
1) if it is a function that evaulates some user-defined code (like for example the function that evaulates the damage formula) and that code somehow ends up calling the function that evaulates the code, this could cause an infinite loop. Now, this is rather specific, but the easiest (and admittably unrealistic) example I could think of would be writing the following into an MV damage formula:
"this.evalDamageFormula(b)"
During evaulation, that would call the function that does the evaluation and as such trigger another evaluation, that triggers another evaluation. etc. etc. Again, I know that is a stupid example but stuff like this can sometimes happen.
2) something is wrong with the plugin itself. There is a chance, that during updating, something went wrong and a part of the code is now not working properly anymore. If that is the case, you would have to manually look for the error and fix it which is ... annoying but unavoidable in that case.
One situation where this can also happen is, if one were using several plugins and the one that was further up in the list had some non-functional code that, for some reason, got overwritten and effectively "patched" by one of the plugins further down. By deactivating that plugin, however, the error emerges.
I tried to delete everything and reinstall all plugins. Now I can say that Battle System - BTB isnt working, I have "Cannot read property 'Settings' of undefined" (without MessageCore). And if I use them together (Battle systeme BTB is located below all my Tier 1 plugins of course) I have the "Maximum call stack size exceeded" error...
Just to add onto what Ischmar said, aside from the damage formula a very common place to get user-defined code that could have mistakes is in notetags. So it's a good idea for you to double check any of those that you've defined.
Aside from that, you can do some basic troubleshooting steps like starting a new project, just installing the plugins, and see if you have any errors.
And then you can contact VisuStella directly, they have a system for bug reporting if you feel certain it's an error just in the plugins.
Aside from that, you can do some basic troubleshooting steps like starting a new project, just installing the plugins, and see if you have any errors.
And then you can contact VisuStella directly, they have a system for bug reporting if you feel certain it's an error just in the plugins.
Original thread: https://forums.rpgmakerweb.com/threads/maximum-call-stack-size-exceeded.148444/