Constructing encounter tables using Nisus
If you use the method in the Adventure Guide’s Handbook for creating encounter tables, you’ve probably sometimes made mistakes totting up the ranges. What I usually do is work out the percentages first, using my word processor’s “sum column” function to make sure the sum of the percentages is always 100. Then, I manually create the d100 roll ranges; if I make a change to the percentages, I end up having to manually change the ranges.
It recently occurred to me that it should be easy to automate this in Nisus Writer Pro; turns out, it is. Let’s say I have the following table:
| Animals | 34% |
| Dinosaurs | 25% |
| Insects | 21% |
| Saurians (1d20) | 18% |
After I run the macro on it, I’ll have:
| 01-34 | Animals | 34% |
| 35-59 | Dinosaurs | 25% |
| 60-80 | Insects | 21% |
| 81-98 | Saurians (1d20) | 18% |
And I’ll know immediately that I’m missing 2% in the percentage totals. If I add one to animals and one to insects, I can re-run the macro to get:
| 01-35 | Animals | 35% |
| 36-60 | Dinosaurs | 25% |
| 61-82 | Insects | 22% |
| 83-00 | Saurians (1d20) | 18% |
Here’s the macro. If you have Nisus Writer Pro, you can copy this and then save it in your Macros folder as something like “Calculate Encounter Rolls.nwm”.
[toggle code]
- # check if there is a table selection
- $document = Document.active
- $tableSelection = $document.tableSelection
-
If Defined $tableSelection
- $table = $tableSelection.table
-
If $table.columnCount < 2
- Prompt "Encounter tables must have a creature column and a percentage column."
- Exit
- End
- #Add the third column if it doesn't exist yet.
-
If $table.columnCount < 3
- Select Table Cell 1, 1
- Menu "Table:Insert:Column to the Left"
- End
- $currentRow = 0
- $bottomOfRange = 0
-
While $currentRow < $table.rowCount
- $percentage = $table.textAtRowAndColumn $currentRow, 2
-
If $percentage == ""
- Prompt "Found empty cell. Exiting."
- Break
- End
- $topOfRange = $bottomOfRange + $percentage
- $bottomOfRange = $bottomOfRange + 1
- $cell = $table.textAtRowAndColumn $currentRow, 0
- $replacementRange = Range.new(0, $cell.length)
- #Handle single-digit numbers and 100s
-
If $bottomOfRange < 10
- $bottomOfRange = "0$bottomOfRange"
-
Elsif $bottomOfRange == "100"
- $bottomOfRange = "00"
- End
-
If $topOfRange < 10
- $topOfRange = "0$topOfRange"
-
Elsif $topOfRange == "100"
- $topOfRange = "00"
- End
-
If $bottomOfRange == $topOfRange
- $range = $bottomOfRange
-
Else
- $range = "$bottomOfRange-$topOfRange"
- End
- $cell.replaceInRange $replacementRange, $range
- $bottomOfRange = $topOfRange
- $currentRow = $currentRow + 1
- End
- Menu "Table:Fit to Contents"
-
Else
- Prompt "Select inside an encounter table to use this macro."
- End
- The Adventure Guide’s Handbook
- Weave fantasy stories around characters that you and your friends create. As a Gods & Monsters Adventure Guide you will present a fantastic world to your players’ characters: all of its great cities, lost ruins, deep forests, and horrendous creatures.
- Nisus
- I use Nisus Writer Pro for almost all of my new documents now. It’s a lot easier to use than the other word processors I’ve tried.
More gaming tools
- Automatically grab flavor text snippets in Nisus
- In Nisus, it is very easy to grab all text of a specific style, and its nearest heading. This makes it easy to make “room description cards” for handing to the players after reading them.
- hexGIMP for old-school wilderness maps
- The isoMage has a script and brushes for GIMP that make it easy to create old-school TSR-style outdoor maps.
- How to use hex maps
- Rob Conley describes the benefits and tricks of using hex maps.
- Online die roller
- In need of a quick die roll to pass the time? Look no further!
- Portable speakers for Adventure Guides
- If you have audio in your adventures, there are a lot of portable speakers available designed to work with MP3 players.
- 11 more pages with the topic gaming tools, and other related pages
More Nisus
- Nisus Writer Pro 2.0
- The new Nisus is pure awesome: very easy to use, and it does everything I need.
- Automatically grab flavor text snippets in Nisus
- In Nisus, it is very easy to grab all text of a specific style, and its nearest heading. This makes it easy to make “room description cards” for handing to the players after reading them.
- Stack windows on top of each other
- If you want to stack multiple windows directly on top of each other, it’s easy to do in any well-behaved application, such as Nisus Writer Pro, Safari, Mail, and even older applications like AppleWorks 6 and Microsoft Word X.
- Nisus HTML conversion
- New features in Nisus’s scripting language make HTML conversion almost a breeze.
- Nisus “clean HTML” macro
- The Nisus macro language is Perl; this means we can use all of Perl’s strengths as a text filter scripting language in Nisus.
More wandering monsters
- Wandering monster chart assistant
- Use the encounter chart assistant to create wandering monster charts using percentages rather than ranges. Copy your tables into this tool to make sure they add up, adjust them, then copy them back out to your word processor. Never worry about missing or overlapping ranges again!
- I brake for wandering monsters
- How do you create a random encounter table? With love and baling wire.
