<?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%2Fopenflags</id>
	<title>Manual:DIL Manual/openflags - 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%2Fopenflags"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/openflags&amp;action=history"/>
	<updated>2026-11-22T20:07:36Z</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/openflags&amp;diff=2887&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/openflags&amp;diff=2887&amp;oldid=prev"/>
		<updated>2026-11-14T23:11:10Z</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;= openflags =&lt;br /&gt;
'''Field''' (integer, read/write; units: all, used on containers and other units that open).&lt;br /&gt;
&lt;br /&gt;
 u.openflags : integer&lt;br /&gt;
&lt;br /&gt;
Whether the unit opens, and whether it is closed or locked: a bit set of &amp;lt;code&amp;gt;EX_*&amp;lt;/code&amp;gt; values from &amp;lt;code&amp;gt;vme.h&amp;lt;/code&amp;gt;. In a zone file it is &amp;lt;code&amp;gt;open {EX_OPEN_CLOSE, EX_CLOSED}&amp;lt;/code&amp;gt;, optionally followed by &amp;lt;code&amp;gt;difficulty&amp;lt;/code&amp;gt; (see [[Manual:DIL Manual/opendiff|opendiff]]).&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;EX_OPEN_CLOSE&amp;lt;/code&amp;gt;: it can be opened and closed.&lt;br /&gt;
* &amp;lt;code&amp;gt;EX_CLOSED&amp;lt;/code&amp;gt;: it is closed.&lt;br /&gt;
* &amp;lt;code&amp;gt;EX_LOCKED&amp;lt;/code&amp;gt;: it is locked. The key is in [[Manual:DIL Manual/key|key]].&lt;br /&gt;
* &amp;lt;code&amp;gt;EX_PICKPROOF&amp;lt;/code&amp;gt;: the lock can't be picked.&lt;br /&gt;
* &amp;lt;code&amp;gt;EX_INSIDE_OPEN&amp;lt;/code&amp;gt;: it can also be opened and locked from inside (a coffin).&lt;br /&gt;
&lt;br /&gt;
The other &amp;lt;code&amp;gt;EX_&amp;lt;/code&amp;gt; flags (&amp;lt;code&amp;gt;EX_HIDDEN&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;EX_CLIMB&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;EX_FALL_THIS_WAY&amp;lt;/code&amp;gt;) are for exits; a room's exits have their own flags in [[Manual:DIL Manual/exit info|exit_info]].&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* The open, close, lock and unlock commands in basemove.zon and pick in skills.zon change these bits with [[Manual:DIL Manual/set()|set()]] and [[Manual:DIL Manual/unset()|unset()]], after their checks and messages.&lt;br /&gt;
* A closed unit isn't transparent even with &amp;lt;code&amp;gt;UNIT_FL_TRANS&amp;lt;/code&amp;gt;. Opening or closing it this way doesn't recount the light that shines out of it ([[Manual:DIL Manual/illum|illum]]).&lt;br /&gt;
* Stored as an 8-bit number.&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 open_item(item : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (not isset(item.openflags, EX_OPEN_CLOSE))&lt;br /&gt;
      act(&amp;quot;You can't open $2n.&amp;quot;, A_ALWAYS, self, item, null, TO_CHAR);&lt;br /&gt;
   else if (not isset(item.openflags, EX_CLOSED))&lt;br /&gt;
      act(&amp;quot;$2n is already open.&amp;quot;, A_ALWAYS, self, item, null, TO_CHAR);&lt;br /&gt;
   else if (isset(item.openflags, EX_LOCKED))&lt;br /&gt;
      act(&amp;quot;$2n is locked.&amp;quot;, A_ALWAYS, self, item, null, TO_CHAR);&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
      unset(item.openflags, EX_CLOSED);&lt;br /&gt;
      act(&amp;quot;You open $2n.&amp;quot;, A_ALWAYS, self, item, null, TO_CHAR);&lt;br /&gt;
      act(&amp;quot;$1n opens $2n.&amp;quot;, A_SOMEONE, self, item, null, TO_REST);&lt;br /&gt;
   }&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Opens a container, with the checks the open command in basemove.zon makes.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/opendiff|opendiff]]&lt;br /&gt;
* [[Manual:DIL Manual/key|key]]&lt;br /&gt;
* [[Manual:DIL Manual/exit info|exit_info]]&lt;br /&gt;
* [[Manual:DIL Manual/isset()|isset()]]&lt;br /&gt;
* [[Manual:DIL Manual/unset()|unset()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>