feat(scripting): Phase 3 — items as content (non-weapon data-definitions + onUse) #196

Closed
opened 2026-07-24 19:01:28 +02:00 by marco · 1 comment
Owner

Follow-up to #183. Phase 1 migrated weapons (sword/bow) as data-defs; generalise to non-weapon items.

Scope

  • Item definitions as loadable data beyond weapons: potions/scrolls/keys/food — name/graphic/weight/stack/slot + onUse behaviour in Lua (split data-definition vs behaviour).
  • A generic item{ ... } registration (alongside weapon{ ... }) feeding ItemCatalog as IUsable/IEquippable data-backed kinds.
  • Migrate one concrete usable (e.g. a potion) to Lua as the proof.

Definition of Done (delta)

  • A committed Lua item{ ... } with an onUse handler is givable, renders with its art, and its onUse runs server-validated (unit + harness screenshot).
  • The engine still reads item data cheaply (carry weight, equip stats) — no per-type C# branch.
  • api.d.lua regenerates for the new registration; docs/scripting.md updated. Base DoD + multi-platform hold.
Follow-up to #183. Phase 1 migrated weapons (sword/bow) as data-defs; generalise to non-weapon items. ## Scope - Item definitions as loadable data beyond weapons: potions/scrolls/keys/food — name/graphic/weight/stack/slot + `onUse` behaviour in Lua (split data-definition vs behaviour). - A generic `item{ ... }` registration (alongside `weapon{ ... }`) feeding `ItemCatalog` as `IUsable`/`IEquippable` data-backed kinds. - Migrate one concrete usable (e.g. a potion) to Lua as the proof. ## Definition of Done (delta) - A committed Lua `item{ ... }` with an `onUse` handler is givable, renders with its art, and its `onUse` runs server-validated (unit + harness screenshot). - The engine still reads item data cheaply (carry weight, equip stats) — no per-type C# branch. - `api.d.lua` regenerates for the new registration; `docs/scripting.md` updated. Base DoD + multi-platform hold.
Author
Owner

Risolta da PR #203 (6ee56a0): scripting Phase 3 consegnata — registrazione item{ … } non-arma con onUse, e una potion Lua (Items.Consumables.Potion, content/scripts/items/consumables/potion.lua) che cura all'uso, integrata nella pipeline d'uso esistente. Chiudo — completata.

Risolta da **PR #203** (`6ee56a0`): scripting Phase 3 consegnata — registrazione `item{ … }` non-arma con `onUse`, e una potion Lua (`Items.Consumables.Potion`, `content/scripts/items/consumables/potion.lua`) che cura all'uso, integrata nella pipeline d'uso esistente. Chiudo — completata.
marco closed this issue 2026-07-25 19:06:16 +02:00
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#196
No description provided.