<?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%2Ftype</id>
	<title>Manual:DIL Manual/type - 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%2Ftype"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/type&amp;action=history"/>
	<updated>2026-11-23T19:29:47Z</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/type&amp;diff=2816&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/type&amp;diff=2816&amp;oldid=prev"/>
		<updated>2026-11-14T23:00:15Z</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;= type =&lt;br /&gt;
'''Field''' (integer, read-only; units: all; also on a cmdptr).&lt;br /&gt;
&lt;br /&gt;
 u.type : integer&lt;br /&gt;
 c.type : integer&lt;br /&gt;
&lt;br /&gt;
On a unit: what kind of unit it is, one of the constants in vme.h:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Constant !! Value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;UNIT_ST_NPC&amp;lt;/code&amp;gt; || 1&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;UNIT_ST_PC&amp;lt;/code&amp;gt; || 2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;UNIT_ST_ROOM&amp;lt;/code&amp;gt; || 4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;UNIT_ST_OBJ&amp;lt;/code&amp;gt; || 8&lt;br /&gt;
|}&lt;br /&gt;
On a &amp;lt;code&amp;gt;cmdptr&amp;lt;/code&amp;gt;: the command's &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;vme/etc/commands.def&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;TYPE_SOCIAL&amp;lt;/code&amp;gt; (1) or &amp;lt;code&amp;gt;TYPE_SKILL&amp;lt;/code&amp;gt; (2) from values.h, or 0 for an ordinary command.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* On null it fails, and a failed value is false in every comparison: &amp;lt;code&amp;gt;u.type != UNIT_ST_PC&amp;lt;/code&amp;gt; is false too when &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt; is null. Test &amp;lt;code&amp;gt;u == null&amp;lt;/code&amp;gt; first.&lt;br /&gt;
* It can't be assigned (vmc: &amp;quot;Illegal lvalue&amp;quot;). Not on a zoneptr or extraptr (vmc: &amp;quot;Illegal type for field&amp;quot;).&lt;br /&gt;
* For an object's kind (weapon, armour, container...) use [[Manual:DIL Manual/objecttype|objecttype]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin list_commands();&lt;br /&gt;
var&lt;br /&gt;
   c : cmdptr;&lt;br /&gt;
   sl : stringlist;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   c := chead();&lt;br /&gt;
   while (c)&lt;br /&gt;
   {&lt;br /&gt;
      if ((c.level &amp;lt;= self.level) and (c.type != TYPE_SOCIAL) and (c.type != TYPE_SKILL))&lt;br /&gt;
         addstring(sl, c.name);&lt;br /&gt;
      c := c.next;&lt;br /&gt;
   }&lt;br /&gt;
   pagestring(itoa(length(sl)) + &amp;quot; commands.&amp;lt;br/&amp;gt;&amp;quot;, self);&lt;br /&gt;
   quit;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Counts the commands a character may use that are neither socials nor skills, as &amp;lt;code&amp;gt;commands&amp;lt;/code&amp;gt; does in commands.zon.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/objecttype|objecttype]]&lt;br /&gt;
* [[Manual:DIL Manual/isplayer()|isplayer()]]&lt;br /&gt;
* [[Manual:DIL Manual/cmdptr|cmdptr]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>