Skip to content

Adding System Support

otigon edited this page Oct 16, 2021 · 10 revisions

Automated Animations access to a few key pieces of information for the module to work.

  1. Item: The Item instance that is being used
  2. Source Token: The Token that is using the Item
  3. Target(s): The current targets when the Item is used/rolled

For MOST systems, this data is obtained using the createChatMessage hook. Other systems, such as Warhammer, provide system specific hooks that can be used to grab the information.

Furthermore, many systems roll separately for Attack and Damage. The Chat Message needs to be evaluated in these cases to determine if the player is rolling an Attack or Damage, OR in some cases the item has neither an Attack OR Damage roll, so that would need to be evaluated as well.

Some systems, such as Pathfinder 1, do not separate these rolls and instead put all the information to the chat card at once. These types of systems are much easier to parse.

NOTE: NOT ALL SYSTEMS CAN BE ADDED INTO AUTOMATED ANIMATIONS.
What this means is that many systems do not pass the required data to allow Automated Animations to work. Feature requests can be added for those systems to add this data to either the createChatMessage hook OR by way of their own system hooks.

Let's look at an easy example using the Pathfinder 1 system:

First, let's start by logging the hooks to the browser Console using this:
CONFIG.debug.hooks = !CONFIG.debug.hooks; if (CONFIG.debug.hooks) console.log("NOW LISTENING TO ALL HOOK CALLS!"); else console.log("HOOK LISTENING DISABLED.");

Clone this wiki locally