# Obsidian - Create Random Notes with ChatGPT Templates
![[images/Obsidian-Create-Random-Notes-with-ChatGPT-Templates.webp]]
[Watch on YouTube](https://www.youtube.com/watch?v=X9tlAZC6DSU) · 28:51 · Josh Plunkett · 2023-04-15
> Written from the video's full English automatic captions (en-orig track via yt-dlp), with the creator's chapter list as section anchors.
## Outline
### 00:00 Intro and demo: random notes without random tables
- Josh calls AI a "controversial rabbit hole" in TTRPG circles, but says it's a useful tool and he's going to play with it.
- GMs have always relied on **random tables**, but tables need maintaining. In Obsidian he's tried the **Fantasy Content Generator** plugin and **Inline Scripts**. He loves Inline Scripts, but it's JavaScript-heavy and intimidating for many users.
- The alternative: **Ctrl+U** opens a menu of his own templates from the **Text Generator** plugin. Picking one sends the template to **ChatGPT**, and a progress indicator shows in the status bar while it runs.
- **Generate store** returns the *Fantasia Emporium* (magic items, potions, artifacts), its owner **Morgana the Magnificent** with a physical description, and a wares table with prices.
- **Generate dungeon room** returns read-aloud text (a musty room of wet stone and dripping water), an ambush with a ready-to-run encounter block, a note on escalating the fight, and a DM warning callout about hidden pressure plates around an altar. "I didn't write any of that."
![[images/Obsidian-Create-Random-Notes-with-ChatGPT-Templates-t0215.webp]]
*A generated store note in the "Random Notes with Text Generator (ChatGPT)" scratch note: the Fantasia Emporium, store keeper Morgana the Magnificent, and a Wares table (item name, cost, weight) with a note that prices come from the Player's Handbook.*
### 03:42 Installation and setup
- Viewers who missed his earlier Text Generator video: Settings → Community plugins → turn off **Restricted mode** → Browse → search **Text Generator** (by Noureddine Haouari) → Install → Enable → open its options.
- **API key**: you need an account at **platform.openai.com**, and a **paid account** to keep using it (new accounts get some free starter tokens). Create a secret key, name it, copy it, and paste it into the plugin.
- **Set a hard usage limit** under Billing → Usage limits. The approved limit usually defaults to **$120 a month**. His usage after a night of building templates was about **13 cents**, but another AI plugin once burned through his **$30** limit in about an hour.
- **Model**: **gpt-3.5-turbo** (cheaper, his recommendation). **GPT-4** costs more and needed waitlist access at the time. Text-davinci models are also there. **Update models** pulls in more.
- **Max tokens** raised to **650** (the default was too low; much higher caused errors). **Temperature** raised from 0.7 to **0.8** for more randomness.
- **Prompt templates path**: `textgenerator/prompts`, a folder in his vault. Considered context: he includes the title, front matter, and headings. He ignores the PDF and web-page extractors.
- **Auto suggest** is on (trigger: space space). He enables **Calculate tokens** and **Calculate tokens for template** so the command palette can estimate cost.
![[images/Obsidian-Create-Random-Notes-with-ChatGPT-Templates-t0700.webp]]
*Text Generator v0.3.3 settings: OpenAI API key field, the Model dropdown open (gpt-3.5-turbo, gpt-4, text-davinci variants), and Default model parameters with Max tokens 650 and Temperature 0.8.*
### 09:26 Testing the plugin
- Types "players run through a dark forest", highlights it, and presses **Ctrl+J** (the default generate hotkey). ChatGPT continues the sentence with more text.
- **Space space** shows five autosuggest options. They come back about football players, because the plugin doesn't yet know this is a fantasy game, but the feature works.
- Reminder: every call costs money, though usually a tiny amount.
### 10:59 Templates
- The left ribbon has two Text Generator menus. The **Templates Package Manager** installs prompt packs: **DALL·E 2** image prompts (he hasn't made image generation work the way he wants yet), the **default prompts** (worth installing to learn from), and **Hugging Face** prompts (need a Hugging Face account).
- Installing creates `textgenerator/prompts` with subfolders. Warning: he manually deleted installed packs, and now he can't uninstall or reinstall them. Don't do that.
- His own templates live in a **Fantasy Generators** subfolder.
#### Anatomy of a template (Generate Inn)
- Front matter (`PromptInfo`): **promptId**, **name**, **description**, **author**, **tags**, **version**. The **name** field, not the filename, is what shows in the Ctrl+U menu. He adds emojis (beer, bed) with **Windows key + period**, which works in any note.
- The body is a series of headings, each with a plain-English **prompt:** line: inn name, inn description, innkeeper name and description, **menu** (two signature drinks and four meals as a Markdown table with name, cost, and description), **patrons** (five named people, names in bold), and **rumors** (one conversation the party might overhear).
- He admits he doesn't fully understand the template syntax yet and is "just scratching the surface".
![[images/Obsidian-Create-Random-Notes-with-ChatGPT-Templates-t1415.webp]]
*The Generate Inn template in `textgenerator/prompts/Fantasy Generators`: PromptInfo front matter (promptId GenInn, name with beer and bed emojis, author JoshP, tags fantasy and ttrpg, version 0.0.1), then prompt sections for Inn Name, Inn Keeper Name, and Menu.*
- **Run it**: open a note, edit mode, Ctrl+U → *Generate Inn*. It takes under a minute, so at the table trigger it early, as soon as the party heads toward an inn.
- Result: **the Rusty Anchor Inn**, a cozy seaside place on the rocky shores of a bay, with sounds and interior details. The innkeeper is "Captain Jack Sparrow's cousin" **Captain Morgan Sparrow**, which Josh notes is a sign the model leans on whatever the internet talks about most. The menu includes **Kraken's Blood** and **Mermaid's Tears** with prices. "I hate shopping in my games," so ready-made prices are a win. Patrons and a rumor hook follow.
![[images/Obsidian-Create-Random-Notes-with-ChatGPT-Templates-t1600.webp]]
*The generated inn note: Inn Name (The Rusty Anchor Inn), Inn Description, Inn Keeper Name (Captain Morgan Sparrow), and a Menu table with Kraken's Blood (5 copper) and Mermaid's Tears (10 copper).*
#### The encounter template and prompt tuning
- Prompt: generate a random encounter for **D&D 5e** for a party of **five level-5 players** (his current group), themed to `{{context}}`, meaning whatever text he highlights before running it.
- Rules he added after watching it misbehave:
- Use the exact encounter format given, but only if there is an encounter in the room (otherwise it left the template's example stat block in place).
- Remove or change the example monsters (once it added one monster but kept the goblin and orc).
- Always write monster names in the singular, because **Initiative Tracker** doesn't support plurals ("3: Goblin", not "3 goblins").
- Monster names must match the Monster Manual exactly, with no "Seaside Goblin" or "Beach Orc".
- Put the encounter block at the bottom, after all the descriptive text.
![[images/Obsidian-Create-Random-Notes-with-ChatGPT-Templates-t1745.webp]]
*The Generate Encounter template: PromptInfo front matter (promptId GenEncounter), the main prompt for a D&D 5e encounter for five level-5 players themed to {{context}}, the highlighted formatting rules, and the example encounter block (name: Example, creatures: 3: Goblin).*
- Demo: highlights "The party sneak through the land of lollipops", Ctrl+U → *Generate encounter*. Result: **Sweet Tooth Siege**, a gingerbread-and-candy cottage that starts to decay, goblins and orcs at the windows, a bigger creature, and options to escalate with an extra monster. He hasn't yet found how to force a line break before the encounter block.
#### More generators he built in one evening
- **Adventure job board**, **apothecary**, **armory**, **general store**, **magic shop**, **weaponry**, **dungeon room**, **encounter**, a joke **fungus** generator, **pocket search** ("you're searching the body, what do you find?"), and **Generate Adventure**, a hook for when you run out of ideas (it returned a town-square job board full of opportunities).
- **System-agnostic**: you can ask for anything. He shows a vehicle generator from another system and a **Mythic GM Emulator** Magic 8-Ball. It should work for Pathfinder, Shadowrun, or anything ChatGPT has learned about. He expects popular systems to work best, and **Pathfinder 2e** perhaps better than D&D because its mechanics are freely published online.
- Offline worry: keep a backup, but "this is game changing". There's no ever-growing list to maintain every time you buy a new book.
- **Third-party items**: one shop template asks for at least two items from **Kobold Press** (via the OGL) and links where to find them. The results include sources (KP vs Player's Handbook). PHB items auto-link to his existing notes, while Kobold Press items don't yet, so he'd add those notes if players buy them.
- He'll post the templates on his Patreon (and in the Patreon vault) and invites people to share their own on Discord to build a big shared repository. He made all of these in a couple of hours.
### 25:41 Check cost per template
- All his testing cost about **12 cents**.
- Command palette → **Text Generator: Estimate tokens for a template** or **for current document**. For the General Store it estimated about **0.002 cents**, which is negligible.
- If the option is missing, enable token calculation in the plugin settings.
- His takeaway: no more chasing fantasy generators. A quick template gives you a quick shop, maybe not perfect every time, but it speeds up shopping and gets the table back to adventure, combat, and role-play.
### 27:06 Obsidian TTRPG Community Discord
- His old Discord was Patreon-only. It grew big, and he didn't like it sitting behind a paywall, so the **Obsidian TTRPG Community** Discord is now open to everyone.
- Use the **self-service roles** channel to pick your interests. The **AI Enthusiast** role unlocks AI channels, including **Midjourney** image generation and chats with a ChatGPT bot.
### 28:23 Outro
- Thanks to Patrons. He's looking forward to seeing what people do with Text Generator templates.
## Things mentioned
### Obsidian plugins and features
- **Text Generator** (community plugin by Noureddine Haouari): Ctrl+U template menu, Ctrl+J generate, space-space autosuggest, Templates Package Manager, token estimates, considered-context options (title, front matter, headings), PDF and web-page extractors
- **Initiative Tracker**: encounter blocks (needs singular monster names that match the bestiary)
- **Fantasy Content Generator** and **Inline Scripts** (the earlier random-table approaches)
- Core: Community plugins / Restricted mode, command palette, edit mode, front matter, Markdown tables, callouts
### AI services and models
- **OpenAI** platform (paid account, API keys, billing usage limits)
- **ChatGPT / gpt-3.5-turbo** (recommended), **GPT-4** (waitlist at the time), **text-davinci** models
- **DALL·E 2** prompt pack, **Hugging Face** prompt pack
- **Midjourney** (Discord AI channel)
### Templates he built
- Generate Inn, Generate Encounter, Generate Store / General Store, Apothecary, Armory, Magic Shop, Weaponry, Dungeon Room, Adventure Job Board, Generate Adventure, Pocket Search, Fungus, vehicle generator, Mythic GM Emulator Magic 8-Ball
- Available from [Josh's Patreon post](https://www.patreon.com/posts/obsidian-create-81545279)
### TTRPG systems and products
- **Dungeons & Dragons 5th Edition** (Player's Handbook, Monster Manual)
- **Pathfinder 2e**, **Shadowrun**
- **Kobold Press** items (via the OGL)
- **Mythic GM Emulator**
- Generated examples: Fantasia Emporium (Morgana the Magnificent), the Rusty Anchor Inn (Captain Morgan Sparrow; Kraken's Blood and Mermaid's Tears), Sweet Tooth Siege
### Community and links
- [Obsidian](https://obsidian.md/)
- [Obsidian TTRPG Community Discord](https://discord.gg/8AF29UBUCa) (now free and public; AI Enthusiast role)
- [Official Obsidian Discord](https://discord.gg/obsidianmd)
- [Obsidian TTRPG Users Facebook group](https://www.facebook.com/groups/obsidianttrpgusers)
- [Josh's Patreon](https://www.patreon.com/JPlunkett)
### Free vs paid (quick)
- Free: Obsidian, Text Generator, Initiative Tracker, the Discord
- Paid: OpenAI API usage (cents per run here; set a hard monthly limit), Josh's Patreon for the templates
## Bios
- **Josh Plunkett**: Australian GM and educator behind Obsidian TTRPG Tutorials (YouTube, Patreon, Discord). In this video he runs a five-player level-5 D&D 5e group and builds ChatGPT prompt templates to replace his random tables.
- **Noureddine Haouari**: Developer of the Text Generator plugin for Obsidian, which connects notes to OpenAI and other AI models. Josh credits him by name while installing it.
- **Morgana the Magnificent** and **Captain Morgan Sparrow**: AI-generated NPCs from the demo (a magic-shop owner and an innkeeper). The innkeeper is billed as **Captain Jack Sparrow's** cousin, the *Pirates of the Caribbean* character, which Josh uses as an example of the model echoing popular internet content.