MV/MZ SDJB_SaveManager

PluginName: SDJB_SaveManager
Author: ShadowDragon

This plugin is completely rewritten from the ground up
and works differently as it was before.

Smoother and save as its own object entirely!

savemanager.png


Spoiler: How to use
Code:
 Introduction
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 This plugin adds per-save-file changes to the database.
 
 It makes unique (one-of-a-kind) weapons or armors
 easy to upgrade without adding or removing them from the inventory.


 How to use
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 Types: "weapon" and "armor"

 Available parameters: mhp, mmp, atk, def, mat, mdf, agi, luk

 Upgrade an item using a script call:

    => Example for armor
    SDJB_SaveManager.saveNewValue("armor", 1, {
        name: "Shield +1",
        iconIndex: 20,
        atk: -3,
        def: 20,
        description: "New upgraded shield",
    });

    => Example for weapon
    SDJB_SaveManager.saveNewValue("weapon", 1, {
        name: "Sword +1",
        iconIndex: 10,
        atk: 15,
        description: "New upgraded sword",
    });

 Or fully override the params array (armor or weapon):

    SDJB_SaveManager.saveNewValue("weapon", 1, {
        name: "Sword +1",
        iconIndex: 10,
        params: [0, 0, 15, 0, 0, 0, 0, 0],
        description: "New upgraded sword",
    });

 Both methods update the name, icon, parameters, and description
 of $dataWeapons[1].

 First example: only attack changes to 15.
 Second example: only the attack parameter (params[2]) changes,
 but it requires the full array to set the new values:
 [mhp, mmp, atk, def, mat, mdf, agi, luk].

 First option is cleaner, but both are valid.


=== TERMS OF USE ===
Free for Non-Commercial and Commercial use when credit is given.
credit one of the following:
ShadowDragon
ShadowDragonJB


=== WARNING ===
YOU ARE NOT ALLOWED TO REDISTRIBUTE OR SELL IT OR TAKE CODE FOR YOUR OWN.
DO NOT REMOVE THE HEADER.

(require my base plugin (SDJB_Base or SDJB_BaseMVZ (minified version))
leave Feedback and or suggestions.

Download from itch.io
I read from the other thread.. so this is like an evented upgrade scene? instead of creating a new item in the database.. this over writes the item in the database? or does it create item instances?
With the way you've coded this, if someone makes a change to data and then quits to the title screen and starts a new game, the data will still be whatever it was in the previous game because loadDatabase is only called on boot.
@xabileug it doesn't create a new scene, you can event the scene if you like,
but it save the $data object to the save file as for default, if you save, quite
while window is open, load the game it could be there, but entirely closing
the game, the data will be lost.

changing name to +1 create multiple items to +2 to +10, this plugin can
minimize that by changing the data object 🙂
The plugin is fully rewritten with parameters, you can set it to ON or OFF
for using it or not.

for incompability issues, you can edit the plugin or tell it here and I see
what I can do for you.

Enjoy the new rewritten plugin 🙂

Edit:
it's comfirmed that it works in MZ as well, so the tag is added.
Hello! 👋

I've been running into a bit of an issue with saving using the plugin. With just Weapons set to true in the config, when I try to save, I get the error sound, and the save menu does not close. However, if I close out of the project, the game did in fact save, and carried over the edited weapon parameters just fine.

I've tested this in a blank MV project as well, just to make sure if wasn't an incompatibility with any other plugins I'm using.
I dont know about the other plugins, as I run into a issue on my own plugin,
but I dont get any error sounds, do you have a console log of any info there?

so I can check whats going on?
I also restructure the plugin later a bit, but it might not solve the incompability
if there is any, as it doesn't seem to work nicely when using Olivia_MetaControls
which I need to fix as well.

I run a few test later this week to see if I get the same error sound you get,
if you have more info, let me know, than I can take that into account as well.
Thank you for looking into the problem I'm running into.

Unfortunately, it doesn't seem to give any error message in the console. I've put together a small (~5mb) demo project if it would help, though.

it might help, I look into it, thanks for the small demo.

@Vis_Mage I found the cause, not sure why, F5 or exit the save and go in
does save it, but I'm not sure how to fix it yet, but will look into it.

it will be next week so I got more time to see how I can fix it and update
once ready.

sorry for the trouble. Please be patient though 🙂
@Vis_Mage I modified it a tiny bit and fixed the cause in the process.
It works as intended, together with Olivia_MetaControls if you use it 🙂

Thanks for the report on the saving issue 🙂
@ShadowDragon Thank you for updating the plugin!

I've tested it out in a blank project, and I don't get an error while saving now! Unfortunately, it also seems that it is no longer saving $data changes now.
are you sure the the parameter you want to save = true?
if you replace it, the base value is false.

I only test it on the weapon and seems to work, if you removed the old
plugin (ShadowDragon_SDM) and replace with this one, you need to
reconfigure the parameter for them to work correctly again.

any scriptcalls used will still work afterwards if you change the data entry.

EDIT:
@Vis_Mage
there seems be another bug, but it takes a few days to tackle this one down,
as F5 or reboot indeed removed the save part.

To others, the Plugin is removed for the time being untill the bug is solved,
this might takes some days, as something isn't reading correctly.
Moderator note: Temporarily closing thread at OP's request

Re-Opened at OP's Request

Complete rewrite for what I messed around and rebuild from the ground up.
easier to use, more powerful than ever.

it even works in MZ as well for a short test.

if there is any problems (or again) let me know and I see what I can do.

this should avoid all problems what I had previously.

Enjoy the new improved version.

Original thread: https://forums.rpgmakerweb.com/threads/sdjb_savemanager.149222/