Unlike most character sheets found on Roll20's repo, the Pathfinder Community Sheet must be edited/developed within a specific local environment. Sheetworkers have been separated into various es modules based on their specific sheet sections or function(s). It is necessary to minimally install Git and Node/NPM. The html and js must be bundle using npm commands and webpack. More details below.
In order to edit the sheet locally, complete the following sections;
You will need to fork and clone the Pathfinder Community Sheet using Git and/or Github Desktop Gui.
- Git for Windows
- Git for Linux
- Github Desktop GUI
If you are going to setup with VScode See specific instructions below you can skip the Limited Install steps.
This is a good option if you are not going to use VScode as your editor.
- Download and install latest version of Node Version Manager(NVM): https://github.com/coreybutler/nvm-windows/releases
- Open a NEW shell (Right click -> Open Git Bash Here/Git GUI Here) You can not use one which was opened before NVM is installed.
- Run
nvm install latest
to install the latest version of node.js - Run
nvm list available
and note the version you want to use. The latest version should be fine. - Run
nvm use node <version#>
include the proper version number as noted above.
- Run
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
- Close and reopen your terminal
- Run
nvm install 6.9.5
- Run
nvm alias default 6.9.5
- Run
nvm use 6.9.5
NPM is distributed with Node.js - which means that when you download Node, you automatically get NPM installed on your computer as well.
Curl allows us to download TheArronSheet.js, instead of maintaining our own copy.
- Go to https://curl.se/download.html and download the correct version for your OS.
- Unzip and save to a directory on your computer ie on windows;
c:\curl
and copy curl.exe toc:\windows\system32\
- You may need to add the .\Curl install directory or
curl.exe
to your windows environment PATH variable More Info
Here are some instructions for using VScode for editing the sheet.
- Download the Github Desktop GUI and/or install Git as noted above. You may also have both installed side-by-side.
- Add the Github for Windows install directory to your windows environment PATH variable. More specific instructions; there is only a 'cmd' directory, not a bin directory, contrary to the directions. More info.
- Download and install VScode
- Install Node using vscode's integrated terminal. ie
npm install
- You may want to create a unique Workspace specifically for editing the pathfinder sheet.
- NPM Intellisense
- Eslint extension (works with included ./eslint.config.mjs)
- Prettier Eslint (works with included ./.prettierrc.json)
- GetLens
Curl is required. See above.
- Fork the Pathfinder Community Sheet code if you haven't already done so.
- Clone the project from within VScode or Github Desktop
- It's highly reccomended that you create new "working" branches based on the Development branch.
- Submit commits to your working branch until you are done editing and then submit a pull request to Origin/Develop for approval.
- Once the latest changes on the Develop branch are approved, they will be merged into the Origin/Master.
- A pull request for any new changes on the Pathfinder Sheet's repo Origin/Master will need to be submitted to Roll20's repository for approval. You may need to fork and clone the Roll20's repo.
- Run
npm run build
- Builds the project's index.html Use Case: development/testing. Output to "dist" folder. - Run
npm run prod
- Turns debug off automatically. Builds the project's index.html Use Case: roll20 production. Output to "prod" folder. - Run
npm run postinstall
- downloads TheArronSheet.js and saves it to the ./src folder as TheAaronSheet.cjs "TAS" is used to handle custom logging/debugging as well as some common utility functions. To simplify bundling, the ./src/TheAaronSheet.js included in the repo is a slightly edited (ie adds module.exports) version of TAS to make it an es6 module as well.
- Option 1: Use the bundled index.html from the ./dist or ./prod folder accordingly and the pathfinder.css, translation.json, and sheet.json as included in the ./src folder. These files can be copied as raw text directly into a Custom game's, "Game Settings" editor (HTML|CSS|TRANSLATION). Do not rely on the Preview tab. Always view the sheet in-game for an accurate load.
- Option 2: Sync a Sandbox game to your local files using Scott C's Chrome browser extension Roll20 API and Sheet Autouploader You may need to create a Symbolic link for the ./src/pathfinder.css and/or the ./src/translation.json to the ./dist and ./prod folders so the extension can easily detect local changes.
- Webpack dependencies: update webpack and dev dependencies with caution.
Each "page" or section of the Pathfinder sheet has one or more modules associated with it. For instance, the core page has PFAbilityScores, PFInitiative, PFClassRaceGrid etc. The Defense page has PFDefense, PFSaves. The Attacks page has PFAttacks, spells page PFSpells, etc.
Pages with repeating sections will have a module for the repeating list, another module for the page-level variables (usually above it on the page), and a 3rd module for "roll options" the user has selected. For the attacks page it is :
- PFAttacks: the repeating_weapon list
- PFAttackGrid: the melee,ranged,cmb grid at the top
- **PFAttackOptions: ** the options checkboxes and how they affect macros
spells:
- PFSpells: the repeating_spells list
- PFSpellCasterClasses: The spell caster section, spells per day, spell points, etc
- PFSpellOptions: the spell options and updating of macros