Here is a question for this plugin:
Would it be at all possible to have some type of script call in a plugin's code that could check a certain switch id's value saved within the "Persistent" File?
The reason I ask is because I am using another plugin that plays a video before the Title Screen, and I want that video to change ever so slightly based on what characters have been seen through any of the saves.
For instance, The intro video plays but all the Party Members you could meet are blacked out, to remove spoilers. However, after Chapter X on any save file, now all 4 party members you have will actually be shown in the intro video.
The problem is that the Intro Video is played before loading a save...
I just waiting for this. Than you very much.
I had the code for the JS files in code tags because that would preserve the proper line breaks without needing to find a place to host the file, but it looks like the recent change to how the forums work broke the formatting for the code.
I went and re-copied my base file's code to the v5 code section, so hopefully the line breaks are working again. Unfortunately, anyone who actually wants the older versions might have to mess with the line breaks themselves, as I no longer have a clean version of those JS files.
Every time I try to test my game, I get "Type Error: undefined is not a function."
I've verified that I copied the code correctly.
Do you have any more information? Maybe at least a list of plugins and their version numbers? I can't see what the problem would be from the functions mentioned in the log.
I have no idea what the problem might be, but putting this plugin (JKL_PersistentData) above the Yanfly Item Core (JKL_ItemCore) in the manager seems to at least let the game run. I'm not sure if everything works properly yet, but it will at least launch the game properly.
Ugh....it works for me too, it seems. Damn...I've been finishing up testing in hopes of releasing a beta of this game next week. Now I have to do a bunch of retesting to see if it's going to cause problems. Here's hoping it doesn't!
Thanks for the help.
The 'undefined is not a function' still hasn't been fixed yet? I'd love to use this plugin but I can't put it over Yanfly's plugins as this might cause issues.
After some testing, it may be possible to make it work by changing this line like so:
var _DataManager_createGameObjects = DataManager.createGameObjects;
DataManager.createGameObjects = function() {
_DataManager_createGameObjects();
PersistManager.load();
};
// Changed to:
var _DataManager_createGameObjects = DataManager.createGameObjects;
DataManager.createGameObjects = function() {
_DataManager_createGameObjects.call(this);
PersistManager.load();
};
As far as I can tell, the problem is that the item core and my plugin try to overwrite the same function, and so Yanfly's plugin is trying to make mine do something it doesn't understand (or vice versa? Not sure which way it is, it's just not both since it could be fixed by repositioning the plugin priority.) Not sure why making a call to the overwritten function rather than just executing it would fix the problem, but it worked for me.
If this works, I'll probably update the main code to v6 and modify this line in the codedump. Let me know how it goes.
I'm not sure what the problem might be at the moment, though maybe I can see if I can replicate it when I have some time. Off the top of my head, does this problem occur even if persistent data is the only active plugin (aside from ones needed to make custom code run)? Do you have any parallel process events or plugins that change switches/variables constantly? If you have a lot of variable/switch changes in a short period of time, you may want to turn off the "Save when Set" parameters and use the plugin commands to manually save the persistent data when desired. Otherwise, your game may be trying to run a bunch of redundant persistent save functions, which could end up slowing the framerate on processors not ready for that kind of load. (If you know how to use the console, adding a line to the save function for the persistent data manager to output to the log could help you track when it gets called.) Example code:
PersistManager.save = function() {
console.log ( 'Saving persisent data.' );
StorageManager.save("Persistent", JSON.stringify(this.makeData()));
};
If the line pops up in the log a whole lot in a short span of time (sometimes log messages stack, so check the number next to it too), the auto-saving is probably the problem and you'll want to turn off the "Save when Set" parameters.