Skip to content

Pathfinder Companion: fix condition changes resetting token HP, and Mook Numbering on PCs - #2360

Open
Sheo42 wants to merge 3 commits into
Roll20:masterfrom
Sheo42:pfcompanion-condition-hp-reset
Open

Sheo42 wants to merge 3 commits into
Roll20:masterfrom
Sheo42:pfcompanion-condition-hp-reset

Conversation

@Sheo42

@Sheo42 Sheo42 commented Oct 30, 2026

Copy link
Copy Markdown

This PR adds version 1.01793347442 of the Pathfinder Companion Script, with two bug fixes that we have used in two live game sessions.

Following the repo layout, the new version folder holds a full copy of the script. The first commit is a plain copy of 1.01518021707 with only the version numbers changed, so the fixes are easiest to review commit by commit.

1. Applying a condition resets the HP of the character's tokens

applyStatus set the marker on the first token found for the character and then called updateAllTokens(character, graphic). That first token can be an old copy on another page. updateAllTokens saves it as the default token and copies its bars and name onto every other token of the character. As a result, every condition change (for example Prone or Grappled) set the HP shown on the token back to an old value.

Fix: applyStatus now sets the marker on every token that represents the character and no longer calls updateAllTokens. Mook tokens are handled as before.

Side effect: a condition change no longer saves a new default token. The default token is still updated by the other "Maintain PC default tokens" triggers.

2. Mook Numbering renames PCs and unique NPCs

Mook Numbering numbers a new token when none of its bars is linked. A token has no bar links yet when it is created, so PCs and unique NPCs were renamed too (for example "Lune 1").

Fix: a token is now numbered only if its character is not controlled by a player and the character's default token has no linked bar.

Checks

  • script.json validates against script.json.schema, and every folder listed in previousversions exists.
  • node --check passes on the new file.
  • Both fixes have been tested in game on Roll20 with the Pathfinder Community sheet.
  • Raising schemaVersion keeps the existing settings: the update block in checkInstall only fills in missing keys.

🤖 Generated with Claude Code

Sheo42 and others added 3 commits October 30, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant