Shattered Codex

Wiki

Modules/SC - Resources

SC - Resources

Premium resource management for Actors, with Active Effect grants, recovery, automations, chat history, and D&D 5e activities.

Foundry v13-v14System Any; D&D 5e integrationsPremium

Overview

SC - Resources lets GMs and players track custom numeric resources on Actors, such as Mana, Corruption, Sanity, or ammunition. It keeps stored points, spendable points from Active Effects, and temporary modifiers distinct. Items can grant resources to their owner through Active Effects; Items do not store their own SC Resources balances.

Compatibility and Installation

Foundry VTT
v13 and v14
Game system
Any. The sheet tab, activity consumption, rest recovery, and roll formulas are D&D 5e integrations.
Required modules
None
Recommended modules
libWrapper, socketlib, SC - More Activities, and Tidy 5e Sheets
Languages
English and Brazilian Portuguese

Core resource management and recovery work on any system. The D&D 5e integration activates automatically and supports two dnd5e series:

dnd5e versionFoundry VTT
5.3.xv13 (13.347 or newer) or v14
6.0.0v14 (14.367 or newer)

The Foundry builds in this table are the requirements of the dnd5e system itself. Use the dnd5e 5.3 series on Foundry v13; dnd5e 6.0 requires Foundry v14.

None of the recommended modules is required. Each one adds the following when it is active:

ModuleWhat SC - Resources uses it for
libWrapperRegisters the module's wrappers around Foundry and dnd5e methods, such as Actor data preparation, roll data, the dnd5e sheet tab, the activity usage dialog, and the rest result message. Without libWrapper, the module patches the same methods directly.
socketlibRecommended by the module manifest. Version 0.2.9 does not call it: requests to the Actor's coordinator use Foundry's built-in module socket, so every feature works without socketlib.
SC - More ActivitiesLists Transfer Resource and Convert Resource in its activity catalog, where a GM can disable them, and groups them under SC Resources in the activity creation dialog.
Tidy 5e SheetsReceives the Resources tab, the sidebar resource bars, the spell cost label, and the hidden spell slots on its own sheets.

Enable the module and create a resource

After installing through the Download Hub, launch your world and sign in as a GM:

  1. Open Game Settings > Manage Modules and enable SC - Resources.
  2. Select Save Module Settings and let Foundry reload the world.
  3. Open an Actor's ⋮ sheet menu and select Manage Resources. On supported D&D 5e sheets, you can instead open the Resources tab in edit mode.
  4. Select Add resource and name the resource.

A GM always sees Manage Resources. Players see it only on Actors that already have resources.

What You Can Do

Video Overview

Watch Shattered Codex's introduction to SC - Resources alongside the written steps below.

Watch SC Resources – Mana, Rage, Corruption & More for Foundry VTT on YouTube

Understand Resource Balances

Stored on the Actor                 5  (storedBase)
+ available Active Effect pool     3  (pool)
= spendable balance                8  (base)
+ temporary value modifier        2
= effective reading              10  (value)

Spendable pools are separate balances supplied by Active Effects. A modifier to the effective value changes what the resource displays but does not add points that can pay a cost. A modifier to the maximum raises the limit without automatically refilling the balance.

By default, a spend uses available source pools first, then stored points. Gains refill pools first, up to their capacities. The resource's Spend order can put stored points first. A pool's Spend priority puts lower-numbered pools first. When a pool exists, Sources lists the balances in their payment order and shows inactive pools separately.

An effect that grants five Mana as a pool can be spent down to two. Simply opening a sheet or preparing the Actor again does not refill it. Its reactivation and removal policies control what happens when the effect stops and returns.

Create And Manage Resources

  1. Open the Actor's ⋮ menu and select Manage Resources, or open Resources on its sheet and switch to edit mode.
  2. Select Add resource and enter its name. If the world has base resources the Actor does not have yet, choose A new resource or one From the world's resources. A new resource starts at 0, with a minimum of 0 and no maximum.
  3. Open Configure to set a maximum if needed, then adjust its appearance, recovery, damage absorption, automations, and Pays for rules.
  4. Set its stored value with the field or −/+ controls. Open Breakdown to inspect the spendable balance and effective reading.

The Resource Manager saves changes as you make them. It remains available even if the GM hides the Resources tab.

The resource ID is the stable name used by macros, Active Effects, formulas, and activities. It begins with a letter, uses only letters, digits, and underscores, and has at most 32 characters. IDs are case-sensitive and cannot be renamed; display names can. For example, bloodCharges works, while blood-charges does not.

In D&D 5e worlds, character, NPC, and vehicle sheets show a Resources tab in the sheet's style. Character sheets can also show selected resource bars below Hit Dice; see Resources on D&D 5e Sheets.

Appearance → Customize in Configure opens an editor with a live preview and three tabs: Colors (a palette color, a ready-made gradient, or your own list of 1 to 6 colors), Effect (an animated style and its speed), and Text & frame. Nothing is written until Save. Resource bars keep the same appearance in the Resource Manager and on the sheet. Motion stops when the user chooses Off for Animated bar styles or the system requests reduced motion.

The GM can hide the Resources tab in module settings. Manage Resources remains available from the sheet menu. Tidy 5e Sheets has its own supported Resources tab, including its edit lock; Tidy's own tab configuration can reorder or hide it.

Set up world resources

A GM can define a resource once for the whole world instead of configuring it sheet by sheet. Open Game Settings → SC - Resources → Set up world resources. The window lists World default and every resource ID that a world Actor has. Add a resource adds an ID before any Actor has it.

For each resource ID, the window keeps two things:

  • Bar appearance. Customize sets how that resource's bar looks on every Actor. World default is the look of every resource without one of its own. A look set on an Actor's own resource always wins over the world's.
  • Base resource. A stored definition: name, bounds, spend order, recovery, damage absorption, automations, payments, sheet sidebar choice, chat options, and player access. It holds no balance, pool, or bar appearance.

To create and distribute a base resource:

  1. Select the resource and choose Create the base, or select the bookmark (Save this actor's resource as the base) on the row of an Actor that already has the resource configured.
  2. Set the definition in the resource editor. The value you enter is the balance the resource starts with on an Actor.
  3. Select Put on actors…, tick the Actors, and choose what happens to an Actor that already has the resource: Is left alone or Gets this definition; its balance is kept.
  4. Select Apply.

Changing a base does not change any Actor until you apply it. Actors whose resource no longer matches are marked Differs from the base; update one row, or use Update all to the base. Remove from actors… deletes the resource from the Actors you tick, and Delete resource deletes the world's base and bar look for that ID. Neither removes what an effect or Item grants. Export bases and Import bases move base resources between worlds as a JSON file.

Applying a base never changes Active Effects, Items, balances, pools, or an Actor's own bar look. The window covers world Actors only.

Configure Recovery

In a resource's Configure → Recovery, select Add recovery, a period, and a method. A bounded resource can Recover All, Recover Half, Lose All, or use a Formula such as 1d4 + 2. Unlimited resources use formulas. A negative formula reduces the balance. Only the first matching rule applies in a recovery pass.

In D&D 5e, rests, calendar/day changes, and combat periods can trigger recovery automatically. Long rest includes short rest rules. Available periods include long and short rest, day, dawn, dusk, initiative, turn start, turn end, and each turn. Recovery from a rest appears in the native rest chat card.

Other systems do not tell the module when a rest or a day has passed. Once a resource has a rule, the Resource Manager shows Recover resources (the hourglass). Choose the period that has passed: Long rest, Short rest, New day, End of scene, or End of session. Only periods with a rule on that Actor are offered, and only to users who may change its values.

On any system, a macro can call SCResources.recover(actor, "lr") to apply the same rules.

An Active Effect pool can have its own recovery rules in Resource source policies, such as a staff refilling at dawn. Those rules recover that pool only; resource-level rules recover the other balances.

An Active Effect can also give a resource a recovery rule while the effect applies, with the recovery key in Active Effect Keys And Examples. The resource's Recovery section lists those rules, read-only, under From effects.

Build Automations

Open a resource's Configure → Automations and select Add automation. An automation has a trigger, optional condition and test, and an ordered list of consequences. Active Effects can also grant automations through ⋮ → Resource automations, the helper's JSON change, or shortcut keys.

TriggerUse
EventRun each time a named event occurs, such as damageTaken, restCompleted, resourceChanged, or a declared custom event.
ValueRun when the effective or spendable value reaches or crosses a threshold. Choose once, every qualifying move, or a re-arm rule.

Event formulas can use @scEvent values; value-trigger formulas can use @scThreshold. Value automations support steps, movement direction, re-arming, and an option to trigger if the resource is already past the threshold when the rule starts. resourceChanged and dieRolled come from SC Resources; D&D 5e adds damage, healing, rest, turn, activity, spell, saving throw, and other system events. Some attack and damage-attribution events depend on how targets and chat cards are used.

Conditions can be built in the visual Builder or edited as JSON. The editor shows whether a condition is Met, Not met, Invalid, or Needs a roll for the current Actor. Optional tests include a dice roll, a D&D 5e saving throw, or an ability check. A Dice roll test works on any system. The Roll automation tests automatically setting chooses automatic rolls or a chat card that the GM or an Actor owner answers.

Consequences run in order. The types are Resource, Message, Condition, Effect, Remove condition, Remove effect, Event, Activity (D&D 5e), Macro, and Damage (D&D 5e damage, healing, or temporary hit points). The automation editor allows more than one of each. Chains stop after three links to avoid endless loops. A failed consequence does not stop the remaining ones.

A Macro consequence can name a dropped macro or keep its own script: Write macro opens an editor, and Keep a copy here copies a dropped script macro's code into the automation. A kept script follows the JavaScript in conditions and macros setting.

Remove effect with an empty field removes the effect that grants the automation, so an effect can end itself. It never removes effects granted by Items.

As an example, set a Value trigger at effective Corruption 10, add a saving throw test, and add an effect consequence that applies when the save fails. Check the summary and current condition state before leaving the editor. The thresholdCrossed hook can also notify another integration.

Resources on D&D 5e Sheets

On dnd5e 5.3 and 6.0, the Resources tab appears on supported character, NPC, and vehicle sheets. The tab meter displays the stored and source-pool balance and marks a different effective reading. Open Breakdown for its contributors and Sources for the balances that actually pay costs. The Configure panel is available to authorized users while the sheet is in edit mode.

Show in sheet sidebar in Configure also draws the resource's bar on the character sheet, below Hit Dice: in the sidebar of the dnd5e sheet, and under the Hit Dice bar of Tidy 5e Sheets. NPC and vehicle sheets have no such bars. When the Crux module is active, the same bars appear in the Crux tray's Actor panel, and the option is also offered on NPCs.

Item effects can grant resources to their owner with the mod, pool, and accumulate keys. The Item itself does not carry a resource balance. An equipped item's effect follows dnd5e equipment, attunement, effect, and condition rules.

Roll formulas can read:

1d6 + @scResources.corruption.value
@scResources.mana.base

.value is the effective reading and .base is spendable, including available pools. .storedBase, .pool, .min, .max, .percent, and .unlimited are also available where applicable. An unlimited resource has no numeric .max.

Pay Activity And Spell Costs

For an activity, open its Consumption section, choose SC Resource, set Target to the Actor resource ID, and enter the amount. The target suggestions list the Actor's resources; you can type an ID even on an unowned Item. An old actor:<id> target still works. A positive amount spends points; a negative amount gains them. The usage dialog warns about an unaffordable cost, and its chat card can undo the consumption.

When several balances can pay, Pay … from in the usage dialog offers the default order, a specific balance, or an allowed substitute. To fix the source in an activity target, use mana@stored, mana@pools, or mana@item for that activity's own Item-granted pool. The refund restores the balances that actually paid.

Configure → Pays for on a resource can let it pay another resource's costs at a chosen rate. For a spell resource, configure spell-slot payments by level or with a formula; a payment can be the default choice in the casting dialog. Active Effects can grant these rules through the substitute keys in Active Effect Keys And Examples.

For spell slots, add a payment in Pays for, choose Spell slots, and enter the Cost per slot level: one cost per slot level from level 1, such as 2,3,5,6,7,9,10,11,13, or a formula using @level. Two lists separated by | price a spell cast at its own level and a spell raised to that level separately. Tick Default payment to preselect the resource. The casting dialog then shows Pay for the spell with: a spell slot, or each resource that can pay for the chosen level.

A GM controls how spell payments behave and display in the Spell payments and Spell cost label tabs of Module Settings. By default, the Spells tab states each covered level's cost, the cast dialog shows the cost under Cast at Level, and spell slots remain visible and usable.

For a negative activity cost, Block gains above the maximum rejects a gain that would not fit in full. It is off by default; otherwise excess gain is discarded at the cap.

Modify And Transfer Resources

SC - Resources adds three dnd5e activity types. Refunding an activity's consumption does not undo the changes these activities make; check the activity's result card.

Modify Resource

Modify Resource applies a list of Changes to the Acting actor or the Selected targets. Use Add a change for each line, up to twelve:

  • Resource: a resource ID, an operation (Add, Subtract, or Set balance), and a formula.
  • Hit points: a formula healed as dnd5e healing.
  • Temp hit points: a formula granted as temporary hit points.

Each formula rolls once per use and applies to every recipient. Add and Set balance give the resource to a recipient that does not have it; Subtract needs the resource to exist.

OptionEffect
RollFrom the chat card posts a Roll changes button that the user or a GM presses. On use rolls and applies the lines as the activity is used. New activities use From the chat card.
Roll dialogOn by default. Opens dnd5e's roll dialog before the lines roll, with a situational bonus and roll mode.
Limit gainsOff by default. Cancels an Add that would exceed a recipient's maximum instead of discarding the excess.
Resistance testNo test, Roll automatically, or Chat card: recipients roll. Set a Saving throw or Ability check, the DC, and whether a success means No effect, Half, rounded down, or Full effect.
Applied Effectsdnd5e's own list. The usage card offers the listed effects to apply to targets.

Transfer Resource

Transfer Resource moves points between the acting Actor and each target. Choose Drain or Give, the Resource taken, an optional different Resource received, and the Amount formula. When the source is short and When the receiver is full decide what happens at the limits. It supports the same resistance test as Modify Resource. Each transfer is coordinated so a failed credit undoes its debit.

Convert Resource

Convert Resource trades one thing of the acting Actor's for another of its own, such as hit points for Mana. Each entry under Conversions sets:

  • Spend and Gain: a resource ID or Hit points.
  • Every and Gives: the rate. Every 2, Gives 1 turns 2 hit points into 1 Mana.
  • Amount: Player chooses, Fixed value, Formula, or As much as possible, with an optional Limit.

A use spends only whole steps of the rate, no more than the source has, and no more than the destination has room for. Hit points are never spent below 1. With several conversions, or one the player chooses, the use opens a panel before any cost is paid; closing it cancels the use.

Targets and permissions

Targeted Actors the user does not own are changed by that Actor's coordinator, usually the GM. Without a GM online, a player cannot change an enemy's resources. The GM can disable player resource activities on targets with Resource activities may affect targeted actors.

All three activities are included in SC - Resources. With SC - More Activities active, Transfer Resource and Convert Resource register through its activity catalog, where a GM can disable them, and appear in an SC Resources group of the activity creation dialog.

Absorb Damage With A Resource

In D&D 5e worlds, a resource can take damage in place of hit points, like a mana shield.

  1. Open the resource's Configure panel and find Damage absorption.
  2. Select Add absorption.
  3. Under Absorbs, choose Absorb All, Absorb Half, or a Formula such as 2d6.
  4. Set Resource spent and Damage absorbed as whole numbers. 2 and 1 spends two points for each point of damage absorbed.

When damage is applied to an Actor that can pay for a rule, the damage is held and a chat card is whispered to the GM and the Actor's owners. Absorb spends the resource and deals the rest to temporary hit points, then hit points. Take deals the whole damage. Nothing is dealt until someone who may change the Actor answers the card.

The card uses the damage dnd5e calculated after resistances, immunities, and vulnerabilities. Healing never asks. An Active Effect can grant a rule with the absorb key in Active Effect Keys And Examples.

Module Settings

Game Settings → SC - Resources has three entries:

ButtonOpensWho
Open settingsThe module's settings window, grouped into the tabs below.Everyone; players see only Display and Diagnostics
Set up world resourcesWorld bar appearance and base resources.GM
Build effect keysThe Active Effect helper.GM

In the settings window, Save Changes writes the options and keeps the window open. Reset defaults restores the visible tab without saving it.

Permissions (GM, world)

  • Players' access to their resources — Only values (default) lets owners see and adjust values. View what they do also opens read-only details for recovery, automations, payments, sources, and breakdowns. Edit lets owners configure, create, and delete resources.
  • Show the contribution breakdown to players — Off by default. When on, Actor owners can see which items and effects contribute to a resource.
  • Resource activities may affect targeted actors — On by default. When on, a player's Modify Resource and Transfer Resource activities may affect targeted Actors they do not own. When off, players can affect only Actors they own.
  • Activities and automations create the resources they name — On by default. When on, a qualifying activity or automation can create a missing resource, even if the player cannot create resources directly. Turn it off to restrict creation to users with permission.

A GM can override player access, chat visibility, and chat reversion for individual resources in the Actor's Permissions window, opened from the shield button beside Add resource. An individual resource's Edit access allows its owners to configure it; deleting it still follows the world's access level.

Appearance (GM, world)

  • Theme — Arcane by default. Changes the Resource Manager, world overview, and settings window. A sheet's Resources tab keeps its sheet theme.
  • Resource icon — Flask by default. Changes the icon used for the sheet tab, Manage Resources entry, manager, and source policy controls.

Character sheet (GM, D&D 5e worlds)

  • Show the Resources tab — On by default. Adds the tab to supported character, NPC, and vehicle sheets, including Tidy 5e Sheets. When off, Manage Resources remains available from the sheet's ⋮ menu.

Spell payments (GM, D&D 5e worlds)

  • Hide the spell slots a resource pays for — Off by default. Leaves the spell slots off the Spells tab at the levels a resource of the Actor can pay for, on dnd5e sheets and Tidy 5e Sheets. It is display only: a cast that chooses the slot still spends it, and edit mode shows every level.
  • Resources replace spell slots where they pay — Off by default. When on, a spell cast at a level a resource prices is paid with the resource and never with a spell slot. If the payment does not apply or the Actor has too little of the resource, the spell is not cast. Levels no payment prices keep using slots.
  • Show the cost in Cast at Level — On by default. In the cast dialog, each level states what the spell costs in the paying resource, in place of the slots left.
  • Upcast formula — @upcastCost by default. Prices a spell cast above its own level from the payment's cost table. Use the Full price or Cumulative preset, or Build formula. It does not apply to a payment whose cost is itself a formula.

Spell cost label (GM, D&D 5e worlds)

  • Show what spells cost — In each spell level's header by default. In the header, and on spells of another level also marks spells whose own level differs from their section's. Nowhere shows no label.
  • Look — Dark plate, gold edge by default. The other choices are Gold plate, The resource's bar colours, Outline in the sheet's colour, and Plain text.
  • Place — Where the level's spell slots are by default, or Beside the level's name.
  • Show the resource's name — On by default.
  • Show how many casts are left — On by default. Adds a count such as ×3 after the cost.
  • Show the resource icon — Off by default.

The label is dimmed when the Actor has too little of the resource or the payment is not applying. Edit mode shows no cost.

Events (GM, world)

The tab lists the events the system and other modules provide, for reference.

  • Custom events — Empty by default. Declare an event ID and label to offer the event in automation editors. A macro or integration must emit the event with SCResources.events.emit(); declaring it does not fire it.

Automations (GM, world)

  • Apply effects automatically — On by default. Effect and Condition consequences apply immediately. When off, they appear on a chat card for a GM or Actor owner to apply.
  • Roll automation tests automatically — On by default. Saving throws, checks, and dice tests roll when the automation runs. When off, a GM or Actor owner must answer a chat card before consequences proceed.
  • JavaScript in conditions and macros — Only scripts a GM saved or approved by default. It covers scripted conditions and macros that an automation keeps as its own script. Always approve: every script runs permits any script written by someone who can edit an automation; None prevents these scripts from running.

Chat log (GM, world)

  • Post resource changes to chat — Every resource by default. Resources marked in Configure posts only for resources with Post changes to chat enabled. Off posts no change cards.
  • Who sees the cards — GM only by default. The other choices add the Actor's owners or everyone. Individual resources may override visibility in the Actor's Permissions window.
  • Players may revert changes — Off by default. When on, owners can Revert changes to their Actors from chat cards; a GM can always do so. A revert reverses the resource change once, but does not undo automations it triggered. Creating or deleting a resource also requires the player's corresponding access level.

Display and Diagnostics (each user, this browser)

  • Animated bar styles in Display — Always by default. Only under the pointer limits animation to the hovered bar; Off keeps bars still. A reduced-motion preference also stops animation.
  • Debug logging in Diagnostics — Off by default. When on, logs resource resolution and warns about Active Effects aimed at stored values.

Set up world resources is explained in Set up world resources.

Configure an individual resource

Open Configure on a resource in the Resource Manager or a supported sheet:

  • Name changes its visible label. Its ID stays fixed for macros, effects, formulas, and activities.
  • Minimum, Maximum, and Unlimited set the allowed balance range. A new resource starts at 0, has a minimum of 0, and has no maximum.
  • Spend order chooses whether source pools or the Actor's stored points pay first. Pools pay first by default; a pool's Spend priority decides its order among pools.
  • Appearance → Customize sets the bar's colors, gradient, animation style, speed, text, and frame. The appearance follows the bar between the Resource Manager and supported sheets.
  • Recovery, Damage absorption, Automations, and Pays for define refill rules, damage absorption rules, event or value responses, and which other costs the resource can pay. Their workflows are explained above.
  • Post changes to chat selects this resource when the world setting is Resources marked in Configure. Show in sheet sidebar adds its bar below Hit Dice on a dnd5e or Tidy 5e Sheets character sheet; it does not apply to NPC or vehicle sheets.

Resource source policies on an Active Effect control a granted pool's capacity, spending, recovery, reactivation, and removal behavior. They are explained in Active Effect Keys And Examples below.

Active Effect Keys And Examples

Use an Active Effect for an ongoing modifier, a separate spendable pool, a grant applied on activation, or an automation supplied by an item or state. Add changes to the effect's native Changes list. For an effect on an Item, make sure dnd5e applies or transfers it to the Actor. Equipment, attunement, suppression, and conditions determine whether it contributes.

KeyModeUse
flags.sc-resources.mod.<id>.valueAdd; Subtract on Foundry 14Temporarily changes the effective reading. It is not spendable.
flags.sc-resources.mod.<id>.minAdd; Subtract on Foundry 14Temporarily changes the minimum.
flags.sc-resources.mod.<id>.maxAdd; Subtract on Foundry 14Temporarily changes a finite maximum.
flags.sc-resources.pool.<id>.valueAddGrants a separate pool of spendable points.
flags.sc-resources.accumulate.<id>.valueAddCredits the Actor's stored balance when the effect activates.
flags.sc-resources.automation.<id>CustomGrants an automation described by JSON.
flags.sc-resources.on.<eventId>.<id>Add, Subtract, or OverrideChanges a resource when the named event occurs.
flags.sc-resources.cast.<eventId>Add or OverrideUses a D&D 5e activity when the event occurs.
flags.sc-resources.recovery.<period>.<id>Add or OverrideGives the resource a recovery rule for that period. The value is recoverAll, recoverHalf, loseAll, or a formula. Override replaces the resource's own rule for the period.
flags.sc-resources.absorb.<id>AddLets the resource absorb D&D 5e damage. The value is absorbAll, absorbHalf, or a formula, optionally followed by a rate such as | 2:1.
flags.sc-resources.substitute.<costId>.<payId>Add or OverrideLets one resource pay another resource's cost.
flags.sc-resources.substitute.spellSlot.<id>Add or OverrideLets a D&D 5e spell use this resource instead of a slot. Override also makes it the default payment.

Replace <id> with the exact resource ID. <period> is a recovery period ID such as sr, lr, or dawn. A mode a key does not list does nothing. Foundry 13 has no Subtract mode, so use Add with a negative amount. For example:

Key:   flags.sc-resources.mod.corruption.value
Mode:  Add
Value: 3

This raises effective Corruption by three while the effect applies. The stored balance is unchanged. Set Value to -2 for a penalty. To grant five points that the Actor can spend, use flags.sc-resources.pool.mana.value, Add, 5. To add points to the Actor's own balance on activation, use flags.sc-resources.accumulate.corruption.value, Add, 1.

The mod keys accept numbers or formulas evaluated with Actor roll data. They can modify .min, .max, and .value. Only Add and Subtract apply to finite resources. An unlimited resource can receive a finite cap through Override or Downgrade on .max; additive maximum changes do nothing there. A .min or .max modifier alone does not create a resource. A valid .value modifier can show an effect-only resource with stored base zero and no maximum; its bonus still cannot be spent.

For a pool, save the effect's changes and open ⋮ → Resource source policies on the Active Effect sheet. Set its capacity, spend priority, recovery, and behavior when reactivated or removed:

  • Keep remaining balance, Restore starting amount, or Add starting amount again when the effect activates again;
  • Pause while inactive; discard when deleted, Keep available on actor, or Discard remaining points when the source becomes inactive;
  • Only the first activation or Every activation for an accumulate grant.

A pool can introduce a resource even when the Actor has no stored definition. Its balance remains distinct from the Actor's own points. An accumulate grant stores points permanently; it does not remove them when its effect ends.

Do not target a stored resource flag directly from an Active Effect. Use mod, pool, or accumulate for their respective behaviors, or use a sheet control, activity, or API call for a one-time change.

Use The Active Effect Helper

The module has its own Active Effect helper, opened by a GM with Build effect keys under Game Settings → SC - Resources. It builds keys for seven behaviors: Automation, Modifier, Grant, Pay with, Spell slots, Recovery, and Absorb damage.

  1. Select Build effect keys.
  2. Choose the behavior, the resource ID, and the needed values or automation steps.
  3. Copy each generated key, mode, and value.
  4. Add those rows to the Active Effect's Changes list and save.
  5. For a pool, open ⋮ → Resource source policies on the effect to set capacity, recovery, and reactivation behavior.
  6. Inspect the Actor's Breakdown or Sources panel to verify the effect's actual result.

The helper can generate an automation as a JSON change. Simple event automations can instead become shorter on or cast keys. It has no Actor context, so it checks whether a condition is readable, not whether that condition currently holds for a character.

SC - Active Effects Search is a separate, optional property picker. Its magnifying glass helps fill discovered keys in an effect editor; SC Resources' own helper is the tool for constructing resource-specific changes. If a resource key is absent from the search results, copy it from the Active Effect helper or enter it manually.

Macros, API, And Integrations

SCResources, game.modules.get("sc-resources").api, and ShatteredCodex.resources expose the same API. Resource operations accept an Actor or Actor UUID. A read returns null when a resource is missing; a write returns an { ok, ... } result for expected failures. This macro reads Mana from the selected token's Actor:

js
const actor = canvas.tokens.controlled[0]?.actor;
if (!actor) {
  ui.notifications.warn("Select a token first.");
} else {
  const mana = SCResources.get(actor, "mana");
  console.log(mana ?? "This actor has no Mana resource.");
}

Use SCResources.getBase(actor, "mana") for the spendable balance and SCResources.getValue(actor, "mana") for the effective reading. SCResources.sources.list(actor, "mana") shows its source pools. To change a balance, call create, set, add, subtract, spend, or restore. SCResources.recover(actor, "lr") applies long-rest recovery. Check each mutation's ok result before relying on it.

SCResources.bases manages base resources (list, saveFrom, apply, sync, remove), and SCResources.absorption.rules(actor) lists an Actor's damage absorption rules. SCResources.features lists the capabilities of the installed version so another module can check before calling them.

SCResources.openManager(actor) opens the Actor's Resource Manager. SCResources.events.emit(id, actor, data) fires a custom event; SCResources.automations.list(actor) and preview(actor, eventId, data) help inspect rules. SCResources.debug.explain(actor, "mana") prints a resolution breakdown.

For an exact source, use SCResources.spend(actor, "mana", 2, { sources: "stored" }). This uses only stored points; "pools", item:<itemUuid>, effect:<effectUuid>, and ledger IDs are other selectors. SCResources.transfer() moves an exact amount by default; drain() moves up to what is available. An operationId makes retries safe when a result is uncertain.

Integration hooks include sc-resources.changed, .created, .updated, .deleted, .transferred, .event, .thresholdCrossed, .registerEvents, .registerProviders, .apiReady, and .settingChanged. The change event reports spendable and effective before-and-after values. Other modules should use the public API instead of reading or writing raw resource flags.

SC - Resources also reads two other Shattered Codex modules when they are active. An effect that SC - Conditional Active Effects suppresses contributes nothing to a resource. With SC - Simple Sockets, formulas in resource effect changes can read @sc.sockets counts from the Item that grants the effect.

Troubleshooting

I cannot find the resource controls

Check the Actor sheet's ⋮ → Manage Resources entry. The Resources tab can be hidden by a world setting, the sheet's layout, or permissions. An Item has no SC Resources tab; configure the Active Effect that grants points to its owner.

An Active Effect does not change a resource

Check the exact ID and key, the change mode, whether its formula resolves, and whether the effect currently applies to the Actor. Open Breakdown, Sources, or From effects to see inactive reasons. A .min or additive .max change does not create a resource. Use the Active Effect helper for a new key and Resource source policies for a pool's behavior.

The displayed value is higher than I can spend

A mod.<id>.value contribution changes the effective reading, not the balance. Compare stored, Sources, base, and effective. Use pool.<id>.value for separate spendable points or accumulate.<id>.value to credit the Actor.

Recovery or an automation did not run

Check that the period or event actually occurred. For manual recovery, call SCResources.recover(actor, "lr") from a macro. Inspect the automation's trigger, condition state, test card, enabled state, and effect source. Custom events must be emitted or registered.

An activity cannot pay or change a resource

Confirm the Actor has the named resource or an active grant, check the Pay … from choice and source pool balance, and inspect any Block gains above the maximum setting. A targeted Actor the player does not own may need a connected GM and permission for targeted resource activities.

Damage is applied without an absorption card

The card appears only when the Actor has an absorption rule and enough of the resource to pay for it. Damage that also grants temporary hit points or changes the hit point maximum in the same application is dealt without a card.

A change timed out

Check the Actor's current balance before trying again. A timed-out operation may already have completed. An operationId can prevent a repeated value change from applying twice.

Changes are applied by one coordinator per Actor: the active GM, or the first connected owner when no GM is online. Requests reach the coordinator through Foundry's built-in module socket.

Something unclear or out of date on this page? Report it on GitHub or ask on Discord.