Show pageOld revisionsBacklinksBack to top You've loaded an old revision of the document! If you save it, you will create a new version with this data. Media Files ====== 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: [[creationlaw|Creation Law]]. Object to wield: [[creationobjects|Objects]]. Placement: [[creationzones|Zones]]. Scripts: [[scriptmobiles|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''. <code mud> > @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. > </code> ==== 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 <index> <type> <dice>'' — ''AttackType'' plus MDM dice string * ''hitpoints'' — dice / MDM form accepted by the stats parser * ''ac'', ''alignment'' — integer ranges enforced in code <code mud> > @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. > </code> **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''. <code mud> > @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. > </code> ==== 4. Spawn-test in your room ==== <code mud> > create npc 1210 You create a quiet watchman. > purge watchman > </code> ''create'' vs ''load'' follows the same stricter-vs-looser rules as items (your npc range; ''maximum'' interactions) — see [[creationitems|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''**. <code mud> > @load zone 1299 Okay. > @zone npc 1210 1200 Okay. > @zone list > @examine zone > @save zone Okay. > zone reset Okay. > </code> Forgetting ''zone reset'' after ''@save zone'' is the usual "my mob never appears" bug. Full reset command vocabulary: [[creationzones|Zones]]. ===== Weapon + mobile workflow ===== Build the object first ([[creationobjects|Objects]]), then the mobile, then zone ''equip'' / ''give'': <code mud> > @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 > </code> ''@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: <code mud> > @load npc 1210 Okay. > @npc proc quiet_stretch Okay. > @examine npc > @save npc Okay. > create npc 1210 > </code> Do not attach a name you have not created — [[scriptmobiles|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 ===== * [[creationobjects|Objects]] / [[creationitems|Items]] — gear to equip * [[creationzones|Zones]] — npc/equip/give resets * [[scriptmobiles|Script Law — Mobiles]] — Beanshell SpecProcs * [[creationlaw|Creation Law]] — hub SavePreviewCancel Edit summary Note: By editing this page you agree to license your content under the following license: CC Attribution-Share Alike 4.0 International creationmobiles.1790178406.txt.gz Last modified: 2026/09/23 15:46(external edit)