So I'm fairly new to scripting, and I just started on a second plugin when I noticed that it collided with my first plugin.
It seems that I have implemented plugin commands incorrectly and caused them to call each other, which causes the stack size to be exceeded.
Here's the code I used for creating the command. It's the same for both plugins, except with a different string for the command.
I understand that the likely problem is aliasPluginCommand.call(this,command, args); from plugin1 is calling the pluginCommand function for plugin2, which is in turn calling it in plugin1 again. Or something at least similar to that.
I have never used aliasing before so I'm unsure if I understand it completely.
Any assistance on a better way to add the commands to the plugins would be appreciated.
It seems that I have implemented plugin commands incorrectly and caused them to call each other, which causes the stack size to be exceeded.
Here's the code I used for creating the command. It's the same for both plugins, except with a different string for the command.
var aliasPluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args){
aliasPluginCommand.call(this,command, args);
if(command == "some_command"){
console.log("performing command");
}
}
Game_Interpreter.prototype.pluginCommand = function(command, args){
aliasPluginCommand.call(this,command, args);
if(command == "some_command"){
console.log("performing command");
}
}
I understand that the likely problem is aliasPluginCommand.call(this,command, args); from plugin1 is calling the pluginCommand function for plugin2, which is in turn calling it in plugin1 again. Or something at least similar to that.
I have never used aliasing before so I'm unsure if I understand it completely.
Any assistance on a better way to add the commands to the plugins would be appreciated.