You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Runtime Scripts: add the first curated gameplay host API #319
Category: enhancement Summary: Expose the first small set of gameplay operations to Runtime Scripts.
Current behavior:
The Runtime Script host can execute Lua but has no gameplay contract.
Desired behavior:
Provide event payload access, read-only actor and target fields, healing, and chat output. Runtime Scripts never receive table handles, reducer context, SQL, or unrestricted entity mutation. Healing and chat use the same core gameplay operations and Gates as compiled behavior. All state-changing calls produce staged effects that commit only when the invocation succeeds.
Key interfaces:
Event payload value
Actor and target read views
heal host operation
send_chat host operation
Acceptance criteria:
Scripts can inspect documented event, actor, and target fields.
Missing actors or targets produce a defined script result, not a host panic.
Heal and chat go through core operations and commit only after script success.
A later script failure cannot undo effects committed by an earlier successful script.
No raw table or arbitrary reducer access is reachable.
Host-call tests cover invalid identifiers, refused operations, and fuel failure after staging.
Out of scope:
Damage, items, experience, reputation, spawning, or scheduling
Handoff from the #317 implementation (PR #324): the fresh per-invocation env chains to Lua::core() globals via __index fallthrough, so scripts can still mutate shared stdlib tables — replacing the fallthrough with an allowlist belongs to this issue. math.random shares one deliberately fixed stream across invocations (deterministic replays), so no durable outcome may depend on it. Lua integers are signed 64-bit, so a guid above i64::MAX cannot round-trip yet; settle the guid representation here.
Activity
Mathih13 commentedon Aug 24, 2026
Handoff from the #317 implementation (PR #324): the fresh per-invocation env chains to
Lua::core()globals via__indexfallthrough, so scripts can still mutate shared stdlib tables — replacing the fallthrough with an allowlist belongs to this issue.math.randomshares one deliberately fixed stream across invocations (deterministic replays), so no durable outcome may depend on it. Lua integers are signed 64-bit, so a guid abovei64::MAXcannot round-trip yet; settle the guid representation here.