<?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%2Fextra</id>
	<title>Manual:DIL Manual/extra - 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%2Fextra"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/extra&amp;action=history"/>
	<updated>2026-11-22T21:55:33Z</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/extra&amp;diff=2876&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/extra&amp;diff=2876&amp;oldid=prev"/>
		<updated>2026-11-14T23:10:37Z</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;= extra =&lt;br /&gt;
'''Field''' (extraptr, read-only; units: all).&lt;br /&gt;
&lt;br /&gt;
 u.extra : extraptr&lt;br /&gt;
&lt;br /&gt;
The first of the unit's extra descriptions, or null when it has none. Each one has [[Manual:DIL Manual/names|names]], a text ([[Manual:DIL Manual/descr|descr]]) and a list of numbers ([[Manual:DIL Manual/vals|vals]]); [[Manual:DIL Manual/next|next]] gives the one after it.&lt;br /&gt;
&lt;br /&gt;
Players see the extras on &amp;lt;code&amp;gt;look at&amp;lt;/code&amp;gt;. Extras whose name starts with &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt; are hidden, and DIL uses them to keep data on a unit: quest flags, counters, names.&lt;br /&gt;
&lt;br /&gt;
== Finding an extra ==&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;$name&amp;quot; in u.extra&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;u.extra.[&amp;quot;$name&amp;quot;]&amp;lt;/code&amp;gt; both give the first extra with that name (case is ignored; any of its names counts), or null.&lt;br /&gt;
* An extra without names is found with &amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* It can't be assigned (vmc: &amp;quot;Illegal lvalue&amp;quot;). Add extras with [[Manual:DIL Manual/addextra()|addextra()]] and remove them with [[Manual:DIL Manual/subextra()|subextra()]]; change one through its fields.&lt;br /&gt;
* &amp;lt;code&amp;gt;addextra(u.extra, {&amp;quot;$x&amp;quot;}, &amp;quot;&amp;quot;)&amp;lt;/code&amp;gt; adds nothing: an extra made in DIL needs some text.&lt;br /&gt;
* Every extraptr variable is null again after a &amp;lt;code&amp;gt;wait&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;pause&amp;lt;/code&amp;gt;, and extras can't be secured: look the extra up again after waiting.&lt;br /&gt;
* A player's administrative extras are in [[Manual:DIL Manual/info|info]], not here.&lt;br /&gt;
* On null it fails.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin list_extras(u : unitptr);&lt;br /&gt;
var&lt;br /&gt;
   exd : extraptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   exd := u.extra;&lt;br /&gt;
   while (exd)&lt;br /&gt;
   {&lt;br /&gt;
      sendtext(exd.name + &amp;quot;: &amp;quot; + exd.descr + &amp;quot;&amp;lt;br/&amp;gt;&amp;quot;, self);&lt;br /&gt;
      exd := exd.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;
Lists the name and text of every extra description on a unit.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/addextra()|addextra()]]&lt;br /&gt;
* [[Manual:DIL Manual/subextra()|subextra()]]&lt;br /&gt;
* [[Manual:DIL Manual/descr|descr]]&lt;br /&gt;
* [[Manual:DIL Manual/vals|vals]]&lt;br /&gt;
* [[Manual:DIL Manual/extraptr|extraptr]]&lt;br /&gt;
* [[Manual:DIL Manual/in|in]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>