Cauldron of Plentiful Resources
When Cauldron of Plentiful Resources is installed and its Effect Interface setting is on, Token Light Condition routes effect creation through Cauldron of Plentiful Resources rather than creating ActiveEffects directly on the actor.
When the integration activates
Section titled “When the integration activates”Both conditions must be true at world ready time:
game.modules.get('chris-premades')?.activeis true.game.settings.get('chris-premades', 'effectInterface')istrue.
If either is false, the module falls back to its normal per-system path described in System Support. No integration code runs.
The check runs once after the world is ready, with a 100 ms delay to let Cauldron of Plentiful Resources finish its own init. It does not re-run when Cauldron of Plentiful Resources’ setting is toggled at runtime. Reload the world after enabling its Effect Interface for the integration to take effect.
What gets created
Section titled “What gets created”During initialization the module looks for the Cauldron of Plentiful Resources effect-interface Item, identified by item.flags['chris-premades'].effectInterface. If found:
- The module checks whether the Cauldron of Plentiful Resources Item already has effects with
flags.tokenlightcondition.type === 'dark'or'dim'. - For each missing one, it creates an ActiveEffect on the Cauldron of Plentiful Resources Item using the same
EFFECT_DATAfactory as the generic path: same names, ids, icons, and statuses described in Active Effects.
The Cauldron of Plentiful Resources Item holds the Dark Lighting and Dim Lighting effect templates that will be applied to tokens.
Runtime application
Section titled “Runtime application”When a D&D 5e or other generic-path token resolves to Dark or Dim:
- The module re-checks that Cauldron of Plentiful Resources is active and its Effect Interface is on.
- It calls
_findCPREffect(effectType)to locate the matching effect on the Cauldron of Plentiful Resources Item. - It clones the effect’s data, sets
statuses: [effectType], and creates an ActiveEffect on the actor withkeepId: true.
If the Cauldron of Plentiful Resources Item or the matching effect cannot be found at apply time, the module logs a warning and falls back to creating the effect using the local EFFECT_DATA factory. No effect creation is lost.
Clearing always uses the generic clear path: any ActiveEffect on the actor whose flags.tokenlightcondition.type is set is deleted, regardless of how it was created.
PF2e behaviour
Section titled “PF2e behaviour”The Cauldron of Plentiful Resources integration is a no-op on Pathfinder 2e. PF2e systems use the Item-based effect path described in System Support and never route through Cauldron of Plentiful Resources.
Logs to watch
Section titled “Logs to watch”With Logging Level set to All Messages, look for these strings to confirm the integration:
Setting up Chris's Premades integrationCreated CPR effect: dark/Created CPR effect: dimCPR integration completed successfullyCreated CPR <type> effect:(per-token apply path)
The log strings above are the literal output emitted by the source code and have not been updated to the current module display name.
If you see CPR Effect Interface item not found, the Cauldron of Plentiful Resources Item with the effectInterface flag is missing. Recreate it from the module’s settings and reload the world.