OnPlayerConsumableDurablySettled

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 14:06, 8 September 2026 by QCherry (talk | contribs) (Document stable consumable lifecycle callbacks for 0.1.3)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

onPlayerConsumableDurablySettled

AVAILABLE FROM UPDATE 0.1.3
This event is available in G1R:MP 0.1.3 and later. The contract below includes the compatibility guarantees introduced in that update.

Triggered for a connected player after the consumable inventory removal and final authoritative progression snapshot are both durably committed.

Availability

This event is available in server-side scripts.

Callback signature

onPlayerConsumableDurablySettled(playerId, itemKey, inventoryItemId, sequence, generation, commitKey, quantityRemaining, health, maxHealth, mana, maxMana, appliedHealth, appliedMana, periodicTicks)

Parameters

Name Type Description
playerId int The player who used the consumable.
itemKey string The stable native inventory key of the consumable.
inventoryItemId int The native numeric consumable ID.
sequence int The positive client request sequence.
generation int The settlement generation that became durable.
commitKey string The opaque durable-operation key.
quantityRemaining int The final authoritative quantity remaining.
health number Authoritative health after the instant effect.
maxHealth number Authoritative maximum health.
mana number Authoritative mana after the instant effect.
maxMana number Authoritative maximum mana.
appliedHealth number The instant health change actually applied after clamping.
appliedMana number The instant mana change actually applied after clamping.
periodicTicks int The number of periodic ticks scheduled after settlement, or zero.

Examples

Handle the event:

addEventHandler("onPlayerConsumableDurablySettled", root, function(playerId, itemKey, inventoryItemId, sequence, generation, commitKey, quantityRemaining, health, maxHealth, mana, maxMana, appliedHealth, appliedMana, periodicTicks)
    outputDebugString(itemKey .. " settled; remaining=" .. quantityRemaining .. ", hp=" .. health .. "/" .. maxHealth)
end)

Notes

  • This read-only completion callback is part of the stable server-side Lua contract beginning with update 0.1.3.
  • Inventory and instant progression changes are already authoritative and durable. Do not remove the item or apply the effect again.
  • A late durable settlement can still be observed after the client has already received a persistence-timeout result; this event proves storage completion, not client receipt of an Accepted packet.
  • Periodic restoration begins after this callback. Observe each non-zero applied tick with onPlayerConsumableEffectTick.
  • Strength, dexterity, alcohol and swampweed are not repeated in this compact callback; query getPlayerProgression when those values are needed.