• Hello game master! Welcome to our growing community. Please take a moment to Register (top right button, see how: Slides).

    If you use Campaign Logger, you can use the same login details - we've linked the app to this forum for secure and easy single sign-on for you.

    And please drop by the Introductions thread and say hi.

Feature Request: Bulk add rows in new generator UI

JohnnFour

Game Master
Staff member
Demonplague Author
Wizard of Adventure
Beta-Tester
Adventure Builder
Gamer Lifestyle
Adventure Master
@mKlaumann @JochenL Can we make it as easy as copy & paste within the UI to populate individual tables?

I build my data sets in Excel or plain text file.

It would be ideal to create generators straight from there instead of building row by row in the UI, or switching to Code mode and adding the extra YAML/JSON code wrapped around each line.
 

JochenL

CL Byte Sprite
Staff member
Wizard of Adventure
Beta-Tester
Faster Combatant
Adventure Builder
Gamer Lifestyle
Adventure Master
This should be doable...
 

ELF

Generator Sage
Staff member
Beta-Tester
Faster Combatant
Adventure Builder
Adventure Master
This would be useful even for my oldskool ways. When working with large sets of data, I usually organize the data in a spreasheet, then copy it to a text editor where I run YAML conversion macros and then copy the table data to the actual generator file in another editor.

With this I could skip the text editor steps and move directly to testing. (y)
 

Kathorus

New member
In the mean-time, if you're in a spreadsheet you should be able to use concatenation to quickly wrap the lines with the needed characters.

For instance, let's say you have a small table you setup like this;

1551819909956.png

The formula, in Excel, is =CONCATENATE("{","""","m","""",": ", A2,", ","""","v","""",": ","""",B2,"""","},")

It's important to note, you have to be careful with all the quotes, but once you have the formula in you can save it. Then you just use the fill handle to quickly populate the rest of the cells. Then you can just copy the new values into the generator.

1551820623433.png

1551820691436.png
 

ELF

Generator Sage
Staff member
Beta-Tester
Faster Combatant
Adventure Builder
Adventure Master
Neat! The conversion can be simplified by using the YAML format, which Campaign Logger also supports. If you are processing just the table entries, it's enough to slap a dash in front of each line. (Granted, if the line contains formatting, adding quotes is a good idea as well.)
 

JohnnFour

Game Master
Staff member
Demonplague Author
Wizard of Adventure
Beta-Tester
Adventure Builder
Gamer Lifestyle
Adventure Master
Cool beans!
 

vnavone

New member
As someone who has a bunch of random tables stored in Google Sheets I would definitely benefit from this feature. I'm not very comfortable working with code, so I'm hoping for a simpler solution such as bulk input via the Form view. Whatever GUI for form-filling tools you can provide to non-coders like me for building generators would be greatly appreciated!

FWIW, I tried using the Google Sheet JSON formatter above but when I pasted into the JSON editor the quotes came out all messed up so ended up reformatting by hand.
 

JochenL

CL Byte Sprite
Staff member
Wizard of Adventure
Beta-Tester
Faster Combatant
Adventure Builder
Gamer Lifestyle
Adventure Master
We are preparing a CSV bulk import at the moment.
 

JochenL

CL Byte Sprite
Staff member
Wizard of Adventure
Beta-Tester
Faster Combatant
Adventure Builder
Gamer Lifestyle
Adventure Master
I started work today.
 
  • Like
Reactions: ELF

JochenL

CL Byte Sprite
Staff member
Wizard of Adventure
Beta-Tester
Faster Combatant
Adventure Builder
Gamer Lifestyle
Adventure Master
Update Time!
  • Generator UI now supports the upload of CSV, too (not just JSON)
    • The first CSV row is treated as a header row
    • Values within a row need to be separated by COMMA (not semi-colon)
      • Double-quotes around a value must be used to have commas within a value
    • Each column will become its own table
    • The filename will be the name of the new generator
    • The column names (from the header row) will become the names of the tables
    • The column names will be the categories of the new generator
    • The column names will form the auto-created result pattern from where one can adjust the generator manually
  • All imported generators now get "[IMPORTED] " prepended to their name - that can be changed to whatever one desires after a file has been imported
To test this:
  • Click Upload as for JSON:
    1613746359931.png
  • Select or Drag/Drop a CSV file instead of a JSON file
  • Done! You can now change your new generator as desired!
 
Last edited:
  • Like
Reactions: ELF

ELF

Generator Sage
Staff member
Beta-Tester
Faster Combatant
Adventure Builder
Adventure Master
  • Select or Drag/Drop a CSV file instead of a JSON file
I did not get this working. I tested CSV files exported from Excel with several different variations, but the dragging the file or using the Open file dialog produces no reaction from the UI.

Dragging an improperly formatted JSON file produces an error message, but with CSV files I get no reaction.
 

JochenL

CL Byte Sprite
Staff member
Wizard of Adventure
Beta-Tester
Faster Combatant
Adventure Builder
Gamer Lifestyle
Adventure Master
I did not get this working. I tested CSV files exported from Excel with several different variations, but the dragging the file or using the Open file dialog produces no reaction from the UI.
Can you send me an example file?
 

ELF

Generator Sage
Staff member
Beta-Tester
Faster Combatant
Adventure Builder
Adventure Master
Here's the CSV file (zipped due to Xenforo requirements). It's just a simple listing of the most common Finnish female, male and family names.

Some potential pitfalls:
  • the formatting of accented characters
  • the structure changes on line 326 due to some obscure reason I cannot recall now.
  • there are some blank cells near the end (due to the limitations of the source material).
 

Attachments

Last edited:

ELF

Generator Sage
Staff member
Beta-Tester
Faster Combatant
Adventure Builder
Adventure Master
  • the formatting of accented characters
I replaced the accented characters with non-accented versions, but that did not change the behavior.

  • the structure changes on line 326 due to some obscure reason I cannot recall now.
I removed the lines after 325, but this did not help.

  • There are some blank cells near the end (due to the limitations of the source material).
I removed also the lines containing empty cells (from 306 onwards), but this had no effect either.
 

JochenL

CL Byte Sprite
Staff member
Wizard of Adventure
Beta-Tester
Faster Combatant
Adventure Builder
Gamer Lifestyle
Adventure Master
The last rows started with three excess commas each - I removed them. After that, the generator was created. It was not imported as there was no header for the three excess columns
To get the generator fully working I had to remove the leading blanks in the header row, too.
 

Attachments

  • Like
Reactions: ELF

ELF

Generator Sage
Staff member
Beta-Tester
Faster Combatant
Adventure Builder
Adventure Master
The last rows started with three excess commas each - I removed them. After that, the generator was created.
I did the same (see above), but that did not help. I still get no reaction from the generator UI.

I also removed the spaces from within the first line, but that changed nothing.

Still investigating.

Edit: Your version does work, so there must still be some other difference between the files.
 

ELF

Generator Sage
Staff member
Beta-Tester
Faster Combatant
Adventure Builder
Adventure Master
Solved! In my version there were still tabs on the lines I had removed. Seems that those confused the import process. After I removed the lines containing just tabs, the import worked.

Suggestion: an error message for failed imports so that the user gets some kind of reaction even for incompatible files.

Another: Even better if the import function could ignore extraneous white space (outside of the actual cells), as these 'invisible' errors can be hard for users to solve.
 
Last edited:
Top