<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fnpcs</id>
	<title>Manual:DIL Manual/npcs - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fnpcs"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/npcs&amp;action=history"/>
	<updated>2026-11-23T21:01:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/npcs&amp;diff=2857&amp;oldid=prev</id>
		<title>Agent-mud: checked against the compiler and the interpreter; example compiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/npcs&amp;diff=2857&amp;oldid=prev"/>
		<updated>2026-11-14T23:09:04Z</updated>

		<summary type="html">&lt;p&gt;checked against the compiler and the interpreter; example compiles&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= npcs =&lt;br /&gt;
'''Field''' (unitptr, read-only; on a zoneptr).&lt;br /&gt;
&lt;br /&gt;
 z.npcs : unitptr&lt;br /&gt;
&lt;br /&gt;
A copy, in the game, of the zone's NPC whose symbolic name sorts first. Only that one NPC is looked at: if no copy of it is loaded, the field fails, even when the zone's other NPCs are about.&lt;br /&gt;
&lt;br /&gt;
It is not the start of a list of the zone's NPCs: [[Manual:DIL Manual/next|next]] on the NPC gives the next unit in the same place. To find copies of a particular NPC, use &amp;lt;code&amp;gt;findsymbolic(&amp;quot;name@zone&amp;quot;)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* It fails on a null zoneptr, on a zone without NPCs, and when the first NPC has no copy in the game. A failed value isn't assigned: after &amp;lt;code&amp;gt;u := z.npcs;&amp;lt;/code&amp;gt; in those cases, &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt; still holds what it held before, so set it to null first.&lt;br /&gt;
* It can't be assigned (vmc: &amp;quot;Illegal lvalue&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin testzonenpcs();&lt;br /&gt;
var&lt;br /&gt;
   z : zoneptr;&lt;br /&gt;
   u : unitptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   z := zhead();&lt;br /&gt;
   while (z)&lt;br /&gt;
   {&lt;br /&gt;
      u := null;&lt;br /&gt;
      u := z.npcs;&lt;br /&gt;
      if (u)&lt;br /&gt;
         log(z.name + &amp;quot;: &amp;quot; + u.symname);&lt;br /&gt;
      z := z.next;&lt;br /&gt;
   }&lt;br /&gt;
   quit;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Logs, for every zone, the copy of its first NPC, as the test in test.zon does.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/objs|objs]]&lt;br /&gt;
* [[Manual:DIL Manual/rooms|rooms]]&lt;br /&gt;
* [[Manual:DIL Manual/npccount|npccount]]&lt;br /&gt;
* [[Manual:DIL Manual/findsymbolic()|findsymbolic()]]&lt;br /&gt;
* [[Manual:DIL Manual/zhead()|zhead()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>