Tuesday, September 22, 2015

VBA for D&D

First post since June: I haven't been playing or working on D&D much recently. So it goes.

Today I'll dive into some of the work I have been doing on D&D: working on some VBA functions for Excel. These functions are designed with the goal of simplifying my Excel files which track combatants. Over time, they've gradually gotten more complicated. The last iteration looked something like this:
Rows are combatants; columns are information (including damage taken)
The new version looks more like this:
Columns are combatants; rows are information
Aside from a colour change and flipping the table's axes, I've also added a fair bit of VBA code. Right now, I have code for checking whether a character's class is valid based on their ability scores, code for reducing a character's ability scores based on how far below 0 health they are and code for calculating a character's experience earned. I also have a long VBA-free function for calculating a character's THAC0 against a given combatant.

I'll be posting the code up in my section of the Tao of D&D Wiki, where I am now a moderator. Enjoy!