#BATCH GENERATOR / MODIFIER FOR RPGB DATABASE, IN EXCEL

1 messages · Page 1 of 1 (latest)

flint bough
#

UPDATE: TEMPORARILY AVOID USING THIS TO MAKE NEW ENTRIES.

BACKUP YOUR DATABASE BEFORE EVEN THINKING OF USING IT!
NOT THE FINAL VERSION, BUT FULLY FUNCTIONAL
SHOULDN'T HAVE BUGS, BUT DON'T RISK. BACKUP FIRST!
** NOT SUITABLE AS A BACKUP SOLUTION, THIS IS ONLY USEFUL FOR BATCH MODIFICATIONS**

Seriously if you don't backup your stuff before using this, you're begging for issues.
Not because the script doesn't work, but because it DOES.
Yes I'm deliberately trying to scare you. Everything is quite easy but if you make a mistake, you'll regret it.

Watch the video I attach here to see how to use it, but in short...

#
  1. WATCH THE VIDEO
  2. BACKUP
  3. EMPTY THE FOLDER "MinToolsForRPGB/ScriptableObjects"
  4. Go into your database and grab some entries ALL OF THE SAME TYPE (Abilities, Effects, etc)
  5. Put them into the "ExcelExporter" array (empty it if needed)
  6. Write the name of the excel file you want to make
  7. Write the save location of the excel file
  8. Select Export as shown in the pic
  9. Go grab the file, it takes a moment to appear in unity, but you can get it from Explorer
  10. Explore it, I hid some things that need NOT to be touched in Excel
  11. Do not change the style of it, or anything but its data, for good measure, the importer is a sissy
  12. DON'T CHANGE SOMETHING IF YOU'RE NOT SURE
  13. Export as csv (it's shown in the vid)
  14. Grab the csv and push it into the "CSV Importer"
  15. Manually write the Type of Entry you're going to make
  16. Backup the database if you didn't already!
  17. Select the output folder. By default it's the folder you emptied earlier, to have a safe testing ground
  18. If you select my folder (or any other folder outside of the database) it will create new objects,
  19. If you select the folder from which you grabbed the Entries in step 4, those will be updated
  20. If you messed your database and you're angry at me, please reconsider your life choices
#

THIS SHOULD BE SAFE TO USE IF YOU PAY ATTENTION BUT IT'S STILL A BETA


The final version will have some extra safety nets, and I will STILL recommend a backup. Now it's VITAL.


If you're not sure about something, ping me rather than "just trying". XD

#

@rose sky @dim spruce @wary night if you want to test it out, be my guests lol ^ 🙂

#

Oh, as a bonus this package contains my duplicate checker XD

rose sky
#

Amazing work 🙂

dim spruce
#

YAY! 🎉 🎉 🎉

crude lichen
#

💪 💯

wary night
#

Awesome

flint bough
#

Update:

  1. I have already implemented most of the REALLY needed safety nets to make this relatively safe even for inexperienced users, and decided how to implement more.

  2. I made sure to clear every list and array used.

  3. I identified a few minor things to improve, like adding a “if unity editor” check.

  4. I have found out how to hide the columns that should contain data from custom RPGB classes, since they would be too complex to store in a simple excel cell

  5. I made the exporter a static class with a custom window so that it won’t rely on a game object, and plan to do the same for the csv importer

  6. I’m looking for a way to automatically turn the excel spreadsheet to a csv with a third static class, my experiment ALMOST works, but so far it screws the csv for some reason

All these updates will make it to the final version -which will probably go on the store- the only thing I’m not currently sure about is point 6

flint bough
#

Note to all: temporarily avoid using it to batch create files, I'm checking something

flint bough
#

@stray mauve I now realise that I should have asked this earlier lol, but please -when you have time- I need you to confirm something.
Supposing I am generating a new Database Entry via code, I should do something similar to what you do in RPGBuilderEditor.cs, shouldn't I?
So that there is no inconsistency with the content of PersistentData.
Is this correct?

EDIT: I pasted the wrong snippet

    {
        if (!module.SaveConditionsMet())
        {
            module.ShowSaveErrorMessage();
            return;
        }

        int newID = -1;
        string currentFileName = GetEntryFileName(module, savedEntry.ID);
        RPGBuilderDatabaseEntry entryFile = GetEntryFile(module, currentFileName);

        if (entryFile != null)
        {
            if (isInjectingEntry) entryFile.ID = -1;
            if (entryFile.ID == -1)
            {
                entryFile.ID = GenerateNewEntryID();
            }

            savedEntry.ID = entryFile.ID;
            module.UpdateEntryData(entryFile);

            if (!isInjectingEntry)
            {
                CompleteEntrySave(module, entryFile, currentFileName, savedEntry.entryFileName);
                module.OnSave();
            }
        }
        else
        {
            if (isInjectingEntry) return;
            var ID = GenerateNewEntryID();
            savedEntry.ID = ID;
            CompleteCreateEntry(module, savedEntry);
            newID = ID;
        }

        if (!module.IsSettingModule) RequestEntryListRedraw();
        UpdateEditorViewAfterSavingEntry(module, newID);
    }```
#

This is the code I have come to think I should emulate (with the due changes), but I'm not sure

#

I don't still fully get this part of your code, but as far as I can tell you're doing something to save in binary format the Entries Data, specifically to the files stored in PersistentData; and I wonder if I should try to replicate this behaviour, or it's optional.

stray mauve
#

Otherwise the next entry added manually in the editor will be using a wrong ID

flint bough