// 1) Prompt for Place name
const title = await tp.system.prompt(āEnter Place Nameā, tp.file.title);
if (!title) return;
await tp.file.rename(title);
// 2) Gather all container notes from 2-World/Hubs
const containerFiles = tp.app.vault.getMarkdownFiles()
.filter(f ā f.path.startsWith(ā2-World/Hubs/ā));
// 4) Build wiki-link or fallback
let wikiLink = null;
if (chosenPath !== placeholderPath) {
const alias = chosenPath.split(ā/ā).pop().replace(/.md/,"");wikiLink=ā[[{chosenPath}|${alias}]]`;
}
// 5) Pick a category from your list
const categoryOptions = [
āCommerceā,
āAgricultureā,
āMilitaryā,
āPhilosophyā,
āIndustrialā,
āNestingā,
āGovernmentā
];
const chosenCat = await tp.system.suggester(categoryOptions, categoryOptions, true);
if (!chosenCat) return;
// 6) Write to frontmatter
setTimeout(() ā {
const file = tp.file.find_tfile(tp.file.path(true));
if (!file) return;
app.fileManager.processFrontMatter(file, fm ā {
fm[āMyContainerā] = wikiLink ?? āNoneā;
fm[āMyCategoryā] = chosenCat;
});
}, 100);
BUTTON[button_person] The following people are associated with this place.
properties: file.name: displayName: Star Systems Name note.MyCategory: displayName: Type of Star System note.char_race: displayName: Race note.char_gender: displayName: Gender note.char_age: displayName: Ageviews: - type: cards name: Star Systems - Cards filters: and: - file.folder == "2-World/People" - list(MyContainer).contains(this) - char_status.contains("Alive") order: - file.name - char_age - char_gender - char_race image: note.image - type: table name: Star Systems - Table filters: and: - file.folder == "2-World/People" - list(MyContainer).contains(this) - char_status.contains("Alive") order: - file.name sort: - property: file.name direction: DESC columnSize: file.name: 182
GM Notes
Make notes of what you need to track in the town here.
Selling
The following items are available for purchase.
// This dataviewjs code grabs a random item(s) from the folder below. You can remove this if that's not useful. It's an example of what's possible. // 1. grab all pages in the folderlet pages = dv.pages('"3-Mechanics/Items"').values;// 2. shufflefor (let i = pages.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [pages[i], pages[j]] = [pages[j], pages[i]];}// 3. take the first X where (0, X) should be the number of items to returnlet pick = pages.slice(0, 1);// 4. render table of clickable links + Genderdv.table( ["Random Item", "cost", "weight"], pick.map(p => [ dv.fileLink(p.file.path), // clickable note link p.cost ?? "ā", // frontmatter field (falls back to āāā if missing) p.weight ?? "ā" // frontmatter field (falls back to āāā if missing) ]));