DoubleX RMMV Dynamic Data

Note


This plugin's available for commercial use


Purpose


Stores the database changes done by users during game executions


Can't be used with data read from the database files upon use


Can't be used with any map data


Description


In the default RMMV setting, you can edit the loaded parts of the database but you can't save those changes, as the database's always loaded from the raw json files upon game start.
With this plugin, all the loaded parts of the database will be saved in savefiles and loaded from those savefiles upon loading those savefiles.


Configuration

Spoiler
 * @param dynamicDataActors
 * @desc Saves the actors part of the database changes in savefiles if and only
 *       if dynamicDataActors is set as true
 * @default false
 *
 * @param dynamicDataClasses
 * @desc Saves the classes part of the database changes in savefiles if and only
 *       if dynamicDataClasses is set as true
 * @default false
 *
 * @param dynamicDataSkills
 * @desc Saves the skills part of the database changes in savefiles if and only
 *       if dynamicDataSkills is set as true
 * @default false
 *
 * @param dynamicDataItems
 * @desc Saves the items part of the database changes in savefiles if and only
 *       if dynamicDataItems is set as true
 * @default false
 *
 * @param dynamicDataWeapons
 * @desc Saves the weapons part of the database changes in savefiles if and only
 *       if dynamicDataWeapons is set as true
 * @default false
 *
 * @param dynamicDataArmors
 * @desc Saves the armors part of the database changes in savefiles if and only
 *       if dynamicDataArmors is set as true
 * @default false
 *
 * @param dynamicDataEnemies
 * @desc Saves the enemies part of the database changes in savefiles if and only
 *       if dynamicDataEnemies is set as true
 * @default false
 *
 * @param dynamicDataTroops
 * @desc Saves the troops part of the database changes in savefiles if and only
 *       if dynamicDataTroops is set as true
 * @default false
 *
 * @param dynamicDataStates
 * @desc Saves the states part of the database changes in savefiles if and only
 *       if dynamicDataStates is set as true
 * @default false
 *
 * @param dynamicDataAnimations
 * @desc Saves the animations part of the database changes in savefiles if and
 *       only if dynamicDataAnimations is set as true
 * @default false
 *
 * @param dynamicDataTilesets
 * @desc Saves the tilesets part of the database changes in savefiles if and
 *       only if dynamicDataTilesets is set as true
 * @default false
 *
 * @param dynamicDataCommonEvents
 * @desc Saves the common events part of the database changes in savefiles if
 *       and only if dynamicDataCommonEvents is set as true
 * @default false
 *
 * @param dynamicDataSystem
 * @desc Saves the system part of the database changes in savefiles if and only
 *       if dynamicDataSystem is set as true
 * @default false




Games using this plugin


None so far


Prerequisites


1. Thorough comprehensions to the other custom plugins to edit their data loaded and cached during game executions


Terms Of Use


You shall keep this plugin's Plugin Info part's contents intact


You shalln't claim that this plugin's written by anyone other than DoubleX or his aliases


None of the above applies to DoubleX or his/her aliases


Changelog

Spoiler
 *      v1.01d(GMT 1400 27-1-2016):                                           
 *      1. Fixed undefined DD and DoubleX_RMMV.Dynamic_Data in defining latter
 *      2. Fixed caching original data before they're completed loaded bug   
 *      v1.01c(GMT 0100 26-12-2015):                                          
 *      1. Fixed corupting the database upon reloading it on the title screen
 *      2. Fixed some syntax errors due to typos                             
 *      v1.01b(GMT 0900 25-11-2015):                                          
 *      1. Fixed missing param dynamic_data_states in the plugin manager bug  
 *      2. Fixed accessing private variables inside $gameSystem bug           
 *      3. The aliased function names becomes more unique to this plugin     
 *      v1.01a(GMT 1200 16-11-2015):                                          
 *      1. Lets users set which part of the database changes will be saved    
 *      2. The aliased functions can be accessed by other custom plugins now 
 *      v1.00b(GMT 0800 11-11-2015):                                          
 *      1. Added descriptions that will be shown in the plugin manager        
 *      v1.00a(GMT 0100 31-10-2015):                                          
 *      1. 1st version of this plugin finished                               




View attachment DoubleX RMMV Dynamic Data v101d.rar
Just so I understand this correctly, this makes it so you can test play your game, edit things in the database, and they will change in the game?

If so, that's really handy 😀 nice work!
Just so I understand this correctly, this makes it so you can test play your game, edit things in the database, and they will change in the game?

If so, that's really handy 😀 nice work!
This plugin stores everything in $dataActors, $dataClasses, $dataSkills, $dataItems, $dataWeapons, $dataArmors, $dataEnemies, $dataTroops, $dataStates, $dataAnimations, $dataTilesets, $dataCommonEvents and $dataSystem in the save files, and loading those save files will load those data changes as well. But the database files themselves will remain intact.

That can be useful if some other custom plugins changes something in those data variables but not the database files themselves, such as some notetags.
Updates

Code:
 *      v1.00b(GMT 0800 11-11-2015):                                           *      1. Added descriptions that will be shown in the plugin manager
So this is for use if you want to change database stuff and have it saved with the player's game. So if you started a game and saved it, then made database changes, NONE of them would be effective in your saved game (to answer the question above).


I imagine the save files will get quite big using this plugin. Do you have some examples of size increases? I'm pretty sure there is a limit that, if the file size exceeds it, an error is thrown. If people have really big databases (30-40 actors, as many classes or more, hundreds of skills/items) it probably wouldn't take long to reach that limit?


Have you considered an option to add a parameter for each database tab, so the user can turn them on/off depending on what they might want to make changes to during the game? Actors is a typical one, for example, but I wouldn't necessarily want ALL of the database saved just because I want to change actor stuff on the fly.
So this is for use if you want to change database stuff and have it saved with the player's game. So if you started a game and saved it, then made database changes, NONE of them would be effective in your saved game (to answer the question above).

I imagine the save files will get quite big using this plugin. Do you have some examples of size increases? I'm pretty sure there is a limit that, if the file size exceeds it, an error is thrown. If people have really big databases (30-40 actors, as many classes or more, hundreds of skills/items) it probably wouldn't take long to reach that limit?

Have you considered an option to add a parameter for each database tab, so the user can turn them on/off depending on what they might want to make changes to during the game? Actors is a typical one, for example, but I wouldn't necessarily want ALL of the database saved just because I want to change actor stuff on the fly.
Yes, the save files will be much bigger, yet I forgot to mention it.

While I've no data for RMMV, in the RMVXA counterpart of this plugin, if the project size is small(less than 5MB with less than 10 custom scripts), the savefile is typically less than 0.5MB(the saving itself will be slightly longer, which is hardly noticeable), but it can also lead to a 16MB+ savefile(the saving itself took 30 seconds XD) in an exceptionally massive projects using 200+ scripts lol(the project size is roughly 346 MB without RTP stuffs)

About adding parameters, I'll definitely go for it. I'll even let users edit those parameters on the fly, but of course they'll really have to know what they're doing in this case 🙂
Updates

Code:
 *      v1.01a(GMT 1200 16-11-2015):                                           *      1. Lets users set which part of the database changes will be saved     *      2. The aliased functions can be accessed by other custom plugins now
Updates

Code:
 *      v1.01b(GMT 0900 25-11-2015):                                           *      1. Fixed missing param dynamic_data_states in the plugin manager bug   *      2. Fixed accessing private variables inside $gameSystem bug            *      3. The aliased function names becomes more unique to this plugin
Updates

Code:
 *      v1.01c(GMT 0100 26-12-2015):                                           *      1. Fixed corupting the database upon reloading it on the title screen  *      2. Fixed some syntax errors due to typos
Updates

Code:
 *      v1.01d(GMT 1400 27-1-2016):                                           
 *      1. Fixed undefined DD and DoubleX_RMMV.Dynamic_Data in defining latter
 *      2. Fixed caching original data before they're completed loaded bug
You saved me with this ... 😀   I made a huge plugin which requires a plugin like this. After days of scripting I realised that it doesn't save actor data etc.


But there is one problem ... when I save the game there is a "error sound"(idk why because it saves the game like it should) and the save window is not closed like it normally is. Maybe you can fix this?


Other than that: Great work! 🙂
You saved me with this ... 😀   I made a huge plugin which requires a plugin like this. After days of scripting I realised that it doesn't save actor data etc.


But there is one problem ... when I save the game there is a "error sound"(idk why because it saves the game like it should) and the save window is not closed like it normally is. Maybe you can fix this?


Other than that: Great work! 🙂

I've also been investigating this, but uptil now I still can't pinpoint the root cause yet. My wild guess is that the save file becomes too large(exceed the 200K limit if I recall) 🙂
I've also been investigating this, but uptil now I still can't pinpoint the root cause yet. My wild guess is that the save file becomes too large(exceed the 200K limit if I recall) 🙂

Ok 🙂  when I pinpoint the mistake, I let you know.

Original thread: https://forums.rpgmakerweb.com/threads/doublex-rmmv-dynamic-data.48589/