/!\ Currently WIP, but the barebones parser should work (follow the instructions in How to Use)
A QuickAdd template, intended to be used to parse 13th Age monster statblocks from books (as pdf, both 1st and 3rd party) and display them using Fantasy Statblocks.
This repo does not include any actual statblocks, the tools within are to be used to parse statblocks and create them in your own vault. In the future (meaning, when this parser is working, and we started using it to actually parse monsters), I recommend checking out the Obsidian TTRPG Community's 13th Age SRD repo to find monster statblocks and rules related to 13th Age.
- CustomJS: to run the parser's Javascript from a dedicated script file
- QuickAdd: to create a file from the template via prompters
- Fantasy Statblocks: to render the statblocks
- Install and enable the needed dependencies in your vault
- From this repo, download the
assets
folder and its content, and put them somewhere in your vault (I like having anassets
dir at the root of my vaults to group this kind of files and be able to locate them easily with core functionnalities and plugins). The suggested structure is:
assets
|- scripts
| |- 13A-monster-parser.js
|- templates
|- monster-statblock-parser.md
- In the CustomJS config, in the
Individual Files
field, put[/path/from/vault/root]/assets/scripts/13A-monster-parser.js
(or the path you've chosen pointing to the parser's JS file) - In the QuickAdd config:
- Put the path to your template folder (containing the template from this repo) in the
Template Folder Path
field - Create a
Template
choice, named however you want (e.g.13th Age Monster Parser
) - Click on
Configure [template-name]
(in the list of choices, the small cog right of your newly created choice), then- In
Template Path
, put the path to the template (the field is a suggester, so you can type13A-monster-[etc.]
to find it easily) - Enable
File Name Format
, then put{{value}}
in the field - Enable
Create in Folder
(to be able to choose where the new file will be created), then configure which folder you want for that- Enabling
Choose Folder when creating a note
allows you to put the new note anywhere in your vault, or - Disabling that, and selecting a few dedicated folders can help you centralise your monsters
- Enabling
- Disable
Create in same folder as active file
- Disable
Append Link
- Enable
Set default behavior if file exists
, and chooseNone
, so that you don't overwrite your existing monsters when you import a new one (this can happen if 3rd party publishers choose the same name as an official monster, or 2 publishers name their monsters the same, or if you import the same monster by accident) - You can enable
Open
, and then selectSource
to open the newly imported monster when finished (to check that everything was imported correctly) - For
New Split
, choose which behavior you prefer (I prefer disabling it) - Enable
Focus new pane
to focus the newly created note when finished
- In
- Put the path to your template folder (containing the template from this repo) in the
- In the Fantasy Statblocks config:
- If you're prepping for a 13th Age campaign, I suggest putting the
Default Layout
config toBasic 13th Age Monster Layout
so that you don't have to add thelayout: Basic 13th Age Monster Layout
line to your statblock YAML config everytime. - For the rest, the module can do a lot more than just rendering statblocks, so configure it to your needs and liking.
- If you're prepping for a 13th Age campaign, I suggest putting the
First,
Then, setup CustomJS and QuickAdd following the instructions. For QuickAdd, there are 2 options provided:
- manually Copy/Paste the raw text from the page in your browser -> Use 13A-srd-monster-statblock-parser.md as the QuickAdd template
- After downloading the full page of monsters (I recommend using https://github.com/deathau/markdownload which will retain the HTML for the monster's table), copy/paste the HTML code for the monster -> Use 13A-srd-monster-statblock-html-parser.md as the QuickAdd template
Then, you can trigger QuickAdd to create a new note using the option you just created.
Here's an example of import from the SRD's HTML:
parse-dragon-from-html-table.mp4
For now, the parser only exists as a minimalist set of prompters. In order, the parser will prompt you for:
- The monster's Description
- This is the top of the statblock, which contains: the Monster's Name, its Flavor text, the "Strength" line (e.g.
Large 8th level wrecker [giant]
for the Fire Giant), its Initiative bonus and its potential Vulnerability - /!\ Important manual step: Make sure that the monster's name on its entirety is on the first line, because the parser has no way of distinguishing between a potential second line of the monster's name and the start of it's flavor text
- This is the top of the statblock, which contains: the Monster's Name, its Flavor text, the "Strength" line (e.g.
- The monster's Attacks
- All the lines containing attacks, including any
[Special Triggers]
if there are any present - The expected format is
[Attack Name] [Attack Bonus] vs. [Target's Defense] [(Any additional info, like # of targets)]—[Effect]
- /!\ Important manual step 1: All attacks' names must be on 1 line (until and including the em-dash), because the parser cannot distinguish between the start of a new attack line and the end of a potential description or trait from a previous attack. The description can be on multiple lines.
- /!\ Important manual step 2: If there are any traits to the attack (expected format
[Trait Name/Roll trigger]: [trait effect]
), their name must be on a single line (up to and including the semicolon), because the parser cannot distinguish between the start of... same thing as the attacks.
- All the lines containing attacks, including any
- The monster's Traits, if any
- Any traits not linked to an attack
- /!\ Important manual step: If there are any traits (expected format
[Trait Name/Roll trigger]: [trait effect]
), their name must be on a single line (up to and including the semicolon), because the parser cannot distinguish between the start of... same thing as above.
- The monster's "Nastier Specials", if any
- Any traits grouped under the
Nastier Specials
heading - /!\ Important manual step: If there are any traits (expected format
[Trait Name/Roll trigger]: [trait effect]
), their name must be on a single line (up to and including the semicolon), because the parser cannot distinguish between the start of... same thing as above. - /!\ Important note: If a nastier adds an attack to the monster, do not put it in this prompt. The parser will not be able to interpret it correctly, put it in the next section
- Any traits grouped under the
- the monster's "Special Triggers", if there are some not included in its attacks
- Sometimes, a trait will have a triggered action that is not labeled
[Special Trigger]
(looking at you, Fire Giant and the nastier Strength of Giants). Just put every remaining attacks in this prompt
- Sometimes, a trait will have a triggered action that is not labeled
- the monster's Defenses
- AC, PD, MD and HP. If you copy paste from a book, they should be on a line each. If not, manually put each on their dedicated line.
After that, the prompter should close, and your newly imported monster's note should open inn your current Obsidian view. If you get an error message during the process, check the format of the blocks (the parser usually throws an exception in the middle if something goes wrong), and if it still doesn't work, open an issue here with the incriminating statblock, and I'll take a look at it.
Here's a picture showing which part of the monster's statblock is which block:
In no particular order:
- Write parser for the various blocks in a monster Statblock
- Monster Desc,
- Attacks
- (including Triggered Attacks),
- Traits,
- Nastier Specials,
- Defenses
- Write the YAML Writer
- Monster Desc,
- Attacks
- (including Triggered Attacks),
- Traits,
- Nastier Specials,
- Defenses
- Write a barebones QuickAdd prompter
- Intended order of prompting:
- Monster Desc,
- Attacks
- (including Triggered Attacks),
- Traits,
- Nastier Specials,
- Defenses
- Put all that in a Markdown file to be used as a QuickAdd template
- Write a cleaned-up prompter with which you can choose which block to parse next
- Add a prompter to manually enter single attacks or partial attack blocks (triggered or not) and traits (because the 13A official statblock format is only 90% standardized >.> )
- Create a Templater variant that can add partial monster data.
- Add a full parsing example with pictures and explicative text.