### Install Node.js Package Manager (pnpm) Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Helping-with-Data-Entry.md Installs the latest version of pnpm globally, which is used for managing Node.js packages and running build scripts. ```bash npm install -g pnpm@latest-10 ``` -------------------------------- ### Install Node Package Manager Dependencies Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Helping-with-Data-Entry.md Installs all the necessary Node.js packages required for development and building the system. Run this command if you encounter issues or after pulling changes. ```bash npm ci ``` -------------------------------- ### BattleForm Example (Unicorn Form) Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Going-Deeper-Topics/Quickstart-guide-for-the-BattleForm-rule-element.md A comprehensive example of a BattleForm configuration, demonstrating overrides for armor class, resistances, senses, size, skills, speeds, strikes, and traits. This is useful for defining creature forms with unique statistics. ```json { "key": "BattleForm", "overrides": { "armorClass": { "modifier": "19 + @actor.level" }, "resistances": [{ "type": "poison", "value": 5 }], "senses": { "lowLightVision": {} }, "size": "lg", "skills": { "acr": { "modifier": 16 } }, "speeds": { "land": 40 }, "strikes": { "hoof": { "ability": "dex", "category": "unarmed", "damage": { "damageType": "bludgeoning", "dice": 1, "die": "d8" }, "group": "brawling", "modifier": 16, "traits": ["unarmed", "agile"] }, "horn": { "ability": "dex", "category": "unarmed", "damage": { "damageType": "piercing", "dice": 1, "die": "d10", "modifier": 8 }, "group": "brawling", "modifier": 16, "traits": ["unarmed"] } }, "tempHP": 15, "traits": ["fey", "beast"] } } ``` -------------------------------- ### Switch to Master Branch Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Helping-with-Data-Entry.md Use this command to return to the main branch before pulling updates or starting new work. ```bash git checkout master ``` -------------------------------- ### BattleForm Resistances Example Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Going-Deeper-Topics/Quickstart-guide-for-the-BattleForm-rule-element.md Demonstrates how to define multiple resistances, including an exception for a specific type. This is used within the 'overrides' section of a BattleForm. ```json "resistances": [ { "type": "poison", "value": 5 }, { "type": "fire", "value": 5, "except": "magical" }] ``` -------------------------------- ### Execute Grapple Action Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Style-Guide.md Inline actions use `[[/act action-name]]` syntax. This example shows how to execute a grapple action. ```foundryvtt [[/act grapple]] ``` -------------------------------- ### Example JSON Object Structure Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This example demonstrates a JSON object with various data types including strings, nested objects, arrays of strings, numbers, and booleans. It illustrates the structure and syntax for defining parameters and their values. ```json { "parameterOne": "The first parameter is a string", "parameterTwo": { "subParameter": "A subparameter of parameter two", "secondSubParameter": "Another subparameter" }, "parameterThree": [ "Parameter three", "is an", "array of strings!" ], "parameterFour": 4, "parameterFive": true } ``` -------------------------------- ### Make an Impression Action with Performance Statistic Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Style-Guide.md You can swap the statistic used in an inline action. This example uses the 'performance' statistic for the 'make-an-impression' action. ```foundryvtt [[/act make-an-impression statistic=performance]] ``` -------------------------------- ### Formatted Match Function Example Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md A more readable, multi-line format of the match() function for clarity. This demonstrates how conditions and values are paired. ```javascript match( when(lte(@actor.level, 6), 1), when(btwn(@actor.level, 7, 16), 2), when(gte(@actor.level, 17), 3) ) ``` -------------------------------- ### Array of Strings Example Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This example shows an array containing strings, which are commonly used to represent tags or identifiers in rule elements. Note the use of square brackets and comma separation. ```json ["agile", "elf", "item:tag:witch-patron"] ``` -------------------------------- ### Example Selector Usage in FlatModifier Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Demonstrates how to use an array of selectors within a FlatModifier rule element to apply a bonus to multiple related statistics. ```json { "key": "FlatModifier", "selector": [ "arcana", "nature", "occultism", "religion" ], "value": "circumstance", "value": 1 } ``` -------------------------------- ### Weapon Predicates Example Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/AGENTS.md Examples of predicates used to identify weapon properties like hands held, group, or tag. These are crucial for conditional rule application. ```json [ "self:weapon:hands-held:1", { "or": [ "item:group:firearm", "item:tag:crossbow" ] } ] ``` -------------------------------- ### Sneak Action with DC 20 Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Style-Guide.md You can specify a DC for inline actions. This example sets the DC to 20 for the sneak action. ```foundryvtt [[/act sneak dc=20]] ``` -------------------------------- ### View Git Remotes Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Helping-with-Data-Entry.md Check the configured remote repositories for your local Git installation, typically 'origin' and 'upstream'. ```bash git remote -v ``` -------------------------------- ### Upgrade Proficiency to Master Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This example shows how to upgrade a proficiency to master (value 3) by referencing the slug of a previously defined MartialProficiency rule element. ```json { "key": "ActiveEffectLike", "mode": "upgrade", "path": "system.proficiencies.attacks.simple-firearms-crossbows.rank", "value": 3 } ``` -------------------------------- ### Add to a Modifier and Relabel Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This example demonstrates adding a value to an existing modifier and relabeling it. This is useful for stacking otherwise unstackable bonuses. ```json { "key": "AdjustModifier", "mode": "add", "selector": "ac", "relabel": "Mountain Stance w/ Bracers of Armor", "slug": "bracers-of-armor", "value": 4 } ``` -------------------------------- ### BattleForm Senses Override Example Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Going-Deeper-Topics/Quickstart-guide-for-the-BattleForm-rule-element.md Shows how to configure senses like low-light vision and scent, including specifying acuity and range for senses that require it. This is part of the 'overrides' in BattleForm. ```json "senses": { "lowLightVision": {}, "scent": { "acuity": "imprecise", "range": 30 } } ``` -------------------------------- ### Treat Martial Dwarf Weapons as Simple Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This example demonstrates using MartialProficiency to treat specific martial weapons associated with the dwarf trait as simple weapons. The 'sameAs' property is set to 'simple' to achieve this. ```json { "definition": [{ "or": [{ "and": [ "item:trait:dwarf", "item:category:martial" ] }, "item:base:battle-axe", "item:base:warhammer", "item:base:pick" ] }], "key": "MartialProficiency", "label": "PF2E.SpecificRule.MartialProficiency.MartialDwarfWeapons", "sameAs": "simple", "slug": "martial-dwarf-weapons" } ``` -------------------------------- ### BattleForm Skills Override Example Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Going-Deeper-Topics/Quickstart-guide-for-the-BattleForm-rule-element.md Configures skill modifiers for a creature form. Skills are provided as an object where each skill has a 'modifier' property. ```json "skills": { "athletics": { "modifier": 18 }, "acrobatics": { "modifier": 18 } } ``` -------------------------------- ### Apply a Flat Modifier Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This example shows how to apply a flat modifier to strike damage. It adds a base value and a conditional bonus. ```json { "key": "FlatModifier", "selector": "strike-damage", "value": 1, "slug": "some-modifier" } ``` -------------------------------- ### Match Function with When and Btwn for Scaled Weakness Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Utilize match(), when(), and btwn() for complex, multi-tiered scaling. This example defines fire weakness values based on actor level ranges. ```json { "key": "Weakness", "type": "fire", "value": "match(when(lte(@actor.level, 6), 1), when(btwn(@actor.level, 7, 16), 2), when(gte(@actor.level, 17), 3))" } ``` -------------------------------- ### Basic Strike Configuration Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Defines a basic strike with damage type, dice, and traits. This is a foundational example for creating custom strikes. ```json { "key": "Strike", "category": "unarmed", "damage": { "base": { "damageType": "slashing", "dice": 1, "die": "d8" } }, "group": "brawling", "label": "Tiger Claw", "traits": [ "agile", "finesse", "unarmed", "nonlethal" ] } ``` -------------------------------- ### BattleForm Size Override Example Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Going-Deeper-Topics/Quickstart-guide-for-the-BattleForm-rule-element.md A simple override for the creature's size. Valid sizes include 'tiny', 'sm', 'med', 'lg', 'huge', and 'grg'. ```json "size": "grg" ``` -------------------------------- ### Configure Module Thumbnail Media Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Going-Deeper-Topics/Creating-a-PF2e-Content-Module.md Set the module thumbnail image using the 'media' array in module.json. This image appears on the main Foundry page for installed modules and should be 600x400 pixels. ```json "media": [ { "type": "setup", "caption": "Pathfinder 2e Companion Compendia", "thumbnail": "modules/pf2e-animal-companions/art/preview.webp" }] ``` -------------------------------- ### Add Another Lesser Awakening Choice Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Adds another distinct awakening choice to the 'lesser' array. This example adds the 'BoneSpikesPoison' awakening. ```json { "key": "ActiveEffectLike", "mode": "add", "path": "flags.system.deviantAbilities.awakenedChoices.lesser", "value": { "label": "PF2E.SpecificRule.DeviantAbilities.AwakenedPower.BoneSpikesPoison", "predicate": [ { "not": "awakening:bone-spikes:poison" } ], "value": "bone-spikes:poison" } } ``` -------------------------------- ### Predicate with Multiple Item Traits Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Combine multiple traits in a predicate to narrow down conditions. This example applies a bonus only to saves against items with both 'fear' and originating from a 'dragon'. ```json "predicate": [ "item:trait:fear", "origin:trait:dragon" ] ``` -------------------------------- ### Nested Predicates with 'or' and 'and' Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Create complex conditions by nesting logical tests. This example applies a modifier to small beasts or large humanoids. ```json { "predicate": [ { "or": [ { "and": [ "target:trait:beast", "target:size:small" ] }, { "and": [ "target:trait:humanoid", "target:size:large" ] } ] } ] } ``` -------------------------------- ### Administer First Aid with Stop Bleeding Variant Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Style-Guide.md Some actions require a variant to be specified. This example shows administering first aid with the 'stop-bleeding' variant. ```foundryvtt [[/act administer-first-aid variant=stop-bleeding]] ``` -------------------------------- ### Create a Choice Set for Feat Selection Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This ChoiceSet example uses item UUIDs for choices, enabling the selection of a feat. It's often used in conjunction with GrantItem to provide the chosen feat to the character. ```json { "adjustName": false, "choices": [{ "value": "Compendium.pf2e.feats-srd.Item.ZBhvJ9O8MvBFAlhq" }, { "value": "Compendium.pf2e.feats-srd.Item.P04Hw8E6WAWARKHP" }], "key": "ChoiceSet", "prompt": "Select a feat", "flag": "feat" } ``` -------------------------------- ### Reference Actor Speed with @ Syntax Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Use '@' syntax to reference numerical actor data like 'speed.total'. This example sets a 'swim' speed based on the actor's total land speed. ```json { "key": "BaseSpeed", "selector": "swim", "value": "@actor.system.attributes.speed.total" } ``` -------------------------------- ### Predicate with OR Logic for Target Traits Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Employ the 'or' logical test within a predicate to apply a rule element if any of the specified conditions are met. This example grants a bonus to diplomacy against targets with 'elf', 'gnome', or 'fey' traits. ```json "predicate": [ { "or": [ "target:trait:elf", "target:trait:gnome", "target:trait:fey" ] } ] ``` -------------------------------- ### Seek Action Against Thievery DC Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Style-Guide.md Inline actions can use actor data for the target's DC. This example rolls a perception check to Seek against the thievery DC of the targeted creature. ```foundryvtt [[/act seek dc=thievery]] ``` -------------------------------- ### Pulling Updates and Building the System Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Helping-with-Data-Entry.md Keep your local system files synchronized with your fork and rebuild the system after updates. Ensure you are in the master folder of your local repository. ```bash git pull pnpm run build ``` -------------------------------- ### Update module.json with Repository Information Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Going-Deeper-Topics/Creating-a-PF2e-Content-Module.md Add these lines to your module.json file to link it to your GitHub repository. Remember to replace 'YourName' and 'PF2e-Example' with your specific GitHub username and repository name. Ensure correct comma placement for JSON syntax. ```json "url": "https://github.com/YourName/PF2e-Example", "manifest": "https://raw.githubusercontent.com/YourName/PF2e-Example/master/module.json", "download": "https://github.com/YourName/PF2e-Example/archive/refs/heads/main.zip" ``` -------------------------------- ### Configure Token Light (Basic) Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Basic configuration for the TokenLight rule element, defining bright and dim light ranges, color, and animation. ```json { "key": "TokenLight", "value": { "animation": { "intensity": 4, "speed": 1, "type": "torch" }, "bright": 20, "color": "#9b7337", "dim": 40, "shadows": 0.2 } } ``` -------------------------------- ### ActiveEffectLike: Dynamic Skill Proficiency with Actor Data Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This example uses 'upgrade' mode with a complex value expression that references actor data. It dynamically adjusts skill proficiency rank based on character level using nested ternary operators. Be cautious when referencing data that might be modified by other rule elements. ```json { "key": "ActiveEffectLike", "mode": "upgrade", "path": "system.skills.acrobatics.rank", "value": "ternary(gte(@actor.level, 15), 4, ternary(gte(@actor.level, 7), 3, 2))" } ``` -------------------------------- ### Suppress Circumstance Modifiers Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This example shows how to suppress all circumstance modifiers on skill checks using AdjustModifier. ```json { "key": "AdjustModifier", "selector": "skill-check", "predicate": [ "bonus:type:circumstance" ], "suppress": true } ``` -------------------------------- ### Create and Manage New Git Branch Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Helping-with-Data-Entry.md A quick reference for creating a new branch, making changes, committing them using Git GUI, and then switching back to the master branch. Using Git GUI for commits is recommended for easier management. ```bash git checkout -b new_branch ``` ```bash git gui ``` ```bash git checkout master ``` -------------------------------- ### BattleForm Traits Override Example Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Going-Deeper-Topics/Quickstart-guide-for-the-BattleForm-rule-element.md Assigns traits to the creature form. Traits are provided as an array of strings. ```json "traits": ["undead", "vampire"] ``` -------------------------------- ### Access Game Configuration Lists Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Use 'config' to access system configuration lists like skills. The predicate filters choices based on actor's untrained skills. ```json { "choices": { "config": "skills", "predicate": [ "skill:{choice|value}:rank:0" ] }, "flag": "skill", "key": "ChoiceSet", "prompt": "PF2E.SpecificRule.Prompt.Skill" } ``` -------------------------------- ### Change Damage Type of a Modifier Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This example demonstrates changing the damage type of an existing modifier, such as weapon specialization, to fire damage. ```json { "key": "AdjustModifier", "selector": "strike-damage", "slug": "weapon-specialization", "damageType": "fire" } ``` -------------------------------- ### Build Pathfinder 2e and Starfinder Systems Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Helping-with-Data-Entry.md Compiles the Pathfinder 2e and Starfinder systems. This process generates the necessary files for Foundry VTT to recognize and use the systems. It may take a few seconds to complete. ```bash pnpm run build --system=pf2e pnpm run build --system=sf2e ``` -------------------------------- ### Clone Pathfinder 2e Repository Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Helping-with-Data-Entry.md Use this command to clone the Pathfinder 2e system repository to your local machine. Replace `` with your GitHub username. ```bash git clone https://github.com//pf2e.git master ``` -------------------------------- ### Adjust Degree of Success (Basic) Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md The AdjustDegreeOfSuccess rule element modifies the outcome of a roll. This example improves a success to a better outcome. ```json { "key": "AdjustDegreeOfSuccess", "selector": "fortitude", "adjustment": { "success": "one-degree-better" } } ``` -------------------------------- ### Stage all database files for commit Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Helping-with-Data-Entry.md Manually stage all edited database files in the 'packs/data/' directory. This prepares them to be included in the next commit. ```bash git add packs/data/* ``` -------------------------------- ### Conditional Dice Number with Ternary Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Uses a ternary expression to dynamically set the `diceNumber` based on actor level. This example is for Vicious Swing. ```json { "diceNumber": "ternary(gte(@actor.level, 18), 3,ternary(gte(@actor.level, 10), 2, 1))", "key": "DamageDice", "predicate": [ "vicious-swing" ], "selector": "melee-strike-damage" } ``` -------------------------------- ### Create Line Template Link Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Style-Guide.md Use this to create a pre-set line template. Specify the distance, and optionally a custom label. ```WikiText @Template[type:line|distance:x] ``` -------------------------------- ### Adjust Degree of Success (with Predicate) Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This example adjusts the degree of success for a specific roll, but only if a certain predicate is met. Useful for conditional effects. ```json { "key": "AdjustDegreeOfSuccess", "selector": "medicine", "predicate": ["risky-surgery"], "adjustment": { "success": "one-degree-better" } } ``` -------------------------------- ### Add Lesser Awakening Choice Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Adds a specific awakening choice to the 'lesser' array within 'awakenedChoices'. This example adds the 'BoneSpikesReach' awakening. ```json { "key": "ActiveEffectLike", "mode": "add", "path": "flags.system.deviantAbilities.awakenedChoices.lesser", "value": { "label": "PF2E.SpecificRule.DeviantAbilities.AwakenedPower.BoneSpikesReach", "predicate": [ { "not": "awakening:bone-spikes:reach" } ], "value": "bone-spikes:reach" } } ``` -------------------------------- ### Configure Token Light (Advanced) Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Advanced configuration for the TokenLight rule element, including luminosity, gradual effects, contrast, saturation, coloration, and angle. ```json { "key": "TokenLight", "value": { "animation": { "intensity": 1, "speed": 1, "type": "lightdome" }, "bright": 30, "color": "#9b7337", "dim": 0, "shadows": 0, "luminosity": 0.5, "gradual": false, "contrast": 0.5, "saturation": 0, "coloration": 1, "angle": 360, "alpha": 0.1 } } ``` -------------------------------- ### Link Development Build to Foundry VTT Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Helping-with-Data-Entry.md Creates a symbolic link from your Foundry VTT data directory to the built development version of the system. This allows Foundry VTT to use your local changes. You may need to run this command in an administrator terminal. If prompted, overwrite the existing system to replace it with the symlink. ```bash npm run link ``` -------------------------------- ### Configure Token Image with Animation Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Adds a token image with animated transitions. The 'transition' type must be one of the specified values. ```json { "key": "TokenImage", "value": "modules/pf2e-tokens-bestiaries/tokens/draconic/dragons/dragon-red-adult.webp", "predicate": [ "self:effect:dragon-form-diabolic" ], "scale": 2, "animation": { "transition": "swirl" } } ``` -------------------------------- ### Navigate to Master Folder Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Helping-with-Data-Entry.md Changes the current directory to the 'master' folder, which contains the cloned Pathfinder 2e repository. ```bash cd master ``` -------------------------------- ### Create Cone Template Link Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Style-Guide.md Use this to create a pre-set cone template. Specify the distance, and optionally a custom label. ```WikiText @Template[type:cone|distance:x] ``` -------------------------------- ### Define Single Compendium Folder in module.json Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Going-Deeper-Topics/Creating-a-PF2e-Content-Module.md Use the 'packFolders' array in module.json to create a single folder for multiple compendiums. Set 'sorting' to 'm' for manual ordering or 'a' for alphabetical. ```json "packFolders": [ { "name": "Companion Compendia", "sorting": "m", "packs": [ "ac-ancestries-and-class", "ac-feats", "ac-advanced-maneuvers", "ac-equipment", "ac-features", "ac-evolution-feats", "ac-eidolons", "ac-construct-breakthroughs", "ac-construct-companions", "ac-support" ] } ] ``` -------------------------------- ### Ephemeral Effect Rule Element (Origin with Alteration) Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Apply temporary effects to the origin of a roll with an alteration. This example modifies the badge value for the incoming strike. ```json { "key": "EphemeralEffect", "affects": "origin", "selectors": [ "strike-attack-roll" ], "uuid": "Compendium.pf2e.conditionitems.Item.MIRkyAjyBeXivMa7", "alterations": [{ "mode": "override", "property": "badge-value", "value": 2 }] } ``` -------------------------------- ### Logically Equivalent Comparison with 'gt' Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md An alternative way to express the comparison from the previous example. This predicate applies a modifier when your level is greater than the target's level. ```json { "predicate": [ { "gt": [ "self:level", "target:level" ] } ] } ``` -------------------------------- ### Create Emanation Template Link Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Style-Guide.md Use this to create a pre-set emanation template. Specify the distance, and optionally a custom label. ```WikiText @Template[type:emanation|distance:x] ``` -------------------------------- ### BattleForm Speeds Override Example Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Going-Deeper-Topics/Quickstart-guide-for-the-BattleForm-rule-element.md Sets movement speeds for the creature form, such as land and fly speeds. Speeds are defined in an object with speed types as keys. ```json "speeds": { "land": 40, "fly": 100 } ``` -------------------------------- ### Show DC to All Players Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Style-Guide.md Change the `showDC` parameter to `all` to display DCs to all players. Other options include `gm` for GM-only visibility or `none` for no visibility. ```foundryvtt `showDC` - Defaults to `owner` visible only. Can be changed to `gm` to only show the GM or `all` to show DCs to all players, or `none` to show the DC to no one. ``` -------------------------------- ### Strike with Ability Modifier Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Adds an ability modifier to a strike's to-hit roll. This example shows how to scale a strike's accuracy with a character's intelligence. ```json { "category": "unarmed", "damage": { "base": { "damageType": "mental", "dice": 1, "die": "d4" } }, "ability": "int", "group": "brawling", "key": "Strike", "label": "Smart Punch", "traits": [ "unarmed" ] } ``` -------------------------------- ### Define Simple Firearms and Crossbows Proficiency Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md This example defines an expert proficiency in simple firearms and crossbows. It uses a definition array to specify item categories and groups. ```json { "definition": [ "item:category:simple", { "or": [ "item:group:firearm", "item:tag:crossbow" ] } ], "key": "MartialProficiency", "label": "PF2E.SpecificRule.MartialProficiency.SimpleFirearmsCrossbows", "slug": "simple-firearms-crossbows", "value": 2 } ``` -------------------------------- ### Create Burst Template Link Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Style-Guide.md Use this to create a pre-set burst template. Specify the distance, and optionally a custom label. ```WikiText @Template[type:burst|distance:x] ``` -------------------------------- ### Unrecoverable Lose Hit Points Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Configures the LoseHitPoints rule element to prevent the damage from being healed. This example deals double the actor's level in unrecoverable damage. ```json { "key": "LoseHitPoints", "recoverable": false, "value": "2*@actor.level" } ``` -------------------------------- ### Configure Token Mark (Basic) Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Basic configuration for the TokenMark rule element, used to mark a token for use as a predicate in other rule elements. ```json { "key": "TokenMark", "slug": "devise-a-stratagem" } ``` -------------------------------- ### Grant Item with Altered Persistent Damage Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Grants an item and modifies its persistent damage properties. This example sets a custom damage type, formula, and recovery DC. ```json { "key": "GrantItem", "uuid": "Compendium.pf2e.conditionitems.Item.lDVqvLKA6eF3Df60", "alterations": [ { "mode": "override", "property": "persistent-damage", "value": { "damageType": "acid", "formula": "2d4" } } ] } ``` -------------------------------- ### Line Template with Width Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Style-Guide.md Create a line template with a specified distance and width, useful for effects like lightning. The label can also be customized. ```WikiText @Template[type:line|distance:120|width:10]{120- by 10-Foot Line} ``` -------------------------------- ### Floor Function for Value Scaling Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Use the floor() function to round down a calculated value. This example scales a flat modifier based on half the actor's level. ```json { "key": "FlatModifier", "selector": "strike-damage", "damageType": "spirit", "value": "floor(@actor.level/2)" } ``` -------------------------------- ### Define Crafting Entry with Batch Sizes Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Defines a crafting entry with specific batch sizes for different item types, including a default batch size. ```json { "craftableItems": [ { "or": [ "item:trait:talisman", "item:trait:alchemical" ] } ], "batchSizes": { "default": 1, "other": [ { "definition": [ "item:trait:bomb" ], "quantity": 10 }, { "definition": [ "item:trait:talisman" ], "quantity": 2 }, { "definition": [ "item:trait:alchemical" ], "quantity": 5 } ] }, "isDailyPrep": true, "key": "CraftingAbility", "label": "Talismans and Alchemy (Especially Bombs!)", "maxSlots": 50, "slug": "talisman-go-boom" } ``` -------------------------------- ### Temporary HP on Events Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Adds temporary HP on specific events like creation or turn start, with conditions. This is for effects that trigger periodically or on certain game states. ```json { "events": { "onCreate": true, "onTurnStart": true }, "key": "TempHP", "predicate": [ "feature:inexorable-iron", "self:weapon:melee", "self:weapon:hands-held:2" ], "value": "max(floor(@actor.level / 2), 1)" } ``` -------------------------------- ### PF2e Module Manifest (module.json) Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Going-Deeper-Topics/Creating-a-PF2e-Content-Module.md This JSON file is essential for Foundry VTT to recognize and load your module. It defines the module's metadata, compatibility, and relationships with game systems. Ensure compatibility versions match your development environment. ```json { "id": "pf2e-example", "title": "PF2e Example", "description": "An example module.", "url": "https://github.com/ExampleRepo/PF2e-Example", "version": "1.0", "authors": [ {"name": "Author 1"}, {"name": "Author 2"} ], "compatibility": { "minimum": "10.285", "verified": "10.285" }, "relationships": { "systems": [{ "id": "pf2e", "type": "system", "manifest": "https://github.com/foundryvtt/pf2e/releases/latest/download/system.json", "compatibility": { "minimum": "4.0.6" } }] }, "packs": [] } ``` -------------------------------- ### Grant Condition with Badge Value Source: https://github.com/kagangtuya-star/foundry-pf2e-wiki-doc/blob/main/docs/Quickstart-guide-for-rule-elements.md Grants a condition and sets its badge value. This example grants the Stupefied condition with a value of 2, triggered by specific oracle curse stages. ```json { "alterations": [{ "mode": "override", "property": "badge-value", "value": 2 }], "key": "GrantItem", "onDeleteActions": { "grantee": "restrict" }, "predicate": [{ "or": [ "oracular-curse:stage:major", "oracular-curse:stage:extreme" ] }], "uuid": "Compendium.pf2e.conditionitems.e1XGnhKNSQIm5IXg" } ```