Skip to content

System Support

The module branches on game.system.id for both effect initialization and per-token effect application. Three paths exist: D&D 5e, Pathfinder 2e, and a generic fallback for everything else.

D&D 5e uses the standard ActiveEffect path. When a token enters Dark or Dim lighting, an ActiveEffect is created on the actor with the data described in Active Effects. The effect lives on the actor directly (transfer: false) and is removed when the condition returns to Bright or the token becomes ineligible.

If Cauldron of Plentiful Resources is installed with its Effect Interface setting enabled, the module creates Dark and Dim effects on its effect-interface item during world setup and routes effect creation through it. See Cauldron of Plentiful Resources for details.

Works with Tidy5e Sheets without additional configuration.

Pathfinder 2e uses an Item-based effect model. During world setup the module creates two world Items in the Items directory (only if not already present):

ItemRollOption
Dark (localized)lighting:darkness
Dim (localized)lighting:dim-light

Item names are read from TOKENLIGHTCONDITION.Effects.Dark.Name and TOKENLIGHTCONDITION.Effects.Dim.Name. Descriptions are read from the .Description keys. Each item is created with:

  • type: 'effect'
  • system.duration: { value: 1, unit: 'unlimited', expiry: 'turn-start', sustained: false }
  • system.tokenIcon.show: true
  • system.unidentified: true
  • system.rules: [{ key: 'RollOption', option: '<one of the two above>' }]
  • flags.tokenlightcondition: { effectType: 'dark' | 'dim', version: '2.0.0' }

When a PF2e token’s condition resolves to Dark or Dim, a copy of the matching world Item is created as an embedded Item on the actor. Clearing finds any embedded Item whose name matches the localized Dark or Dim name and deletes it.

PF2e compatibility for Foundry V13 is not fully guaranteed. Report any issues you encounter on V13.

For any system that is not dnd5e or pf2e, the module uses the generic path:

  • On world setup, no effect initialization runs (the generic path uses on-demand ActiveEffect creation).
  • On condition change, an ActiveEffect is created on the actor using the same EFFECT_DATA factory as the D&D 5e path: hardcoded English names, the two image paths listed in Active Effects, and the dark or dim status set.
  • Clearing finds any ActiveEffect on the actor whose flags.tokenlightcondition.type is set and deletes it.

Any system that consumes Foundry’s standard ActiveEffect documents and status arrays is compatible. Any module that reads the dark or dim status will see the effect.

The PF2e initialization step creates two persistent Items in the world’s Items directory. They are visible to you in the Items sidebar and exist for the lifetime of the world. Deleting them and reloading the world causes the module to recreate them on the next setup pass.

D&D 5e and generic systems have no equivalent persistent state; effects are created per-actor at calculation time and cleaned up on condition change.