<?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%2Flevel</id>
	<title>Manual:DIL Manual/level - 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%2Flevel"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/level&amp;action=history"/>
	<updated>2026-11-23T22:15:28Z</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/level&amp;diff=2947&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/level&amp;diff=2947&amp;oldid=prev"/>
		<updated>2026-11-14T23:14:29Z</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;= level =&lt;br /&gt;
'''Field''' (integer, read/write; units: characters; also on a cmdptr).&lt;br /&gt;
&lt;br /&gt;
 ch.level : integer&lt;br /&gt;
 c.level : integer&lt;br /&gt;
&lt;br /&gt;
On a character: the level. A player's level stops at &amp;lt;code&amp;gt;MORTAL_MAX_LEVEL&amp;lt;/code&amp;gt; (50); after that only [[Manual:DIL Manual/vlevel|vlevel]] goes up. Gods are &amp;lt;code&amp;gt;IMMORTAL_LEVEL&amp;lt;/code&amp;gt; (200) and up, to &amp;lt;code&amp;gt;ULTIMATE_LEVEL&amp;lt;/code&amp;gt; (255); the constants are in vme.h. A zone file sets it with &amp;lt;code&amp;gt;level&amp;lt;/code&amp;gt; in an NPC.&lt;br /&gt;
&lt;br /&gt;
On a &amp;lt;code&amp;gt;cmdptr&amp;lt;/code&amp;gt;: the lowest level that may use the command, from &amp;lt;code&amp;gt;vme/etc/commands.def&amp;lt;/code&amp;gt;. The command interpreter compares it with the player's &amp;lt;code&amp;gt;level&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* On an object, a room or null it fails.&lt;br /&gt;
* On an NPC any program can assign it. On a player only a program in a zone with access level 0 (the fourth column of &amp;lt;code&amp;gt;vme/etc/zonelist&amp;lt;/code&amp;gt;) can; what counts is the zone of the program running on the unit, not that of a function it calls. Elsewhere vmc accepts the assignment, but at run time the program logs &amp;quot;DIL SERIOUS: ... Type error in lvalue assignemt&amp;quot; and stops. Reading works in every zone.&lt;br /&gt;
* Stored as an unsigned 8-bit number: values outside 0 to 255 wrap around. Assigning sets the number and nothing else.&lt;br /&gt;
* On a cmdptr it is read-only in practice: vmc accepts an assignment, but at run time it stops the program with the same type error.&lt;br /&gt;
* &amp;lt;code&amp;gt;(u != null) and (u.level &amp;gt; 5)&amp;lt;/code&amp;gt; still reads &amp;lt;code&amp;gt;u.level&amp;lt;/code&amp;gt; when &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt; is null (no short-circuit); the failed value is false in any comparison.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin integer may_use(pc : unitptr, cmdname : string);&lt;br /&gt;
var&lt;br /&gt;
   c : cmdptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   c := getcmd(cmdname);&lt;br /&gt;
   if (c == null)&lt;br /&gt;
      return (FALSE);&lt;br /&gt;
   return ((pc.level &amp;gt;= c.level) and (pc.position &amp;gt;= c.position));&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tells whether a character's level and position allow a command, the two checks the command interpreter makes.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/vlevel|vlevel]]&lt;br /&gt;
* [[Manual:DIL Manual/position|position]]&lt;br /&gt;
* [[Manual:DIL Manual/getcmd()|getcmd()]]&lt;br /&gt;
* [[Manual:DIL Manual/reset level()|reset_level()]]&lt;br /&gt;
* [[Manual:DIL Manual/cmdptr|cmdptr]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>