A Story template is a special kind of record that can generate new story records from other information in the same campaign. They can be used for any number of purposes to generate descriptions of places, npcs, items or indeed anything pertinent to the campaign.
To access the list of Templates in the campaign click on the "Templates" button in the Story records campaign list. New story records can be generated from the template by clicking on the "Generate" button at the bottom of the story template record window.
As part of the generation of the new story record, the template will look for special text information that it will generate replacements for. The new story record will be placed into the current campaign story listing, and the story record will be displayed.
To illustrate the potential of this new feature let us walk through an example. We'll create a Template which we can use any number of times to generate a general store that the PCs might visit during their travels. We want it to have a name, a brief description of the proprietor and the building and also we want a list of goods that are for sale. We could also place a limit on the number of gold pieces that the store might have available to buy surplus gear from the party and also work out how expensive the goods are in the shop.
In order to achieve all of this we are going to need a large number of tables that our template will use to generate our story entry. We want a table for the first and last name of the business and one each for the exterior and interior description. We'll also need some tables to describe the proprietor and a few more tables from which we can generate stock. The graphic on the right shows some of the tables that I created for this example.
As you can see most of them are straightforward and very simple tables. Note, however he Magic Item Stock table. This one rolls a random number of times on a table from the Dungeon Master's Guide. In order for the Template to work this module will need to be open in the Library. For more information on creating tables see the tables article.
Once you have all of your resources in place you can start building your template. Click on Story from the menu down the right hand side and then on the 'Templates' button on the top of the window that opens to create a new, blank, template.
A Template is very like a normal story entry in many respects and so it will accept formatted text including headings, bold, italic, tables, lists and speech bubbles. So let's give the Template a name 'The Village Store'.
First up we want to give the store a description including a name. So we can create a new heading 'Building' and under that we can start creating the template. Type in 'Name:' and then after it put the name of the tables we will be using for the shop's name; so we end up with:
Name: [Name One] [Name Two]
When you generate the story from this template it will print out 'Name:' onto the story and it will then call the table [Name One] where it will roll a random entry from that table and place it in the story replacing [Name One]. It will then do the same for [Name Two]. What you end up with then is something like 'Name: Bob's Shop'. Anywhere that you want the template to access a table and get a result from that table you enclose the table name in the template with square brackets [ ].
So go ahead and fill out the first part of the Template with the description of the building and the proprietor. If you then click on the 'Generate' button at the bottom of your template a new story will be created and, if all has gone well, it will have filled in the table names with the results of rolling on those tables. You should end up with something approaching the graphic ion the right.
Next up we'll tackle the store's inventory. For the purpose of this example the store will contain a bit of everything, some gear, weapons, armor and a magic item or two. If you look at the graphic on the right you'll see all the possibilities for calling a table from a template. Not only can we simply add the table name but we can also call the table a number of times including a random number of times.
For the weapons we have decided to roll 1d6 times on our weapons table so the syntax for that is [1d6x][Weapons Stock]. This is exactly the same syntax that you would use in a table to call another table a random number of times. For Gear we want a certain minimum number so we have used [1d10+4] which will give us between 5 and 14 items of gear. For Armor we just want two items so we have just called the armor table we created twice in two separate lines. The Magic Items we have done a slightly different way by creating a table which calls another table from the Dungeon Master's Guide a random number of times.
Note that we have linked the items in the tables we are calling so the template recreates those links in the story entry and those can then be dragged to a parcel or to a player or the whole story can be shared with a player or the entire group.
The graphic on the right shows how we've built the template to include the stock items and the resulting story entry.
We don't need to call tables in the template, we can also use random numbers to generate information. In our case we want to have a limit to the number of gold pieces that the shop has available and also to have a number we can refer to when calculating how much more expensive the items for sale are compared to the normal prices. To do this we once again need square brackets but this time we just put in a dice function. So if we want a random number between 1 and 5 we need [1d6]. The graphic on the right shows the two functions we need to create the gold prices and the percentage price increase.
A Chat Bubble
Story Templates have one last thing that we can do; we can create a speech bubble which can include some of the information that we have randomly generated. To do this we create a sentence or two of text and where we want to insert one of the randomly generated items in our template we insert the same name as the table we called but this time we use <> instead of square brackets. For example the name of our store is [Name One][Name Two]; to include this in a sentence we would write something like - 'The name of the store is <Name One> < Name Two>. When the story is generated from the template whatever is in the brackets is replaced with the results that were previously rolled up on the tables.
The graphic on the right shows the template structure and the final text after the story has been generated.
Bracketed Text 
The story generation feature will attempt to resolve bracketed text in the following order:
- Evaluate dice strings
- Only if bracketed text is a valid dice string
- Ex: [1d4+10]
- Evaluate table multipliers
- Only if bracketed text is a valid dice string ending with a 'x'
- Ex: [1d6x]
- Evaluate table lookups
- Only if bracketed text is the name of a table in the current campaign
- The bracketed text may be following by a pipe symbol '|' and a number to denote a single column lookup on a multi-column table
- Ex: [250 gp Art Objects], [Slashing Criticals|2]
- If the table contains multiple columns, then each lookup result will be combined for the final result.
- If preceded by a table multiplier tag, multiple table lookups will be done, and combined.
- Any table non-link result text will be saved for tagged text replacement (see below).
- Do nothing, but remove brackets.
When each bracketed text entry is evaluated, the results are used to replace the bracketed text.
Tagged Text <>
The story generation feature will attempt to replace any tagged text with the results generated from a table with a name matching the tagged text. (see bracketed text table lookups above) If the tagged text refers to a table that does not exist, or which was not used in the story template, it will be ignored.