Skip to content

Writing generators

Daniel Stirba edited this page Oct 6, 2026 · 1 revision

Writing generators

A generator is a note in your generator folder (set in Settings › Custom generators; subfolders count too). Run New custom generator to start one.

The smallest generator

---
fcg-generator: Tavern regulars
---
```pattern
{Name} the {Job}
```

## Name
- Name A
- Name B

## Job
- Job A
- Job B
  • fcg-generator names it and makes the note a generator.
  • The ```pattern block is what it writes. {Name} picks one item from the list under ## Name.
  • Its key is the name with each word capitalised and the spaces removed: type @TavernRegulars in any note.

Everything else in the note (like explanations) is ignored, so write notes to yourself freely.

Properties

Property What it does
fcg-generator: <name> Makes the note a generator
fcg-key: <Key> Its key, if you want a different one (no spaces)
fcg-capitalize: true Capital letter at the start of each result
fcg-capitalize: words Capital letter at the start of every word
pattern: / patterns: The old way to write patterns (still works). A ```pattern block wins if a note has both

Patterns

  • Write the pattern in a ```pattern block, exactly as the result should look. It can run over several lines and keep Markdown.
  • Several blocks: one is picked at random each time. Copy a block to make it twice as likely.
  • Inside {…} you can pick from lists, roll dice, call other generators, use if/else and loops: see Pattern reference.

Lists

A list is a ## Heading followed by - item lines (* and + work too). A # Heading (one #) ends the lists above it; code blocks are skipped.

Write What it does
- Item A | 3 That item is three times as likely
- Small: {1d8 + 4} A keyed row: {List: Small} looks it up by its key
- Item {Other} Rows can hold patterns too: {Other} is filled in when the row is picked

Tables rolled with a die

## Wealth (d20)
- 1-5: Row A
- 6-15: Row B
- 16-20: Row C

{Wealth} rolls a d20 and takes the matching row. {Wealth + 2} adds a modifier (kept inside the first and last rows), {Wealth with d6} rolls another die, and {Wealth: 12} picks the row for 12. The problems list warns about gaps and overlaps.

Learn lists: new names in the style of samples

## First (learn)
- sample one
- sample two
- … (at least 10)

Picking from a (learn) list makes a new name that sounds like the samples, never one of the samples. (learn 4-9) limits the length; without it, names are as long as your shortest to longest sample. A batch tries to start each name with a different letter.

Meaning lists: names that say what they mean

## Land (meanings)
- nönd = stone
- skök = iron

## War (meanings)
- trind = helmet

Each row is word = meaning. Picking prints the word and remembers the meaning, so a generator that uses meaning lists also gets a + meaning version (key + Meaning, for example @DwarvishMeaning). With the pattern {First} {Land}{War} it gives Durak Nöndtrind, and the + meaning version Durak Nöndtrind (stone-helmet).

  • Meanings within one word join with "-", separate words with ", ".
  • {Land.meaning} prints the meaning side (stone).
  • {Land: stone} looks up the word for a meaning.

Problems

Settings › Custom generators lists every generator found and any problems: a list that doesn't exist, a table with gaps, a key used twice, a pattern that can't work. Fix them there before using the generator.

Ideas

  • Use one generator inside another: {@InnsTaverns}, {@Dwarvish}.
  • Pass values between them to build connected things: see Build a village.
  • Start from a built-in: Make it your own in the generator panel.

Clone this wiki locally