Friday, 29 March 2024

ADLG: V4 Army List Writer - Major Update

Introduction
In March 2021 I delved into the delights of Google Sheets and created a spreadsheet based list writer for Art de la Guerre (ADLG) V3.   In the following May I released a version for ADLG V4.

In the intervening years I have used the writer extensively.  I've also fixed the odd bug and updated the released version.  However, behind the scenes I've been tweaking a few things, adding more features, and writing app scripts (Google speak for macros) to automate various processes.

It's now time to release an updated and much streamlined version

Scripting
As I'm an amateur programmer, the use of app scripts is a big step.  It means that if I share the spreadsheet, others have to trust the code I've used.  This being so, I've thought long and hard before deciding to release this version; app scripts and all.

One or two of the app scripts have been fine tuned especially for this public release so if you find something wrong please leave a comment or send me an email.  However, the way you write a list remains the same.

What's new and what's changed?

1. Search function removed
Originally included as an all in one solution, I now think this feature is best dealt with separately.  To search the lists please use the existing search tool.

2. Packing list function
One of the first things I added was an automatically generated packing list on a separate (and hidden) sheet.  Here's an example of the data:

Now, when you print a list to a pdf, the above is incorporated on the second page as a simple checklist.  I've found this greatly reduces the chances of me turning up with a unit or two missing.

3. Archive function
I've added a new sheet called "Army Archive" to act as a temporary backup during list writing.

There's also a way to copy the "Army Archive" sheet to a new sheet (see below).  This is a more permanent archive as it won’t be overwritten like the "Army Archive" sheet.

4. Automation buttons #1
On the "List details" sheet there are four buttons:

The "Print" button exports the current list to an A4 pdf.  If you want to print a US letter pdf you'll have to print the sheet using the standard menus.

The "Archive" button overwrites the "Army Archive" sheet with the data from the "List details" sheet (which is why I view this as a temporary backup).

The "New version" button increments the version number by one: so list 45.0.1 becomes 45.0.2 and so on.  This enables you to create a series of lists for a given army and keep track of those you've printed as the list and version numbers are always printed.  You can always reset the version number manually by editing the approproate cell in the "Player choices" section.

The "Restore" button is the reverse of the "Archive" button.  It overwrites the data in the "List details" sheet with that from the "Army Archive" sheet.

5. Automation buttons #2
On the "Army Archive" sheet there are two buttons:

The "Copy current list" button does the same as the "Archive" button described above.

The "Duplicate" button creates a new sheet of the archived list data which prevents it being overwritten by any automated actions.   I use it to create a permanent archive once I've finsihed a list and have used it in a game.

6. Reset script
Perhaps the biggest change I've made is adding a script that clears all the user data from the "List details" sheet when the list number is changed.  This makes sense as usually the unit data won’t apply to the new army.

Unfortunately, it has the potential to be really frustrating.   So I have added a text warning to the cell:

"Beware! Changing this will remove all the data from the existing list. Print or archive the list before changing this cell if you want to keep a record of your work."

The warning (note the black triangle in the top right of the cell) is displayed when the cell is clicked and before any change is made.

If the army choice is changed, and list hasn’t been printed or archived, then the data is only retrievable by repeated use of the Undo function in the Google sheets menu.  You have been warned.

7.0 Suggested workflow
Rather using the writer to store all my lists (which can get a bit messy), I now create a copy of the master list writer spreadsheet for each of my armies.

Therefore, I have separate files for my Andalusian Arab, Ilkhanid, & Medieval Russian lists.  This makes it much easier to work on more that one list at once and I don't have to change the army choice very often.

8.0 Get a copy
You may be wary of using a spreadsheet containing macros or scripts.  Such scripts, no matter how benign, raise security concerns but it was the only way to provide additional functionality.  If you want to try the new version read on:

Disclaimer

The following link allows you to copy a version of the ADLG V4 Army List Writer spreadsheet and associated scripts to your Google Docs account.

You do so at your own risk and in the full knowledge that it comes with no warranty whatsoever.

Copy to your Google Docs account.

When you first open the spreadsheet you will be asked to authorize the various scripts.  Here's a worked example.

The original, script free, version is still available.

You need a Google account, and access to Sheets, to use this spreadsheet.  There will never be a downloadable version.  The spreadsheet uses a couple of powerful functions that are unique to Google Sheets and aren't in the likes of Excel.

Finally, please leave a comment if; you've used the spreadsheet, you've found any bugs, or you have any questions.

1 comment:

  1. Be aware the combination of Firefox and Google Sheets is less than ideal for running app scripts. You may have to refresh the sheet a few times before the buttons work. The latter is a bit random as they may work first time. It also helps setting the user agent to the Chrome/Windows combination with Mozilla's recommended user agent add-on.

    ReplyDelete

Comments are always welcome but this blog no longer accepts anonymous comments.