====== Creation Law — Mobiles ======
You know classic Diku ''medit''. Neo has **no** ''medit''. Mobiles use the same three-layer idea as objects: ''npc_descr'' (strings) → ''npc_stats'' (numbers/flags) → ''npc'' (prototype that links them, plus maximum/proc).
Hub: [[immortal:creationlaw|Creation Law]]. Object to wield: [[immortal:creationlaw:objects|Objects]]. Placement: [[immortal:creationlaw:zones|Zones]]. Scripts: [[immortal:scriptlaw:mobiles|Script Law — Mobiles]].
===== Why three layers again? =====
Same reason as objects: keep readable strings separate from combat/AI stats, then point a prototype at both. Saving ''@npc'' without ''description'' / ''stats'' links yields an empty mobile — ''@examine npc'' before every ''@save''.
One open draft per workspace kind. ''@new npc'' while an npc draft exists errors until ''@save npc'' or ''@clear npc''.
===== Step-by-step: first mobile =====
==== 1. Description ====
''@npc_descr'' fields: ''general'', ''keywords'', ''proper'', ''room''.
> @find npc
> @new npc_descr 1210
Okay.
> @npc_descr keywords add watchman
Okay.
> @npc_descr proper
a quiet watchman
> @npc_descr room
A quiet watchman stands here.
> @npc_descr general
Weathered cloak, calm eyes, little to say.
> @examine npc_descr
> @save npc_descr
Okay.
>
==== 2. Stats ====
Why before the prototype: level, position, acts flags, and attacks decide whether the mob stands still, fights, or wanders when you reset the zone.
''@npc_stats'' fields: ''ac'', ''alignment'', ''attacks'', ''attrs'', ''flags'', ''hitpoints''.
* ''attrs'' classes — ''NPCType'', ''Level'', ''Gender'', ''Size'', ''Movement'', ''Position'', ''SpecNPC''
* ''flags'' classes — ''Acts'', ''Affects'', ''Profession'' (''Acts'' includes SENTINEL, AGGRESSIVE, STAY_ZONE, SHOPKEEPER, BANKER, …)
* ''attacks add '' — ''AttackType'' plus MDM dice string
* ''hitpoints'' — dice / MDM form accepted by the stats parser
* ''ac'', ''alignment'' — integer ranges enforced in code
> @new npc_stats 1210
Okay.
> @npc_stats attrs level L5
Okay.
> @npc_stats attrs position standing
Okay.
> @npc_stats flags acts sentinel
Okay.
> @npc_stats ac 5
Okay.
> @npc_stats alignment 0
Okay.
> @npc_stats hitpoints 2d8+10
Okay.
> @npc_stats attacks add 0 hit 1d6+1
Okay.
> @examine npc_stats
> @save npc_stats
Okay.
>
**Common miss:** forgetting ''position standing'' (or similar) and wondering why the mobile looks wrong in-room; forgetting ''sentinel'' / ''stay_zone'' when you did not want a wanderer.
==== 3. Prototype — link and cap ====
''@npc'' fields: ''extras'', ''stats'', ''description'', ''maximum'', ''proc'', ''reset''.
> @new npc 1210
Okay.
> @npc description 1210
Okay.
> @npc stats 1210
Okay.
> @npc maximum 4
Okay.
> @examine npc
(confirm description + stats VIDs)
> @save npc
Okay.
>
==== 4. Spawn-test in your room ====
> create npc 1210
You create a quiet watchman.
> purge watchman
>
''create'' vs ''load'' follows the same stricter-vs-looser rules as items (your npc range; ''maximum'' interactions) — see [[immortal:creationlaw:items|Items]] for the detailed comparison; it applies to ''npc'' the same way. Prefer ''create'' on your own VIDs while learning.
===== Place the mobile via a zone (required for live world) =====
Why: ''create npc'' only puts one copy next to you for testing. Players meet mobiles that **zone resets** load. Open the zone draft, add an ''npc'' reset line, save, then **''zone reset''**.
> @load zone 1299
Okay.
> @zone npc 1210 1200
Okay.
> @zone list
> @examine zone
> @save zone
Okay.
> zone reset
Okay.
>
Forgetting ''zone reset'' after ''@save zone'' is the usual "my mob never appears" bug. Full reset command vocabulary: [[immortal:creationlaw:zones|Zones]].
===== Weapon + mobile workflow =====
Build the object first ([[immortal:creationlaw:objects|Objects]]), then the mobile, then zone ''equip'' / ''give'':
> @new item_descr 4502
… edit strings …
> @save item_descr
> @new item_stats 4502
> @item_stats type weapon
> @item_stats flags wear take
> @item_stats flags wear wield
> @save item_stats
> @new item 4502
> @item description 4502
> @item stats 4502
> @examine item
> @save item
> @new npc_descr 4503
…
> @save npc_descr
> @new npc_stats 4503
…
> @save npc_stats
> @new npc 4503
> @npc description 4503
> @npc stats 4503
> @examine npc
> @save npc
> @load zone 4599
> @zone npc 4503 4500
Okay.
> @zone equip 4502 wield
Okay.
> @examine zone
> @save zone
Okay.
> zone reset
Okay.
> create npc 4503
>
''@zone equip'' / ''give'' / ''put'' / ''follow'' run in reset-list order — put the ''npc'' line before equipment lines that assume that mobile exists. If the mob loads bare-handed, ''@zone list'' and confirm equip came after npc.
===== Attaching a mobile script =====
Create ''@proc npc'' **first**, ''index proc_npc'' to verify, then:
> @load npc 1210
Okay.
> @npc proc quiet_stretch
Okay.
> @examine npc
> @save npc
Okay.
> create npc 1210
>
Do not attach a name you have not created — [[immortal:scriptlaw:mobiles|Script mobiles]]. Compiled specials use ''SpecNPC'' on ''@npc_stats attrs'', not the free-form proc name.
===== Mobile caveats =====
* No ''medit'' — ''@npc_descr'' / ''@npc_stats'' / ''@npc'' only.
* One draft per kind; save or clear before another ''@new''.
* Description VIDs cannot be destroyed while still referenced by an npc prototype.
* ''create'' is stricter than ''load'' — read the echoes.
* Live placement needs zone reset lines **and** ''zone reset''.
* ''maximum'' caps instance counts; raise/lower on ''@npc'', then ''@save npc''.
===== Related =====
* [[immortal:creationlaw:objects|Objects]] / [[immortal:creationlaw:items|Items]] — gear to equip
* [[immortal:creationlaw:zones|Zones]] — npc/equip/give resets
* [[immortal:scriptlaw:mobiles|Script Law — Mobiles]] — Beanshell SpecProcs
* [[immortal:creationlaw|Creation Law]] — hub