<?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%2Flight</id>
	<title>Manual:DIL Manual/light - 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%2Flight"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/light&amp;action=history"/>
	<updated>2026-11-22T17:49:03Z</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/light&amp;diff=2881&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/light&amp;diff=2881&amp;oldid=prev"/>
		<updated>2026-11-14T23:10:52Z</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;= light =&lt;br /&gt;
'''Field''' (integer, read-only; units: all).&lt;br /&gt;
&lt;br /&gt;
 u.light : integer&lt;br /&gt;
&lt;br /&gt;
The light level inside the unit: the [[Manual:DIL Manual/bright|bright]] of everything in it added up, plus the unit's own &amp;lt;code&amp;gt;light&amp;lt;/code&amp;gt; from the zone file. A room with &amp;lt;code&amp;gt;light -1&amp;lt;/code&amp;gt; is dark until something shining is brought in.&lt;br /&gt;
&lt;br /&gt;
What counts: a lit torch held or worn by a character in the room (its light passes to the room through the character), and light that shines out of open transparent containers. A torch in someone's pack lights the inside of the character, not the room.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* It can't be assigned (vmc: &amp;quot;Illegal lvalue&amp;quot;). Change the brightness of a unit inside with [[Manual:DIL Manual/setbright()|setbright()]]; the light around it follows.&lt;br /&gt;
* Whether a unit is lit is [[Manual:DIL Manual/islight()|islight()]]: lit when &amp;lt;code&amp;gt;light&amp;lt;/code&amp;gt;, plus daylight (outdoors only: -1 at night, 0 at sunrise and sunset, 1 by day), plus the light of the unit around it, is 0 or more. So a room with &amp;lt;code&amp;gt;light 0&amp;lt;/code&amp;gt; is lit even at night unless it is outdoors.&lt;br /&gt;
* Characters below creator level see only in a lit room.&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 light_check();&lt;br /&gt;
var&lt;br /&gt;
   room : unitptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   room := self.outside;&lt;br /&gt;
   if (islight(room))&lt;br /&gt;
      sendtext(&amp;quot;The room is lit (light &amp;quot; + itoa(room.light) + &amp;quot;).&amp;lt;br/&amp;gt;&amp;quot;, self);&lt;br /&gt;
   else&lt;br /&gt;
      sendtext(&amp;quot;It is dark here (light &amp;quot; + itoa(room.light) + &amp;quot;).&amp;lt;br/&amp;gt;&amp;quot;, self);&lt;br /&gt;
   quit;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Tells a player whether the room is lit and its light level.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/bright|bright]]&lt;br /&gt;
* [[Manual:DIL Manual/illum|illum]]&lt;br /&gt;
* [[Manual:DIL Manual/islight()|islight()]]&lt;br /&gt;
* [[Manual:DIL Manual/setbright()|setbright()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>