<%*

// 1) Rename if title starts with ā€œNewSpeciesā€ let title; if (tp.file.title.startsWith(ā€œNewSpeciesā€)) { title = await tp.system.prompt(ā€œEnter Sapient Species Nameā€); if (!title) { new Notice(ā€œNo name entered. Aborting.ā€); return; } await tp.file.rename(title); } else { title = tp.file.title; }

// 2) Gather all planet files under 2-World/Planets const planetFiles = tp.app.vault.getMarkdownFiles() .filter(f ⇒ f.path.startsWith(ā€œ2-World/Planets/ā€));

const placeholderLabel = ā€šŸŒ€ No Planet Selectedā€; const placeholderPath = ā€œplaceholderā€;

// 3) Prompt for container planet const planetChoices = [placeholderLabel, …planetFiles.map(f ⇒ f.basename)]; const planetValues = [placeholderPath, …planetFiles.map(f ⇒ f.path)]; const chosenPath = await tp.system.suggester(planetChoices, planetValues, 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) Write to frontmatter setTimeout(() ⇒ { const newFile = tp.file.find_tfile(tp.file.path(true)); if (!newFile) return; app.fileManager.processFrontMatter(newFile, fm ⇒ { fm[ā€œMyContainerā€] = wikiLink ?? ā€œNoneā€; }); }, 100);

%>

Parent Region: INPUT[inlineListSuggester(optionQuery(#Category/Place), optionQuery(#Category/Planet)):MyContainer]

Column

Place Name

INPUT[select(
option(1, ā„¹ļøGeneral),
option(2, ā‰ļøGoals),
option(3, šŸ“GM Notes),
class(tabbed)
)]

Tabbed

NOTE

INPUT[select(
option(1, 🧾History),
option(2, šŸ§‘ā€šŸ¦°Psyiology),
option(3, 🧬Biology),
option(4,šŸ™ƒPersonality),
option(5, 🧠Intelligence),
class(tabbed)
)]

Tabbed


General

Enter description of the sapient species here.

Goals

  • Defining Features
  • Commonly Spoken Languages:
  • Average Lifespan
  • Average Adulthood
  • Average Size
  • Average Weight
  • Strengths
  • Weaknesses

Membership

To join the group, a PC must spend X week ā€˜doing’ something, or ā€˜something else’.

GM Notes

Make notes of what you need to track in the town here.

Hierarchy

BUTTON[button_person] List important relationships here.

// 1) Grab your frontmatter arrays
const leader    = dv.current().leader    ?? null;
const officers  = dv.current().officers  ?? [];
const members   = dv.current().members   ?? [];
const initiates = dv.current().initiates ?? [];
 
// 2) Render the Mermaid diagram
dv.paragraph(
  "```mermaid\nflowchart LR\n" +
 
  // Leader node
  (leader
    ? `L[${leader}]:::internal-link\n`
    : "") +
 
  // Officers group
  (officers.length > 0
    ? `OG[Officers]\nL --> OG\n` +
      officers.map((o,i) =>
        `O${i+1}[${o}]:::internal-link\nOG --> O${i+1}\n`
      ).join("")
    : "") +
 
  // Members group
  (members.length > 0
    ? `MG[Members]\n${officers.length ? "OG" : "L"} --> MG\n` +
      members.map((m,i) =>
        `M${i+1}[${m}]:::internal-link\nMG --> M${i+1}\n`
      ).join("")
    : "") +
 
  // Initiates group
  (initiates.length > 0
    ? `IG[Initiates]\n${members.length ? "MG" : (officers.length ? "OG" : "L")} --> IG\n` +
      initiates.map((n,i) =>
        `I${i+1}[${n}]:::internal-link\nIG --> I${i+1}\n`
      ).join("")
    : "") +
 
  "```"
)

Enemies/Allies

Enemies: INPUT[inlineListSuggester(optionQuery(#Category/Group),optionQuery(#Category/People)):MyEnemies]

Allies: INPUT[inlineListSuggester(optionQuery(#Category/Group),optionQuery(#Category/People)):MyAllies]

People

The following people are members of this group.

TABLE WITHOUT ID link(file.name) AS "Name", char_race AS "Race", char_gender AS "Gender"
FROM "2-Campaign/Quests"
WHERE contains(Connected_Groups, this.file.link)
SORT file.name ASC
properties:
  property.char_age:
    displayName: Age
  property.char_gender:
    displayName: Gender
  property.char_race:
    displayName: Race
  property.char_status:
    displayName: Status
  file.name:
    displayName: Name
  note.char_status:
    displayName: Status
  note.char_race:
    displayName: Race
  note.char_gender:
    displayName: Gender
  note.char_age:
    displayName: Age Range
views:
  - type: table
    name: People
    filters:
      and:
        - file.inFolder("2-World/People")
        - MyContainer.contains(this.file.path)
    order:
      - file.name
      - MyContainer
      - MyCategory
      - char_status
      - char_race
      - char_gender
      - char_age
    sort:
      - column: note.char_race
        direction: ASC
      - column: note.MyContainer
        direction: ASC
      - column: file.name
        direction: ASC
    columnSize:
      file.name: 177
      note.MyCategory: 221
      note.MyContainer: 244
      note.char_status: 137
      note.char_race: 160
      note.char_gender: 143
      note.char_age: 149
 

Services

Services offered.

Public Services

ItemCostWeight
Service 11gpL
Service 21cp-

Ranks

Ranks listed here

  • Rank 1: Benefit
  • Rank 2: Benefit
  • Rank 3: Benefit