====== Creation Law — Objects ======
You know classic Diku ''oedit''. Neo has **no** ''oedit'' and **no** ''@object'' verb. Object prototypes are built with the three-layer **item** workspace: description strings → stats blob → item prototype that links them.
Hub: [[immortal:creationlaw|Creation Law]]. Field/spawn reference once built: [[immortal:creationlaw:items|Items]]. Scripts: [[immortal:scriptlaw:objects|Script Law — Objects]].
===== Why three layers? =====
Neo mirrors the old Diku split (strings / values / index) as three workspace types:
* '''''item_descr''''' — what players read (keywords, short, long, room line)
* '''''item_stats''''' — what the engine uses (type, wear, flags, modifiers, values, weight)
* '''''item''''' — the prototype that **points at** a descr VID and a stats VID, plus ''maximum'', ''proc'', ''reset''
You save each layer separately. The prototype does not invent strings or numbers by itself — if you ''@save item'' without ''@item description'' / ''@item stats'' links, you have an empty shell. That is the #1 object-building mistake.
**Objects vs items (handbook split):** this page is the **build walkthrough**. [[immortal:creationlaw:items|Items]] is the type/flag/spawn/testing reference once the object exists. Same commands; different teaching focus.
===== Step-by-step: first object (a wieldable sword) =====
==== 1. Description draft ====
Why first: you want readable strings in-game even before combat numbers are perfect.
> @find item
> @new item_descr 3100
Okay.
> @item_descr keywords add sword
Okay.
> @item_descr proper
a tempered shortsword
> @item_descr room
A tempered shortsword lies here.
> @item_descr general
Steel catches the light along a plain fuller.
> @examine item_descr
> @save item_descr
Okay.
>
Fields: ''action'', ''general'', ''keywords'', ''proper'', ''room''. If ''@new item_descr'' errors, you still have a descr draft open — ''@examine item_descr'', then ''@save'' or ''@clear''.
==== 2. Stats draft ====
Why second: type and wear flags decide whether ''wield'' / ''get'' work when you spawn-test.
> @new item_stats 3100
Okay.
> @item_stats type weapon
Okay.
> @item_stats flags wear take
Okay.
> @item_stats flags wear wield
Okay.
> @item_stats weight 5
Okay.
> @item_stats modifiers add 0 hitroll 1
Okay.
> @examine item_stats
> @save item_stats
Okay.
>
Using the **same number** (3100) for descr and stats is a clarity convention, not a language requirement — they are still separate rows. Full type/flag/value lists: [[immortal:creationlaw:items|Items]].
==== 3. Prototype draft — link, cap, optional proc ====
Why this layer exists: the live world loads **item** prototypes; descr/stats are pieces the prototype references.
> @new item 3100
Okay.
> @item description 3100
Okay.
> @item stats 3100
Okay.
> @item maximum 25
Okay.
> @examine item
(confirm description and stats VIDs are set)
> @save item
Okay.
>
**Before ''@save'':** ''@examine item'' must show the description and stats links you intend. Saving without those links is the empty-shell mistake.
''@item'' fields: ''extras'', ''stats'', ''description'', ''maximum'', ''proc'', ''reset''.
==== 4. Approve and spawn-test ====
> approve item 3100
> create item 3100
You create a tempered shortsword.
> purge sword
>
Prefer ''create'' while learning your own range (stricter). ''load'' skips range checks — see [[immortal:creationlaw:items|Items]] for ''create'' vs ''load'' and ''maximum'' rules. If create refuses you, read the echo: wrong range vs ''maximum > 1'' are different failures.
===== Attaching a script (later) =====
Create the SpecProc **first** (''@proc item new …'' / script text), verify with ''index proc_item'', **then**:
> @load item 3100
Okay.
> @item proc my_sword_proc
Okay.
> @examine item
> @save item
Okay.
>
Attaching a name that does not exist yet leaves you confused at runtime — build proc → attach → save. Details: [[immortal:scriptlaw:objects|Script objects]]. Hard-coded compiled specials use ''SpecItem'' on ''@item_stats attrs'', not the free-form ''proc'' name.
===== Relinking an existing prototype =====
> @load item 3100
Okay.
> @item description 3100
> @item stats 3100
> @examine item
> @save item
Okay.
>
**Caveat:** ''@destroy item_descr'' fails while an item prototype still references that VID — unlink or destroy the prototype path carefully.
===== End-to-end (compact) =====
> @new item_descr 4502
… keywords / proper / room / general …
> @save item_descr
> @new item_stats 4502
> @item_stats type weapon
> @item_stats flags wear take
> @item_stats flags wear wield
> @item_stats weight 5
> @save item_stats
> @new item 4502
> @item description 4502
> @item stats 4502
> @item maximum 1
> @examine item
> @save item
> approve item 4502
> create item 4502
>
Next: equip via zone ([[immortal:creationlaw:mobiles|Mobiles]], [[immortal:creationlaw:zones|Zones]]).
===== Vs classic ''oedit'' =====
You never "enter oedit 3100". You open typed workspaces (''@new item_descr|item_stats|item''), edit with ''@item_*'' / ''@item'' subcommands, ''@examine'', ''@save''. No ''@object'' alias.
===== Common mistakes =====
* Second ''@new'' while a descr/stats/item draft is still open
* ''@save item'' without ''description'' / ''stats'' links
* Forgetting ''take'' / ''wield'' wear flags, then wondering why get/wield fails
* ''create'' vs ''load'' surprise (ranges / ''maximum'')
* ''@item proc'' before the SpecProc row exists
===== Related =====
* [[immortal:creationlaw:items|Items]] — types, flags, spawn, caps
* [[immortal:creationlaw:mobiles|Mobiles]] — weapon + mob workflow
* [[immortal:scriptlaw:objects|Script Law — Objects]] — ''@item proc'' / ''@proc item''
* [[immortal:creationlaw|Creation Law]] — hub