<%*
// 1) Rename if title starts with āNewHubā let title; if (tp.file.title.startsWith(āNewHubā)) { title = await tp.system.prompt(āEnter Hub Nameā); if (!title) { new Notice(āNo name entered. Aborting.ā); return; } await tp.file.rename(title); } else { title = tp.file.title; }
// 2) Gather all region files under 2-World/Regions const regionFiles = tp.app.vault.getMarkdownFiles() .filter(f ā f.path.startsWith(ā2-World/Regions/ā));
const placeholderLabel = āš No Region Selectedā; const placeholderPath = āplaceholderā;
// 3) Suggester for picking region (with placeholder) const regionChoices = [placeholderLabel, ā¦regionFiles.map(f ā f.basename)]; const regionValues = [placeholderPath, ā¦regionFiles.map(f ā f.path)]; const chosenPath = await tp.system.suggester(regionChoices, regionValues, true); if (!chosenPath) return;
// 4) Build the wiki-link or fallback let wikiLink = null; if (chosenPath !== placeholderPath) { const chosenAlias = chosenPath.split(ā/ā).pop().replace(/.md{chosenPath}|${chosenAlias}]]`; }
// 5) Prompt for Hub type (MyCategory) const categoryOptions = [ āCity +1500ā, āTown +200ā, āVillage +80ā, āHamlet <80ā, āEncampmentā, āKeepā, āFortressā, āStrongholdā ]; const chosenCat = await tp.system.suggester(categoryOptions, categoryOptions, true); if (!chosenCat) return;
// 6) Write both properties into frontmatter setTimeout(() ā { const newFile = tp.file.find_tfile(tp.file.path(true)); if (!newFile) return; app.fileManager.processFrontMatter(newFile, fm ā { fm[āMyContainerā] = wikiLink ?? āNoneā; fm[āMyCategoryā] = chosenCat; }); }, 100);
%>
Parent Region:
INPUT[inlineListSuggester(optionQuery(#Category/Region)):MyContainer]
Column
Map
id: ZalkorsFerry ### Must be unique with no spaces image: [[Zelkor's Ferry.png]] ### Link to the map image file. Do not add a ! in front of the image bounds: [[0,0], [5000, 4025]] ### Size of the map in px Height_y, Width_x. Ignore 0,0 height: 500px ### Size of the leaflet embed in px on your screen width: 95% ### Size of the leaflet embed in your note lat: 2500 ### To center the map, make this half of the map height. long: 2012.5 ### To center the map, make this half of the map width. minZoom: -3 ### Controls how far away from the map you can zoom out. Hover over the target icon to see the current level. maxZoom: 1 ### Controls how far towards the map you can zoom in. Hover over the target icon to see the current level. defaultZoom: -3 ### Sets the default zoom level when the map loads. Hover over the target icon to see the current level. zoomDelta: 0.5 ### Adjust how much the zoom changes when you zoom in or out. unit: mi ### The value displayed when measuring so you know what type of unit is being measure. scale: 0.09328358208955223 ### Real units/px (resolution) of your map recenter: false darkmode: false ### markerTown Name
INPUT[select( option(1, ā¹ļøGeneral), option(2, šāāļøāā”ļøNPCs), option(3, šGM Notes), option(4, šTravel), class(tabbed) )]Tabbed
NOTE
INPUT[select( option(1, šCommerce), option(2, šAgriculture), option(3, āļøMilitary), option(4, šPhilosophy), option(5, āļøIndustrial), option(6, š Nesting), option(7, šGovernment), class(tabbed) )]Tabbed
General
Select Settlement: INPUT[suggester(optionQuery(#Category/Region)):MyContainer]
Select Category: INPUT[template-hub-category][:MyCategory]
This is the town description.
NPCs
BUTTON[button_person] List important NPCs here.
filters:
and:
- file.inFolder("2-World/People")
formulas:
LinkedViaPlace: |
list(MyContainer)
.filter( file(value)
&& list(file(value).properties.MyContainer)
.contains(this) )
.length > 0
PlacesForThis: |
list(MyContainer)
.filter( file(value)
&& list(file(value).properties.MyContainer).contains(this) )
.map( link(value, file(value).name) )
properties:
file.name:
displayName: Person
PlacesForThis:
displayName: Places (for this note)
note.char_race:
displayName: Race
note.char_gender:
displayName: Gender
note.char_age:
displayName: Age
views:
- type: cards
name: People linked via Places ā this note
filters:
or:
- formula.LinkedViaPlace
- list(MyContainer).contains(this)
order:
- file.name
- char_age
- char_gender
- char_race
image: note.image
cardSize: 100
- type: table
name: View
GM Notes
Make notes of what you need to track in the town here.
Travel
VIEW[{Travel Calculator#HoursPerDay}][math] hrs per day
Travel Calculator / Exhaustion Level: VIEW[{Travel Calculator#ExhaustionLevel}][math]
| Destination | Travel Days |
|---|---|
| Next Town A | š: VIEW[round((88* {Travel Calculator#TravelCalc}) / 60 / {Travel Calculator#HoursPerDay}, 1)] |
| Next Town B | š: VIEW[round((88* {Travel Calculator#TravelCalc}) / 60 / {Travel Calculator#HoursPerDay}, 1)] |
CAMPING
C - Commerce (Economics and Entertainment) - Shops, Malls, Theatres, Markets, Carnivals, Electronics A - Agriculture (Resource Production and Collection) - Farms, Mines, Fisheries, Lumber Yards, Oil Rigs, Power Plants M - Military (Protection and Transportation) - Forts, Bases, Armories, Walls, Seaports, Airports, Spaceports P - Philosophy (Religion and Education) - Houses of Worship, Schools, Universities, Laboratories, Arboretums I - Industrial (Resource Utilization and Processing) - Factories, Metalworks, Bakeries, Artisans, Jewelers N - Nesting (Housing and Civil Engineering) - Residential Areas, Inns/Hotels G - Government (Legislation and Judicial) - Town Halls, Courthouses, Tourist Stops, Monuments/Landmarks
Commerce
BUTTON[button_place] BUTTON[button_person] C - Commerce (Economics and Entertainment) - Shops, Malls, Theatres, Markets, Carnivals, Electronics
properties:
file.name:
displayName: Places Name
note.MyCategory:
displayName: Type of Place
views:
- type: cards
name: Region - Cards
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Commerce"
order:
- file.name
- MyCategory
image: note.image
- type: table
name: Region - Table
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Commerce"
order:
- file.name
- MyContainer
sort:
- property: file.name
direction: ASC
columnSize:
file.name: 182
Agriculture
BUTTON[button_place] BUTTON[button_person] A - Agriculture (Resource Production and Collection) - Farms, Mines, Fisheries, Lumber Yards, Oil Rigs, Power Plants
properties:
file.name:
displayName: Places Name
note.MyCategory:
displayName: Type of Place
views:
- type: cards
name: Region - Cards
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Agriculture"
order:
- file.name
- MyCategory
image: note.image
- type: table
name: Region - Table
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Agriculture"
order:
- file.name
- MyContainer
sort:
- property: file.name
direction: ASC
columnSize:
file.name: 182
Military
BUTTON[button_place] BUTTON[button_person] M - Military (Protection and Transportation) - Forts, Bases, Armories, Walls, Seaports, Airports, Spaceports
properties:
file.name:
displayName: Places Name
note.MyCategory:
displayName: Type of Place
views:
- type: cards
name: Region - Cards
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Military"
order:
- file.name
- MyCategory
image: note.image
- type: table
name: Region - Table
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Military"
order:
- file.name
- MyContainer
sort:
- property: file.name
direction: ASC
columnSize:
file.name: 182
Philosophy
BUTTON[button_place] BUTTON[button_person] P - Philosophy (Religion and Education) - Houses of Worship, Schools, Universities, Laboratories, Arboretums
properties:
file.name:
displayName: Places Name
note.MyCategory:
displayName: Type of Place
views:
- type: cards
name: Region - Cards
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Philosophy"
order:
- file.name
- MyCategory
image: note.image
- type: table
name: Region - Table
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Philosophy"
order:
- file.name
- MyContainer
sort:
- property: file.name
direction: ASC
columnSize:
file.name: 182
Industrial
BUTTON[button_place] BUTTON[button_person] I - Industrial (Resource Utilization and Processing) - Factories, Metalworks, Bakeries, Artisans, Jewelers
properties:
file.name:
displayName: Places Name
note.MyCategory:
displayName: Type of Place
views:
- type: cards
name: Region - Cards
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Industrial"
order:
- file.name
- MyCategory
image: note.image
- type: table
name: Region - Table
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Industrial"
order:
- file.name
- MyContainer
sort:
- property: file.name
direction: ASC
columnSize:
file.name: 182
Nesting
BUTTON[button_place] BUTTON[button_person] N - Nesting (Housing and Civil Engineering) - Residential Areas, Bridges, Parks, Inns/Hotels
properties:
file.name:
displayName: Places Name
note.MyCategory:
displayName: Type of Place
views:
- type: cards
name: Region - Cards
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Nesting"
order:
- file.name
- MyCategory
image: note.image
- type: table
name: Region - Table
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Nesting"
order:
- file.name
- MyContainer
sort:
- property: file.name
direction: ASC
columnSize:
file.name: 182
Government
BUTTON[button_place] BUTTON[button_person] G - Government (Legislation and Judicial) - Town Halls, Courthouses, Tourist Stops, Monuments/Landmarks
properties:
file.name:
displayName: Places Name
note.MyCategory:
displayName: Type of Place
views:
- type: cards
name: Region - Cards
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Government"
order:
- file.name
- MyCategory
image: note.image
- type: table
name: Region - Table
filters:
and:
- file.folder == "2-World/Places"
- list(MyContainer).contains(this)
- MyCategory == "Government"
order:
- file.name
- MyContainer
sort:
- property: file.name
direction: ASC
columnSize:
file.name: 182