GameHoleCon bound and an update to the NPC Card File

For a second year in a row, I'm heading to GameHoleCon in Madison. I'm running several games this year!

Friday - 10am to 1pm - Chaos Wars - Ford over Troubled Waters

Saturday - 10am to 1pm - Chaos Wars - Ford over Troubled Waters

Sat Night 8pm to midnight - AD&D - Delve into the Deeps 

Sun 10am to 2pm - Battletech - Unidentified Targets Inbound (scifi/horror + Mechs)

I have no idea what I'll be doing when I'm not running games, but if you see me, please say "Hi!" It would be awesome meet readers of this blog.

I have a Twitter account and Instagram account where I'll be posting pictures.

I'm really glad that my tutorial on creating an NPC file card "Rolodex" has worked out well for some folks. I have a small update, and this is something really cool! I have found the path to making an event generator system that uses the NPC Rolodex and generates a report on stuff that happens to the NPCs for a given year.

Two influences on why I would want to do something like this.

First is Tony Bath and Professor MAR Barker again. Tony Bath and Barker both tracked their NPCs on cards as part of their extensive campaigns. Both also had a system where they would randomly generate "events" that would happen to the NPCs to bring life to the campaign. Instead of being static personas, their NPCs would get married, have children, get promoted/demoted, have accidents and even die.

What a brilliant, awesome way to make your campaign world live and breathe!

Second influence is a set of tables from the old 1st edition AD&D supplement "Oriental Adventures". In that book was a section on events that would happen to regions for a year or month. It had a ton of fun events, more than what Bath/Barker had been using.

I had this working in my Microsoft Access database system! I would run a macro that ran scripting.  It would generate a report for me, and it would say things like Marshall Roehm had another child, or Priest Mario suffered a grievous wound and won't be able to serve for six weeks. Stuff that the players will have to possibly deal with.

It really shaped some things in the campaign game year of 59 AD. For a good chunk of 2018, the players had to deal with an assassination attempt on Duke Reynald's life. Guess where that event came from? Yep, my event generator system.

So... with moving to Google Sheets/Forms for my NPC Rolodex, I needed to find a way of making a script that would read my spreadsheet and create a Google Doc. Viola. A simple search and this lovely bit of code is serving as a great starting point to my efforts.

If it weren't for GHC this weekend, I'd have this working in a couple of days. It will have to wait till next week, alas... but I can see how this will now work. Stay tuned!

I wrote this post Wed evening. On Thurs morning, right as this was posting, I was hacking around with the code from the linked page. It works! I rolled through my NPC Card file (the first few records) and was able to create a document based on a template that simply had "##EVENTS##' in it. So the approach is sound. Now on to making this a lot more useful... but after GameHoleCon.

I'm including my code, in case you want to hack around with this. You'll have to follow along the example code from here. The bit about including the "Sheets API" from "Click Google API Console." is renamed - it's a link that appears on the bottom of the dialog that you have to click to get to the Google Cloud API Services. You'll get the same annoying security checks that you got in the tutorial, but once you get through, it works. It took a couple of minutes for the new doc to appear in Drive, in the same folder as the template.
function createDocument() {
  var headers = Sheets.Spreadsheets.Values.get('1abc...', 'A1:G1');
  var cards = Sheets.Spreadsheets.Values.get('1abc...', 'A2:G14');
  var templateId = '2abc...';
  var NPClist = '';

  for(var i = 0; i < cards.values.length; i++){
    var npclocation = cards.values[i][3];
    if (npclocation != 'PC' && npclocation != ''){
      var npcname = cards.values[i][2];
      NPClist = NPClist + npcname + ' / ';
    //Make a copy of the template file
    var documentId = DriveApp.getFileById(templateId).makeCopy().getId();
    //Rename the copied file
    DriveApp.getFileById(documentId).setName('Generated Events');
    //Get the document body as a variable
    var body = DocumentApp.openById(documentId).getBody();
    //Insert the names
    body.replaceText('##EVENTS##', NPClist);