a fantasy name generator for Obsidian
翻譯準備中
外掛TypeScript · CSSGitHub @Gregory-Jagermeister自行安裝營運者未確認
試用過了嗎? 點一下就好,不需要登入。
正在載入完整 README。 以下為已儲存的摘錄。
An Obsidian plugin that fills your notes with names, inns, settlements, loot and more for any tabletop RPG or world, and lets you build your own generators from plain notes.
Renamed from Fantasy Content Generator in 1.6.0. Nothing changes for you: settings, hotkeys and scripts keep working.檢視完整 README ↗An Obsidian plugin that fills your notes with names, inns, settlements, loot and more for any tabletop RPG or world, and lets you build your own generators from plain notes.
Renamed from Fantasy Content Generator in 1.6.0. Nothing changes for you: settings, hotkeys and scripts keep working.
@ in any note: type @ and a generator's name (for example @Dwarvish) to drop a result where you're writing.@Dwarvish (or the set you added) and press Enter.Run New custom generator for a starter note in your generator folder, or write one like this:
---
fcg-generator: Tavern regulars
---
```pattern
{Name} the {Job}, who drinks {@Drinks}
```
## Name
- Name A
- Name B
## Job
- Job A
- Job B
{Name} picks from the list under ## Name, and {@Drinks} calls the built-in Drinks generator. Replace the placeholder words with your own, then type @TavernRegulars in any note.
From there you can add dice ({2d6}), tables rolled with a die, {#if $wealth > 60: … | …}, loops, maths and calls to other generators ({@InnsTaverns}). The full guide and every pattern rule are on the wiki.
Generators can hand values to each other. If you have a Tavern generator, {@Tavern $wealth=$wealth $race=Dwarf} runs it with that wealth and race. A generator that's called on its own can set its own fallback with {$wealth ?= 1d100}.
Run Add the village example to get a village, building and owner generator that work this way. With the Templater plugin, the Build a village script on the wiki turns them into a folder of linked notes: a village, its buildings and their owners.
Any plugin that runs JavaScript can use the generators:
const fcg = app.plugins.plugins["fantasy-content-generator"].api;
fcg.generate("InnsTaverns"); // text
fcg.generate("Tavern", { wealth: 70, race: "Dwarf" }); // with values passed in
fcg.generateData("ExampleVillage"); // { text, values: { name, wealth, race } }
fcg.keys(); // every key
The id stays fantasy-content-generator after the rename. Details on the wiki.
Every setting shows up in Obsidian's settings search.
| Where | What you can change |
|---|---|
| Main page | The inline trigger (@), the default amount, which groups show, reset to defaults |
| Custom generators page | The generator folder, new generator, starter sets, the village example, and the generators found with their problems |
| Currency page | Whether loot includes coins, how often, and your currencies |
| Settlements, Inns and taverns, Drinks, Loot, Dungeons pages | The word lists the built-in generators use: add with +, remove with ×, a filter box on each list, and import or export as a .json file |
The starter sets are built from:
1.6.1: settings rebuilt so they show up in Obsidian's settings search (needs Obsidian 1.13.1).
1.6.0: renamed to TTRPG Content Generator; the generator panel; patterns in notes; if/else, loops and maths; passing values between generators; the village example. Full list and older versions in CHANGELOG.md.
Bug reports and pull requests are welcome. See CONTRIBUTING.md.
npm install
npm run dev # rebuilds main.js on every change (put the repo in a vault's .obsidian/plugins folder)
npm run build # type check and production build of main.js
npm run lint # Obsidian's own lint rules (eslint-plugin-obsidianmd)
npm test # unit tests