Skip to Content

Consumable

Consumables you hold for the run, defined under configuration.consumables. ConsumeConsumable spends one use and runs that definition’s invocations (effects, audio, stats, etc.). Capacity and duplicate rules come from the stored maxSize / flags on Ephemeral.consumables.

State (Ephemeral)

PathPurpose
Ephemeral.consumableslist of owned entries, capacity maxSize, denormalized listCount / filledSlotsCount / emptySlotsCount, duplicate/stack flags
Ephemeral.lastConsumedConsumableIdId of the last consumed consumable (not “added to hand”)
Ephemeral.secondLastConsumedConsumableIdId consumed immediately before that

Each list element is an object with id (consumable id) plus fields from configuration.consumables[id] where applicable.

How it looks in ephemeral.json

ephemeral.json
{ "Ephemeral": { "lastConsumedConsumableId": "", "secondLastConsumedConsumableId": "", "consumables": { "list": [], "listCount": 0, "filledSlotsCount": 0, "emptySlotsCount": 1, "maxSize": 1, "allowDuplicates": false, "stackable": false, "maxStackSize": 1 } } }

Example one entry: "list": [ { "id": "yourConsumableId" } ].

Events

String ids are in GnosisConsumableEvents (Runtime/GnosisEngine/Source/Services/Ephemeral/Services/ConsumableService/).

Event idKind
REQUEST_CONSUMABLE_ADDRequest
FACT_CONSUMABLE_ADDFact
FACT_CONSUMABLE_ADDEDFact
REQUEST_CONSUMABLE_REMOVERequest
FACT_CONSUMABLE_REMOVEFact
FACT_CONSUMABLE_REMOVEDFact
REQUEST_CONSUMABLE_USERequest
FACT_CONSUMABLE_USEDFact

Optional payload: playerId (PAYLOAD_PLAYER_ID).

Functions

FunctionParameters
GetList
GetCount
SetCapacitycapacity
AddCapacityDeltadelta, optional maxCapacity
AddConsumableconsumableId
RemoveConsumableconsumableId
ConsumeConsumableconsumableId, optional playerId, optional transform {x,y,z} merged into invocations
ClearConsumables
RollRandomConsumableoptional requiredTag, excludeConsumableId, excludeConsumableIds
DuplicateLastConsumedConsumableoptional excludeConsumableId (default behavior around "morph")

Statistics

Consumable increments Statistic.IncrementCounter on the ephemeral branch for consumables.added.total, consumables.removed.total, and consumables.used.total. When a definition has tags, it also bumps consumables.added.tag.<tag>, consumables.removed.tag.<tag>, and consumables.used.tag.<tag> for each tag.

You can read totals with a dot path, e.g. ephemeral.statistics.consumables.used.total.

ephemeral.json
{ "Ephemeral": { "statistics": { "consumables": { "added": { "total": 0 }, "removed": { "total": 0 }, "used": { "total": 0 } } } } }
Last updated on