I'm fairly new to creating my own plugins, so far I've mostly been able to troubleshoot most of my problems through trial and error, but I'm at a loss currently and I'm not sure how to proceed.
I'll try providing images to provide as much context as possible.
To begin with I'm using RPG Maker MZ.
Here are the changes made to the DataManager functions in my plugin, factions.js, as well as the declaration of my custom global variable:
And this is everything relating to my object class, Game_Factions:
When I run the game, plugin commands add the first 3 factions that are used in my testing room.
If I press F12 and open the debug menu, this is how $gameFactions looks:
This is how I believe it should look, now this is what it looks like after I save the game, and load my file again:
I'm not an expert, so it's difficult to tell exactly what happened here, but if I had to guess, upon loading the game the interpreter was unable to re-assign the contents:faction back to the correct typing.
I tried something that I thought might help, I tried creating a new Game_Factions object and passing on the information from contents.faction over to the new instance, but what I got when I looked at the debug menu, was this:
It once again looks wrong, it lost that last component at the end.
As is, everything works perfectly, until I save the game and reload, attempting to access any of Game_Factions's functions will cause the game to crash because they are no longer valid functions for $gameFaction to access. And this causes several plugin commands that I've created to stop working on load as well.
For now I'll take a small break and come back to this later after more studying. I'm creating this plugin for a friend's game, so I would like to know where the issue is coming from so he could begin using this plugin as soon as possible.
If anyone knows where I might've gone wrong I would very much appreciate the help.
I'll try providing images to provide as much context as possible.
To begin with I'm using RPG Maker MZ.
Here are the changes made to the DataManager functions in my plugin, factions.js, as well as the declaration of my custom global variable:
And this is everything relating to my object class, Game_Factions:
When I run the game, plugin commands add the first 3 factions that are used in my testing room.
If I press F12 and open the debug menu, this is how $gameFactions looks:
This is how I believe it should look, now this is what it looks like after I save the game, and load my file again:
I'm not an expert, so it's difficult to tell exactly what happened here, but if I had to guess, upon loading the game the interpreter was unable to re-assign the contents:faction back to the correct typing.
I tried something that I thought might help, I tried creating a new Game_Factions object and passing on the information from contents.faction over to the new instance, but what I got when I looked at the debug menu, was this:
It once again looks wrong, it lost that last component at the end.
As is, everything works perfectly, until I save the game and reload, attempting to access any of Game_Factions's functions will cause the game to crash because they are no longer valid functions for $gameFaction to access. And this causes several plugin commands that I've created to stop working on load as well.
For now I'll take a small break and come back to this later after more studying. I'm creating this plugin for a friend's game, so I would like to know where the issue is coming from so he could begin using this plugin as soon as possible.
If anyone knows where I might've gone wrong I would very much appreciate the help.