<?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%2Fvals</id>
	<title>Manual:DIL Manual/vals - 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%2Fvals"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/vals&amp;action=history"/>
	<updated>2026-11-22T18:08:44Z</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/vals&amp;diff=2874&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/vals&amp;diff=2874&amp;oldid=prev"/>
		<updated>2026-11-14T23:10:31Z</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;= vals =&lt;br /&gt;
'''Field''' (intlist, read/write; on extraptr).&lt;br /&gt;
&lt;br /&gt;
 e.vals : intlist&lt;br /&gt;
&lt;br /&gt;
The list of integers kept with an extra description. Players never see it; DIL uses it to store numbers on a unit, such as a death counter or a high-score table (competition.zon). In a zone file it is the second list in &amp;lt;code&amp;gt;extra {&amp;quot;names&amp;quot;} {1, 2, 3} &amp;quot;text&amp;quot;&amp;lt;/code&amp;gt;; in DIL the four-argument [[Manual:DIL Manual/addextra()|addextra()]] sets it.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Assigning an intlist replaces the list with a copy of it; assigning null empties it.&lt;br /&gt;
* &amp;lt;code&amp;gt;e.vals.[i]&amp;lt;/code&amp;gt; reads and assigns one element. An index outside the list fails, and an assignment to it does nothing: grow the list with [[Manual:DIL Manual/insert()|insert()]] first, and shrink it with [[Manual:DIL Manual/remove()|remove()]].&lt;br /&gt;
* On a null extra it fails, and an assignment does nothing.&lt;br /&gt;
* Units have no &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (vmc: &amp;quot;Illegal type for field&amp;quot;); look up an extra first: &amp;lt;code&amp;gt;u.extra.[&amp;quot;$name&amp;quot;].vals&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin count_death();&lt;br /&gt;
var&lt;br /&gt;
   exd : extraptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   exd := &amp;quot;$TOTAL_DEATHS&amp;quot; in self.extra;&lt;br /&gt;
   if (exd)&lt;br /&gt;
      exd.vals.[0] := exd.vals.[0] + 1;&lt;br /&gt;
   else&lt;br /&gt;
      addextra(self.extra, {&amp;quot;$TOTAL_DEATHS&amp;quot;}, itoa(realtime), {1});&lt;br /&gt;
   quit;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Counts a player's deaths in a hidden extra, as death.zon does.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/descr|descr]]&lt;br /&gt;
* [[Manual:DIL Manual/extra|extra]]&lt;br /&gt;
* [[Manual:DIL Manual/addextra()|addextra()]]&lt;br /&gt;
* [[Manual:DIL Manual/insert()|insert()]]&lt;br /&gt;
* [[Manual:DIL Manual/intlist|intlist]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>