<?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%2Fweight</id>
	<title>Manual:DIL Manual/weight - 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%2Fweight"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/weight&amp;action=history"/>
	<updated>2026-11-23T21:23:43Z</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/weight&amp;diff=2894&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/weight&amp;diff=2894&amp;oldid=prev"/>
		<updated>2026-11-14T23:11: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;= weight =&lt;br /&gt;
'''Field''' (integer, read-only; units: all).&lt;br /&gt;
&lt;br /&gt;
 u.weight : integer&lt;br /&gt;
&lt;br /&gt;
The total weight of the unit in pounds: its own weight ([[Manual:DIL Manual/baseweight|baseweight]]) plus everything inside it. For a character that includes its inventory and equipment, for a container its contents.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Read-only: vmc refuses an assignment (&amp;quot;Illegal lvalue&amp;quot;). [[Manual:DIL Manual/set weight|set_weight()]] and [[Manual:DIL Manual/set weight base|set_weight_base()]] change it, and pass the difference on to every unit it is in.&lt;br /&gt;
* The server keeps it up to date as units move in and out. Changing the liquid in a drink container through [[Manual:DIL Manual/value|value]] does not: set the weight as well.&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 integer room_for(item : unitptr, bag : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   // what the bag holds now is bag.weight - bag.baseweight&lt;br /&gt;
   return ((item.weight + bag.weight - bag.baseweight) &amp;lt;= bag.capacity);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tells whether an item still fits into a bag, the test put makes in baseget.zon.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/baseweight|baseweight]]&lt;br /&gt;
* [[Manual:DIL Manual/capacity|capacity]]&lt;br /&gt;
* [[Manual:DIL Manual/set weight|set_weight()]]&lt;br /&gt;
* [[Manual:DIL Manual/can carry()|can_carry()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>