<?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%2Fexp</id>
	<title>Manual:DIL Manual/exp - 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%2Fexp"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/exp&amp;action=history"/>
	<updated>2026-11-22T17:48:58Z</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/exp&amp;diff=2945&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/exp&amp;diff=2945&amp;oldid=prev"/>
		<updated>2026-11-14T23:14:23Z</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;= exp =&lt;br /&gt;
'''Field''' (integer, read/write; units: characters).&lt;br /&gt;
&lt;br /&gt;
 ch.exp : integer&lt;br /&gt;
&lt;br /&gt;
On a player: the experience points gained in total. On an NPC: the experience it is worth, set with &amp;lt;code&amp;gt;exp&amp;lt;/code&amp;gt; in the zone file; when it is killed, its killers share this amount, adjusted for their levels and group size (fight.cpp).&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* On an object, a room or null it fails.&lt;br /&gt;
* 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 assign it; 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. This holds for NPCs as well as players.&lt;br /&gt;
* To give or take experience in the normal way, use [[Manual:DIL Manual/experience()|experience()]] from any zone: it logs the gain, tells the player when a new level can be raised, never takes them below the experience of level 1, and leaves gods and NPCs alone. Assigning the field sets the number and nothing else.&lt;br /&gt;
* Stored as a signed 32-bit number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin show_exp(pc : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (pc.type != UNIT_ST_PC)&lt;br /&gt;
      return;&lt;br /&gt;
   sendtext(&amp;quot;You have &amp;quot; + itoa(pc.exp) + &amp;quot; experience points and you need &amp;quot; +&lt;br /&gt;
            itoa(pc.exptol) + &amp;quot; to the next level.&amp;lt;br/&amp;gt;&amp;quot;, pc);&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Shows a player's experience, as &amp;lt;code&amp;gt;score&amp;lt;/code&amp;gt; does in commands.zon.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/exptol|exptol]]&lt;br /&gt;
* [[Manual:DIL Manual/experience()|experience()]]&lt;br /&gt;
* [[Manual:DIL Manual/vlevel|vlevel]]&lt;br /&gt;
* [[Manual:DIL Manual/getinteger()|getinteger()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>