Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Trolls in the Cellar

Daren ThomasDaren Thomas158 downloads

Perchance-style random generators for tabletop RPG prep.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates6

Perchance-style random generators, written as plain Markdown, directly inside Obsidian.

Trolls in the Cellar turns notes into small creative engines. Write named tables in a troll-food block, add a troll-speak block, and Obsidian renders an interactive roller with copyable results in Reading view. It is built for tabletop RPG prep, but the format is plain enough for names, rumors, omens, loot, locations, prompts, and anything else that benefits from structured randomness.

Quick Example

# Trap Generator

```troll-food
template
  {element} {trap} triggered by {trigger}

element
  flaming
  icy
  poisonous

trap
  darts
  spears
  a spiked pit

trigger
  tripwires
  floor plates
  a jeweled skull
```

```troll-speak
table: template
count: 5
format: list
```

In Reading view, the troll-speak block becomes a roller with Roll and Copy buttons. The interactive widget currently targets Reading view. In editing mode, use the command Roll current note generator if you want to roll without switching views.

Troll Speak Blocks

Use a fenced troll-speak block to configure what gets rolled.

table: template
count: 10
format: list

Supported options:

  • table: the table to roll, defaulting to template
  • count: number of results to generate, from 1 to 100
  • format: list or paragraph
  • markdown: true to render results as Markdown (bold, italics, links, inline HTML); defaults to false, which shows results as plain text
  • source / sources: extra notes containing reusable troll-food blocks

When markdown: true, you can style the template itself and the formatting is rendered in the result:

template
  There's a **{enemy as villain}** lurking in *{location}*.

Markdown special characters in your tables (*, _, [[ ]], <b>) only take effect when the flag is on, so existing plain-text generators are unaffected.

The plugin also adds the command Roll current note generator, which rolls the first troll-speak block in the active note, copies the result, and shows it in a notice.

Table Syntax

Tables are plain text. A non-indented line starts a table. Indented lines are entries.

template
  A {condition} {item}
  [[100-500]] {coin_type} pieces

coin_type
  copper ^3
  silver ^2
  gold

Supported syntax:

  • {table} rolls once on a named table
  • [[min-max]] rolls an integer in a range
  • entry ^3 weights an entry by repeating it three times
  • {"one"|"two"} chooses one literal option
  • {{table_a}|{table_b}} chooses between table results
  • {"common"|"rare" ^4} gives extra weight to the last option
  • 3 x {table} rolls a table multiple times and joins the results
  • {table as name} rolls a table once and remembers the result as name
  • {name} reuses a remembered result, so the same roll appears again
  • \n inserts a line break inside an entry; use \n\n for a paragraph break (most useful with markdown: true, where it renders as real paragraphs)

By default every {table} reference rolls independently, so repeating {enemy} in one template gives a different enemy each time. To reuse the same rolled value, bind it once with as and then reference the bound name:

template
  There's a {enemy as villain} near {location}. Defeat the {villain} to win.

Both mentions of {villain} resolve to the same enemy, while {location} still rolls on its own. Bindings last for a single result, so each generated entry gets its own remembered values. A {name} that was never bound is left untouched, just like an unknown table reference.

The engine is intentionally small and practical. It uses repeated expansion passes with a recursion limit, so deeply nested generator syntax should stay simple.

Reusable Source Notes

For small generators, keep table data in the same note:

```troll-food
template
  {thing}

thing
  a brass key
  a cracked mirror
```

For large libraries, hide backing tables in Obsidian comments:

%% troll-food
template
  {thing}
%%

Then reference shared notes from a generator:

sources:
  - [[_tables/Common Generator Tables]]
  - [[_tables/NPC Generator Tables]]
table: npc
count: 6

source: and sources: accept wikilinks or vault-relative paths. Comma-separated source lists are also supported.

Markdown Dice Tables

Readable Markdown tables can also feed generators. If a Markdown table's first header cell looks like a dice or roll column, Trolls in the Cellar turns every other column into a rollable table.

## Character Goals

| d20 | Objective | Reason | Complication |
| --- | --------- | ------ | ------------ |
| 1   | Recover an heirloom | A debt is owed | A rival wants it too |
| 2-3 | Escort a witness | They know too much | The witness is lying |

From a note named Character Seeds, this creates:

{Character Seeds/Character Goals/Objective}
{Character Seeds/Character Goals/Reason}
{Character Seeds/Character Goals/Complication}

If a column name is unique within the page, a shorter page-level alias is also available:

{Character Seeds/Objective}

If a column name is unique within the note, a bare local alias is also available:

{Objective}

Ranges in the dice column weight entries. In the example above, the 2-3 row is twice as likely as the 1 row.

Columns are exposed as independent roll tables. If you combine several columns in one troll-food template, each column is rolled separately.

For compatibility with existing notes, Dice Roller links inside Markdown table cells are interpreted as Trolls table references at roll time. This is useful when imported Markdown tables already contain references to other roll tables. For example:

`dice: [[MazeRatsTables#^PhysicalEffects]]`

is interpreted as:

{PhysicalEffects}

Installation

Trolls in the Cellar is available in the Obsidian community plugin directory. In Obsidian, open Settings → Community plugins → Browse, search for Trolls in the Cellar, install it, and enable it. You can also install it from the community listing.

To track pre-release builds, install it with BRAT by adding this repository:

daren-thomas/trolls-in-the-cellar

For manual installation, copy main.js, manifest.json, and styles.css into:

.obsidian/plugins/trolls-in-the-cellar/

Then enable Trolls in the Cellar in Obsidian's Community Plugins settings.

Origin

This plugin began as an Obsidian adaptation of this CC0 generator template by Mike Shea:

https://github.com/mshea/lazy_gm_tools/blob/main/5e_artisanal_database/generators/generator_template/index.html

See NOTICE.md for source links and licensing notes.

License

Trolls in the Cellar is released under CC0 1.0 Universal. See LICENSE.

HealthExcellent
ReviewPassed
About
Create Perchance-style random generators directly in Markdown notes using troll-food tables and troll-speak blocks. Render interactive rollers in Reading view with Roll and Copy, handle named tables, ranges, weights, nested expansions, and multi-pass recursion for traps, names, loot, prompts, and other structured randomness.
TTRPGTemplating
Details
Current version
0.3.1
Last updated
2 months ago
Created
2 months ago
Updates
6 releases
Downloads
158
Compatible with
Obsidian 1.5.0+
Platforms
Desktop, Mobile
License
CC0-1.0
Report bugRequest featureReport plugin
Author
Daren ThomasDaren Thomasdaren-thomas
GitHubdaren-thomas
  1. Community
  2. Plugins
  3. TTRPG
  4. Trolls in the Cellar

Related plugins

Fantasy Statblocks

Create, manage and view a Fantasy Bestiary with Dungeons and Dragons style statblocks.

Solo RPG Toolkit

Helpful tools for playing TTRPG games, geared towards solo play with a GM emulator.

Templater

Create and use dynamic templates.

QuickAdd

Quickly add new notes or content to your vault.

Folder notes

Create notes within folders that can be accessed without collapsing the folder, similar to the functionality offered in Notion.

LifeOS

Life management system.

Charted Roots

Family tree visualization with GEDCOM/Gramps import and Canvas/PDF/Markdown export. Charts, maps, timelines, citations, fictional calendars. For genealogists, worldbuilders, and TTRPG campaigns.

Raindrop Highlights

Sync your Raindrop.io highlights.

Periodic Notes

Manage your daily, weekly, and monthly notes.

TTRPG Tools - Maps

A toolbox for interactive fantasy maps.