Trigger Engine but for animations.
Important
If you want a library of premade animations, see pf2e-trigger-animations-collection! (Copy Manifest URL)
Manifest URL, Zip File Download
cd trigger-animations && bun install
| Script | Description |
|---|---|
dev |
Start the development server with HMR |
build |
Build the module for production |
symlink |
Symlink the module to your Foundry data directory |
extract |
Extract Foundry compendium packs |
Other modules can consume trigger-animations's typed API by installing it as a GitHub dependency:
npm install github:mrvauxs/trigger-animationsThen import the types either directly in the code or tsconfig.json:
// Import types directly
import "trigger-animations/types";// Or add to tsconfig.json
{
"compilerOptions": {
"types": ["trigger-animations/types"]
}
}To call methods at runtime, read from the module's global:
const { runFromTrigger } = globalThis.triggerAnimations.api;
runFromTrigger();To add triggers, you can use the Trigger Engine's registerTriggers method, or add the following flag to your module.json.
{
"flags": {
"trigger-animations": {
"triggers": "modules/your-module/yourTriggersFile.json"
}
}
}The module includes multiple triggers for both Trigger Animations and Trigger Engine to smoothen development. There are also some notably missing triggers that have been left for the reasons described below.
The naming convention of each event describes what animation names the event sends out. As with every trigger, any and all of them can be disabled in favor of your own.
Reasoning behind not including a trigger is most often due to the trigger being too specific for broader purposes or requiring too many combinations of parameters to be wholly encompassing.
| Included | Event | Naming Convention / Reasoning |
|---|---|---|
| ✓ | Action Sent to Chat | item-slug |
| ✓ | Attack Rolled | item-slug, weapon group, base-item |
| ✗ | Aura Entered | Too Specific |
| ✗ | Aura Left | Too Specific |
| ✓ | Check Rolled | item-slug |
| ✗ | Combatant Created | Too Specific |
| ✗ | Combatant Removed | Too Specific |
| ✓ | Damage Taken | (damage|healing|persistent|negated):item-slug |
| ✗ | Execute Event | Not Applicable |
| ! | Item Added to Actor | item-slug (only applies to Effects and Conditions) |
| ✗ | On Hook Called | Not Applicable |
| ✗ | Region Triggered | Too Specific |
| ✗ | Test Event | Not Applicable |
| ✗ | Token Created | Too Specific |
| ✗ | Token Moved | Too Specific |
| ✗ | Token Removed | Too Specific |
| ✗ | Turn End | Too Specific |
| ✗ | Turn Start | Too Specific |
