Skip to content

A Roll20 API script for helping with Pathfinder Second Edition

Notifications You must be signed in to change notification settings

tompudding/roll20_pf2_helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PF2 Helper

This is an Roll20 API script designed to help running Pathfinder Second Edition. It has four main features:

  • Parsing of NPCs/Monsters from Paizo PDFs and monster.pf2.tools json
  • Quick macros for rolling saves / skills and attacks of enemies.
  • Hiding of enemy rolls, names, and more correct handling of criticals (including deadly and fatal)
  • Making secret rolls easier

Installation

As it's still in development, PF2 Helper is not available directly from Roll20. To use it, you need a Roll20 Plus account, add an API script to your game, and then copy-paste the contents of pf2_helper.js into the editor window of Roll20, and hit "Save Script"

In your game you should see a number of macros get created in the Collection tab, I recommend setting "parse" and "pf2-config" to be in your bar.

Enemy Parsing

To try parsing an enemy, add a character in the journal tab, and in the GM notes field, copy and paste the statblock for an enemy in from your PDF. Here I have done the Flytrap Leshy:

The parsing algorithm has been designed to handle poorly formatted input as much as possible, so don't worry if there are some extra lines with numbers on, or weird line breaks, hopefully it should be able to handle that. You might also add a token as an avatar at this stage, but there's no need to change the name. Click "Save Changes" and drag it onto the table, and with the token selected, hit the "Parse" button to invoke that macro.

It will pop up and ask you for the name your players will see. That's because when we're hiding rolls we will report just the result to the player, and rather than reveal the name of the creature, we can choose to give it a more descriptive name here. If you'd prefer to use it's real name, just delete the contents of this dialogue and pass an empty string.

With luck you'll see the message "Character Flytrap Leshy parsed successfully using PDF format" whispered to you in the chat, and the character should have been filled in as much as possible:

It will also have set the first token bar to the hit points, and the second to the focus points for the creature, if they have them. Note that because the compendium is not available from the API the spells are created but have no information filled in alas.

You can also use the json output from monster.pf2.tools in the same way.

Rolling Assistants

A number of macros should have been set up automatically as token actions. When you click on your new creature you should see them pop up by the select tool. Try clicking them! Note that by default rolls are whispered to the GM, parsed, then summarized to the players with the modifiers removed (and using the name we gave the enemy earlier). This is both to allow the GM to keep information like modifiers hidden, but also to facilitate rewriting of critical damage. For example, lets see what happens when we roll an attack for our leshy:

The critical damage is exactly twice the regular damage, huzzah! We can also see that it handles deadly and fatal correctly, based on the contents of the traits field for the corresponding weapon. If I edit that field to add fatal and deadly we can see what happens:

You can turn off this roll hiding using the !pf2-config macro, but you'll need to reparse the creature for it to take effect

Secret Rolls

There are two macros that are by default shared with all players to facilitate making secret checks. The first is the "secret" macro. It asks for a bonus, then makes a roll that only the GM can see. If the GM clicks it, then there is no indication given to the players, whereas if a player clicks it it announces that they are making a roll so that can see that it has had an effect.

The secret-skills macro is analogous but more powerful. It allows clicking on a token, or selecting a group of tokens, then choosing a skill (or perception) to roll for them all secretly, which are then presented to the GM in a table, along with the relevant proficiencies. For example:

Again, if a player uses it, it announces in the chat that a roll has been made so the player gets some feedback.

Config

You can use the config macro to enable or disable some features, such as the roll hiding and the MAP popups that are written into the macros.

  • NPC Hide Rolls : This determines if NPCs parsed using the parse macro default to having their rolls whispered to the GM (and then echoed back to the players with the rolls removed), or rolled publicly. Setting this to false will also prevent the pop-up asking for the creature name in the parse macro, since it is not required for public rolls. It does not affect already parsed NPCs.
  • Use MAP Popups : Although the Roll20 character sheet has some support for MAP calculations, for the NPC sheet it currently cannot set agile on a per attack basis. When this toggle is set to true, the attack macros are written to include a MAP dialogue pop up, whose value is set based on the presence of the word 'agile' in the weapon traits. It does not affect already parsed NPCs
  • Use Sweep/other popups : Similar to the MAP popups, when this is set attacks with sweep in the attack traits will popup and ask if this is an attack against the first creature this turn or not and compute the sweep bonus. Forceful is determined using the MAP
  • Use Sounds: When this is on sounds will play on certain triggers as described below
  • Create Macros on Start: When the table is first loaded PF2 Helper goes through and creates macros for use. If you delete a macro, then with this toggle enabled it will be recreated the next time the table loads. Turn this off if you'd like to permanently disable these macros.

Sounds

If you have a sound called "critical_threat" it will play when an attack roll with a natural 20 is rolled in the chat. Similarly "fan_fumble" will play on a natural 1, and "roll_for_initiative" will play when the turn tracker appears.

Bugs and Feature Requests

Please send bug reports or feature requests to tom.pudding@gmail.com

Changelog

1.06

  • Stop erroneously include the "Creature" part in names.

1.05

  • Improve parsing of attribute arrays by coping when the space between the attribute and the value is ommited
  • Fix bug where we were skipping the first line and so ignoring the creature level
  • Handle spell lines where the number of focus points is before the DC rather than after the spell level
  • Handle multiple traits on one line
  • Rewrite the parse macro when we set NPC roll hiding to false; it shouldn't care what its secret name is

1.04

  • Fixed issue parsing strike damage entries that don't include dice, such as "Varies by bomb". Thanks to Dr. Thod for reporting.
  • Added a changelog

About

A Roll20 API script for helping with Pathfinder Second Edition

Resources

Stars

Watchers

Forks

Packages

No packages published