feat(scripting): Phase 2 — behaviour & breadth (onTick/think, onDeath, quests, timers) #195

Open
opened 2026-07-24 19:01:27 +02:00 by marco · 0 comments
Owner

Status update 2026-07-25 — Phase 2 è arrivata solo in parte con PR #203 (6ee56a0): onTick/think (cadence GameOptions.ScriptTickCadence) e onDeath sono spediti e testati. Resta da fare (il delta di questa issue):

  • schedule verb / timers, con reload che cancella i timer pendenti (unit-test).
  • Trigger onEnterTile.
  • Quests / onQuestStep.
  • I nuovi verbi/trigger decorati → rigenerazione api.d.lua (drift-check verde) + docs/scripting.md.

Scope originale sotto per riferimento.


Follow-up to #183 (Phase 1 shipped in #193). Grow the scripting layer from the onUse spine to real behaviour.

Scope

  • onTick/think cadence so a scripted creature's AI can run in Lua (mind the hot path — keep the tick cost bounded; the engine still drives movement).
  • More triggers: onDeath, onEnterTile, onQuestStep.
  • Timers / schedule verb, with reload cancels pending timers (the Phase-1 verification plan item that is N/A until timers exist).
  • Richer IScriptContext verbs as needed (each decorated → regenerated api.d.lua + docs).

Definition of Done (delta)

  • A scripted creature exhibits Lua-authored behaviour on a tick/think cadence without measurable tick regression (bounded per-invocation, instruction-budgeted).
  • onDeath fires and is unit-tested; a scheduled timer runs and is cancelled on /reloadscripts (unit-tested).
  • New verbs/triggers are decorated so api.d.lua regenerates (drift-check green) and docs/scripting.md covers them.
  • Base DoD + multi-platform hold.
> **Status update 2026-07-25** — Phase 2 è arrivata **solo in parte** con **PR #203** (`6ee56a0`): `onTick`/think (cadence `GameOptions.ScriptTickCadence`) e `onDeath` sono spediti e testati. **Resta da fare** (il delta di questa issue): > > - `schedule` verb / timers, con **reload che cancella i timer pendenti** (unit-test). > - Trigger `onEnterTile`. > - Quests / `onQuestStep`. > - I nuovi verbi/trigger decorati → rigenerazione `api.d.lua` (drift-check verde) + `docs/scripting.md`. > > Scope originale sotto per riferimento. --- Follow-up to #183 (Phase 1 shipped in #193). Grow the scripting layer from the `onUse` spine to real behaviour. ## Scope - `onTick`/`think` cadence so a scripted creature's AI can run in Lua (mind the hot path — keep the tick cost bounded; the engine still drives movement). - More triggers: `onDeath`, `onEnterTile`, `onQuestStep`. - Timers / `schedule` verb, with **reload cancels pending timers** (the Phase-1 verification plan item that is N/A until timers exist). - Richer `IScriptContext` verbs as needed (each decorated → regenerated `api.d.lua` + docs). ## Definition of Done (delta) - A scripted creature exhibits Lua-authored behaviour on a tick/think cadence without measurable tick regression (bounded per-invocation, instruction-budgeted). - `onDeath` fires and is unit-tested; a `schedule`d timer runs and is **cancelled on `/reloadscripts`** (unit-tested). - New verbs/triggers are decorated so `api.d.lua` regenerates (drift-check green) and `docs/scripting.md` covers them. - Base DoD + multi-platform hold.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo#195
No description provided.