>[!danger] UNDER CONSTRUCTION >This article is active and the template functions but, honesty, it's still in need of some improvement. You can check the changelog and roadmap to see if theres a new version for you to use. Thanks! >[!tldr]- Changelog and Roadmap > > # Changelog > ### NPC Template v1.1 - Mar. 7 2025 > - Updated faction filepath in form logic to prevent error > # Roadmap >### Current Encounters: >- Clean up formatting of final note > - improve design cohesion > - get "no input" fields to display nothing > - fix extraneous formatting symbols > - make stats and spells tables look not like garbage >### Future Encounters: >- sort by location logic >- improve character stat randomizer >- Improve stat block input # Creating New NPCs This template is meant to be a jumping off point to fill in more details as the NPC grows and their story ties further into adventures. I organize my NPCs by location and I'm working on adding that automatic functionality into the template. In the mean time, it will still place the newly created note in the "Non-Player Characters" folder (there is a mark in the template where you can change that destination). ### Note Format: Below is the format created by the form for all NPCs. I tried to keep the information simple, but there is room to expand upon all of it if you want. Adding to the form and template are fairly easy tasks. > [!example]- NPC note example > ![[npc note example.png]] >[!warning] >The form WILL auto-generate abilities,AC, and HP but it's buggy and needs some work. It will generate a Fantasy Statblock if you want it to, just in case your players want to fight a random person that carries no weapons. Almost all of the info, as usual, is tracked in frontmatter to make it easy to filter and access this NPC's information elsewhere view Dataview tables. >[!example]- NPC note frontmatter >![[npc frontmatter example.png]] ### New NPC Form Using the plugin [[Modal Forms]], you can create a dialogue that opens what you [[Templates Introduction#Activating the Templates|click on a button]]. That dialogue, run via a [[Templater]] template (found below), collects the form data and applies it to said templated format and creates a new NPC note in the correct folder. >[!code]- NPC Form Template > >```json >{ > "title": "Create a New NPC", > "name": "New NPC", > "fields": [ > { > "name": "Name", > "label": "Name", > "description": "What is the name of this NPC", > "isRequired": true, > "input": { > "type": "text", > "hidden": false > } > }, > { > "name": "Appearances", > "label": "", > "description": "What adventures has this NPC appeared in?", > "isRequired": false, > "input": { > "type": "multiselect", > "source": "dataview", > "query": "Array.from(new Set(\n dv.pages().filter(p => p.file.folder.startsWith(\"Adventures/\"))\n .map(p => p.file.folder.split(\"/\")[1]) // Extract first-level folder\n)).sort();", > "allowUnknownValues": false, > "multi_select_options": [] > } > }, > { > "name": "bio", > "label": "Biography", > "description": "Who is this person?", > "isRequired": false, > "input": { > "type": "textarea", > "hidden": false > } > }, > { > "name": "Aliases", > "label": "Aliases", > "description": "Does this NPC go by any nicknames or aliases? (comma separated)", > "isRequired": false, > "input": { > "type": "text", > "hidden": false > } > }, > { > "name": "Affiliates", > "label": "Affiliates", > "description": "Who are their closest affiliates? (comma separated)", > "isRequired": false, > "input": { > "type": "text", > "hidden": false > } > }, > { > "name": "Factions", > "label": "Factions", > "description": "Is this NPC associated with any known organization?", > "isRequired": false, > "input": { > "type": "select", > "source": "notes", > "folder": "World/People/Factions", > "options": [] > } > }, > { > "name": "Primary Location", > "label": "Primary Location", > "description": "Where does this NPC hang out?", > "isRequired": false, > "input": { > "type": "dataview", > "query": "Array.from(new Set(\n dv.pages().filter(p => p.file.path.startsWith(\"Places/\"))\n .flatMap(p => p.file.folder.split(\"/\").slice(1).concat(p.file.name)) // Get all folder levels + note name\n)).sort();" > } > }, > { > "name": "Alignment", > "label": "Alignment", > "description": "What is this NPC's Alignment", > "isRequired": false, > "input": { > "type": "select", > "source": "fixed", > "options": [ > { > "value": "", > "label": "" > }, > { > "value": "Lawful Good", > "label": "Lawful Good" > }, > { > "value": "Neutral Good", > "label": "Neutral Good" > }, > { > "value": "Chaotic Good", > "label": "Chaotic Good" > }, > { > "value": "Lawful Neutral", > "label": "Lawful Neutral" > }, > { > "value": "True Neutral", > "label": "True Neutral" > }, > { > "value": "Chaotic Neutral", > "label": "Chaotic Neutral" > }, > { > "value": "Lawful Evil", > "label": "Lawful Evil" > }, > { > "value": "Lawful Evil", > "label": "Neutral Evil" > }, > { > "value": "Chaotic Evil", > "label": "Chaotic Evil" > } > ] > } > }, > { > "name": "Class", > "label": "", > "description": "What class is this NPC (if any)?", > "isRequired": false, > "input": { > "type": "select", > "source": "notes", > "folder": "Compendium/Classes", > "options": [] > } > }, > { > "name": "Species", > "label": "", > "description": "What species is this NPC?", > "isRequired": false, > "input": { > "type": "select", > "source": "notes", > "folder": "Compendium/Species", > "options": [] > } > }, > { > "name": "Known Spells", > "label": "", > "description": "Does this NPC know any spells?", > "isRequired": false, > "input": { > "type": "multiselect", > "source": "notes", > "folder": "Compendium/Spells", > "allowUnknownValues": false, > "query": "", > "multi_select_options": [] > } > }, > { > "name": "Stats", > "label": "Stats", > "description": "Does this NPC need a stat block made?", > "isRequired": false, > "input": { > "type": "toggle", > "hidden": false > } > }, > { > "name": "Size", > "label": "Size", > "description": "What is the NPC's size?", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "select", > "source": "fixed", > "options": [ > { > "value": "Tiny", > "label": "Tiny" > }, > { > "value": "Small", > "label": "Small" > }, > { > "value": "Medium", > "label": "Medium" > }, > { > "value": "Large", > "label": "Large" > }, > { > "value": "Huge", > "label": "Huge" > }, > { > "value": "Gargantuan", > "label": "Gargantuan" > } > ] > } > }, > { > "name": "Type", > "label": "Type", > "description": "What type of creature is this NPC?", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "select", > "source": "fixed", > "options": [ > { > "value": "Humanoid", > "label": "Humanoid" > }, > { > "value": "Undead", > "label": "Undead" > }, > { > "value": "Beast", > "label": "Beast" > }, > { > "value": "Fey", > "label": "Fey" > }, > { > "value": "Construct", > "label": "Construct " > }, > { > "value": "Gargantuan", > "label": "Gargantuan" > }, > { > "value": "Elemental", > "label": "Elemental" > }, > { > "value": "Aberration", > "label": "Aberration" > }, > { > "value": "Dragon", > "label": "Dragon" > }, > { > "value": "Giant", > "label": "Giant" > }, > { > "value": "Ooze", > "label": "Ooze" > }, > { > "value": "Plant", > "label": "Plant" > } > ] > } > }, > { > "name": "npc_ac", > "label": "Armor Class", > "description": "(leave blank for randomization)", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "number", > "hidden": false > } > }, > { > "name": "npc_hp", > "label": "Max Hit Points", > "description": "(leave blank for randomization)", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "number", > "hidden": false > } > }, > { > "name": "npc_hit dice", > "label": "Hit Dice", > "description": "How many of which hit dice doe this character have?(leave blank for randomization)", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "select", > "source": "fixed", > "options": [ > { > "value": "d6", > "label": "d6" > }, > { > "value": "d8", > "label": "d8" > }, > { > "value": "d10", > "label": "d10" > } > ] > } > }, > { > "name": "npc_STR", > "label": "Strength Score ", > "description": "Out of 20 (leave blank for randomization)", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "number", > "hidden": false > } > }, > { > "name": "npc_DEX", > "label": "Dexterity Score", > "description": "Out of 20 (leave blank for randomization)", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "number", > "hidden": false > } > }, > { > "name": "npc_CON", > "label": "Constitution Score", > "description": "Out of 20 (leave blank for randomization)", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "number", > "hidden": false > } > }, > { > "name": "npc_INT", > "label": "Intelligence Score", > "description": "Out of 20 (leave blank for randomization)", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "number", > "hidden": false > } > }, > { > "name": "npc_WIS", > "label": "Wisdom Score", > "description": "Out of 20 (leave blank for randomization)", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "number", > "hidden": false > } > }, > { > "name": "npc_CHA", > "label": "Charisma Score", > "description": "Out of 20 (leave blank for randomization)", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "number", > "hidden": false > } > }, > { > "name": "Proficiency", > "label": "Proficiencies", > "description": "What skills is this NPC proficient in?", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "multiselect", > "source": "fixed", > "multi_select_options": [ > "Athletics", > "Acrobatics", > "Sleight of Hand", > "Arcana", > "History", > "Investigation", > "Nature", > "Religion", > "Animal Handling", > "Insight", > "Medicine", > "Perception", > "Survival", > "Deception", > "Intimidation", > "Performance", > "Persuasion" > ], > "allowUnknownValues": false, > "query": "" > } > }, > { > "name": "Damage Vulnerability", > "label": "Damage Vulnerability", > "description": "What damage types are they vulnerable to (double damage)?", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "multiselect", > "source": "fixed", > "multi_select_options": [ > "Acid", > "Bludgeoning", > "Cold", > "Fire", > "Force", > "Lightning", > "Necrotic", > "Piercing", > "Poison", > "Psychic", > "Radiant", > "Slashing", > "Thunder" > ], > "allowUnknownValues": false, > "query": "" > } > }, > { > "name": "Damage Resistance", > "label": "Damage Resistance", > "description": "What damage types are they resistant to (half damage)?", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "multiselect", > "source": "fixed", > "multi_select_options": [ > "Acid", > "Bludgeoning", > "Cold", > "Fire", > "Force", > "Lightning", > "Necrotic", > "Piercing", > "Poison", > "Psychic", > "Radiant", > "Slashing", > "Thunder" > ], > "allowUnknownValues": false, > "query": "" > } > }, > { > "name": "Damage Immunity", > "label": "Damage Immunity", > "description": "What damage types are they immune to?", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "multiselect", > "source": "fixed", > "multi_select_options": [ > "Acid", > "Bludgeoning", > "Cold", > "Fire", > "Force", > "Lightning", > "Necrotic", > "Piercing", > "Poison", > "Psychic", > "Radiant", > "Slashing", > "Thunder" > ], > "allowUnknownValues": false, > "query": "" > } > }, > { > "name": "Condition Immunity", > "label": "Condition Immunity", > "description": "What conditions are they immune to?", > "isRequired": false, > "condition": { > "dependencyName": "Stats", > "type": "boolean", > "value": true > }, > "input": { > "type": "multiselect", > "source": "fixed", > "multi_select_options": [ > "Blinded", > "Charmed", > "Deafened", > "Frightened", > "Paralyzed", > "Petrified", > "Poisoned", > "Stunned" > ], > "allowUnknownValues": false, > "query": "" > } > } > ], > "version": "1" ### New NPC Note Template This part goes in your templates folder so that it will be in the list when you press your "insert template" hotkey. Create your button to run this template, press the button, fill out the form, and it should create and open your new NPC! When creating this note, name it something simple and be sure that you match it's name on whatever [[Templates Introduction#Meta Bind Buttons|buttons you create]]. >[!code]- NPC Note Template > ![[Extras/Toolkit/code/new npc template|no-title]]