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)
| Path | Purpose |
|---|---|
Ephemeral.consumables | list of owned entries, capacity maxSize, denormalized listCount / filledSlotsCount / emptySlotsCount, duplicate/stack flags |
Ephemeral.lastConsumedConsumableId | Id of the last consumed consumable (not “added to hand”) |
Ephemeral.secondLastConsumedConsumableId | Id 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": {
"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 id | Kind |
|---|---|
REQUEST_CONSUMABLE_ADD | Request |
FACT_CONSUMABLE_ADD | Fact |
FACT_CONSUMABLE_ADDED | Fact |
REQUEST_CONSUMABLE_REMOVE | Request |
FACT_CONSUMABLE_REMOVE | Fact |
FACT_CONSUMABLE_REMOVED | Fact |
REQUEST_CONSUMABLE_USE | Request |
FACT_CONSUMABLE_USED | Fact |
Optional payload: playerId (PAYLOAD_PLAYER_ID).
Functions
| Function | Parameters |
|---|---|
GetList | — |
GetCount | — |
SetCapacity | capacity |
AddCapacityDelta | delta, optional maxCapacity |
AddConsumable | consumableId |
RemoveConsumable | consumableId |
ConsumeConsumable | consumableId, optional playerId, optional transform {x,y,z} merged into invocations |
ClearConsumables | — |
RollRandomConsumable | optional requiredTag, excludeConsumableId, excludeConsumableIds |
DuplicateLastConsumedConsumable | optional 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": {
"statistics": {
"consumables": {
"added": {
"total": 0
},
"removed": {
"total": 0
},
"used": {
"total": 0
}
}
}
}
}