Contributing - MrVauxs/pf2e-graphics GitHub Wiki
Contributing
This page goes over how to set up the dev environment and general guidelines as to making new default animations.
Contributing Animations
All animations can be found in the animations/
folder. They are plain JSON files that get concatenated when the module is compiled.
A recommended text editor is VSCode as it has JSON Schema integration, allowing you to be given code suggestions.
Designing an Animation
When designing a new animation, please make sure the following things are true:
- The animation uses JB2A assets or in-house assets with proper licensing.
- When designing an animation for auras or an effect, make sure to give alternatives for lower performance machines. This can include having the animation only trigger at the beginning of one's turn, instead of being always on. Review the Settings page for expectations of each setting.
- Only the
High
performance setting can have complex (2+ files) animations that last forever. - This rule can be omitted for effects with short durations, or that consist of only one file (ex. Spell Effect: Shield).
- Only the
[!important] Animations options are based on Sequencer functions, which can be reviewed here. There are some special properties available in the options object as well, that are explained in the JSON Schema.
Contents
contents
is an important time-saver when it comes to creating animations. A contents
array is a list of child animations that inherit everything in the above parent. If a child has the same property listed, it overrides the parents instead.
So a practical example is as follows, an object of
{ "a": 1, "contents": [ { "b": 2 }, { "c": 3 } ] }
will be turned into
[ { "a": 1, "b": 2 }, { "a": 1, "c": 3 } ]
Triggers
Certain triggers have important caveats.
- If you want to make a Template preset animation for example, you must use
Template Placed
trigger, as it is the only trigger that provides actual templates to the animation backend. Everything else sends tokens and thus would result in wrong animations. It is worth checking what data is provided to you when placing a template or using an activity by using Dev Mode. - Modifiers Matter trigger is an unique trigger that only works with the PF2e Modifiers Matter module enabled. The roll options provided are the triggering items (
item.getRollOptions()
) andsignificance:essential
,significance:helpful
,significance:hurtful
, orsignificance:detrimental
.
Forking and Cloning Repository
On how to contribute to GitHub Projects in general, I recommend reading GitHubs Contributing to a Project page.
Once the module is downloaded onto your computer or server, you must install dependencies through npm i
.
Afterwards, you are welcome to either modify the module and build it with npm run build
, or run a local test server with npm run dev
(You need to have an open Foundry instance on port 30000). The test server has hot module reloading, allowing you to quickly work on animations without refreshing the page every time you make a change.