<%* const hasTitle = !tp.file.title.startsWith(ā€œNewPlayerā€); let title; if (!hasTitle) { title = await tp.system.prompt(ā€œEnter Player Nameā€); await tp.file.rename(title); } else { title = tp.file.title; } _%>

Player Name: Placeholder

Column

Place Name

INPUT[select(
option(1, šŸ§™Description),
option(2, āš™ļøConfigure),
option(3, šŸ“GM Notes),
class(tabbed)
)]

Tabbed

NOTE

INPUT[select(
option(1, šŸ§™ā€ā™‚ļøChar Sheet),
option(2, āš”ļøInventory),
option(3, šŸ”—Connections),
option(4, šŸ§‘ā€šŸ¤ā€šŸ§‘Relationships),
class(tabbed)
)]

Tabbed


const player = dv.current();
const factions = dv.pages('"3-Mechanics/Guilds and Groups"');
let tableData = [];
for (let faction of factions) {
    let factionName = faction.faction;
    let playerStanding = player.faction_standing?.[factionName] || 0;
 
    // Ensure benefits is treated as an array
    let benefitsList = Array.isArray(faction.benefits) ? faction.benefits : [];
 
    // Filter benefits the player qualifies for
    let qualifiedBenefits = benefitsList
        .filter(b => playerStanding >= b.standing)
        .map(b => b.reward)
        .join(", "); 
 
    let primaryContact = faction.primary_contact || "No contact set";
 
    tableData.push([factionName, playerStanding, qualifiedBenefits || "No benefits yet", primaryContact]);
}
dv.table(["Faction", "Your Standing", "Benefits", "Primary Contact"], tableData);

Description

This is the persons description.

Configure

Initiative Tracker StatValue
LevelINPUT[number:level]
HPINPUT[number:hp]
ACINPUT[number:ac]
ModifierINPUT[number:modifier]

GM Notes

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

Character Sheet

frame: Demiplane
style: height: 800px;

Inventory

The following items belong to = this.file.name.

Items: INPUT[inlineListSuggester(optionQuery(#Category/Quest)):char_items]

Connections

Is the person linked to any groups or quests?

Quests: INPUT[inlineListSuggester(optionQuery(#Category/Quest)):Connected_Quests]

Groups: INPUT[inlineListSuggester(optionQuery(#Category/Group)):Connected_Groups]

Relationships

List important relationships here.

var parents = dv.current().parents ?? [];
var children = dv.current().children ?? [];
var enemies = dv.current().enemies ?? [];
var allies = dv.current().allies ?? [];
var siblings = dv.current().siblings ?? [];
var current = dv.current().file.name;
var partner = dv.current().partner ?? [];
 
dv.paragraph("```mermaid\nflowchart LR\n" +
  // Parents with internal-link on individual nodes only
  (parents.length > 0 ? parents.map((parent, index) => `P${index + 1}[${parent}]:::internal-link\nP${index + 1} --> Current\n`).join('') : '') +
  
  // Current node
  `Current[${current}]\n` +
  
  // Partner group node (no internal-link applied)
  (partner.length > 0 ? `PT[Partner]\nCurrent --> PT\n` : '') +
  
  // Individual partners with internal-link
  (partner.length > 0 ? partner.map((p, index) => `PT${index + 1}[${p}]:::internal-link\nPT --> PT${index + 1}\n`).join('') : '') +
 
  // Children group node (no internal-link applied)
  (children.length > 0 ? `C[Children]\nCurrent --> C\n${children.map((child, index) => `C${index + 1}[${child}]:::internal-link\nC --> C${index + 1}\n`).join('')}` : '') +
 
  // Siblings group node (no internal-link applied)
  (siblings.length > 0 ? `S[Siblings]\nCurrent --> S\n${siblings.map((sibling, index) => `S${index + 1}[${sibling}]:::internal-link\nS --> S${index + 1}\n`).join('')}` : '') +
 
  // Enemies group node (no internal-link applied)
  (enemies.length > 0 ? `E[Enemies]\nCurrent --> E\n${enemies.map((enemy, index) => `E${index + 1}[${enemy}]:::internal-link\nE --> E${index + 1}\n`).join('')}` : '') +
 
  // Allies group node (no internal-link applied)
  (allies.length > 0 ? `A[Allies]\nCurrent --> A\n${allies.map((ally, index) => `A${index + 1}[${ally}]:::internal-link\nA --> A${index + 1}\n`).join('')}` : '') +
 
  // Styling: Apply internal-link only to individual nodes, not group nodes
  `class ${parents.length > 0 ? parents.map((_, index) => `P${index + 1},`).join('') : ''}Current${children.length > 0 ? children.map((_, index) => `C${index + 1},`).join('') : ''}${siblings.length > 0 ? siblings.map((_, index) => `S${index + 1},`).join('') : ''}${enemies.length > 0 ? enemies.map((_, index) => `E${index + 1},`).join('') : ''}${allies.length > 0 ? allies.map((_, index) => `A${index + 1},`).join('') : ''} internal-link;`
)