<?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%2Fsetroomexit%28%29</id>
	<title>Manual:DIL Manual/setroomexit() - 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%2Fsetroomexit%28%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/setroomexit()&amp;action=history"/>
	<updated>2026-11-24T05:21:04Z</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/setroomexit()&amp;diff=2840&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/setroomexit()&amp;diff=2840&amp;oldid=prev"/>
		<updated>2026-11-14T23:07:59Z</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;= setroomexit() =&lt;br /&gt;
'''Procedure.''' Points a room's exit in one direction at another room, making the exit if the room has none that way.&lt;br /&gt;
&lt;br /&gt;
 setroomexit(room : unitptr, dir : integer, toroom : unitptr)&lt;br /&gt;
&lt;br /&gt;
If the room already has an exit in that direction, only its destination changes: the exit keeps its names, door flags, key and difficulty. If it has none, a new plain exit is made, with no door and no names. The exit goes one way only; to let players walk back, set the exit from the other room too.&lt;br /&gt;
&lt;br /&gt;
The change lasts until the server reboots: rooms are not saved.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| room || unitptr || The room the exit leads out of.&lt;br /&gt;
|-&lt;br /&gt;
| dir || integer || The direction, &amp;lt;code&amp;gt;DIR_NORTH&amp;lt;/code&amp;gt; (0) to &amp;lt;code&amp;gt;DIR_SOUTHWEST&amp;lt;/code&amp;gt; (9), from &amp;lt;code&amp;gt;vme/include/vme.h&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| toroom || unitptr || The room the exit leads to.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Every failure writes a line to the zone log and changes nothing: a null &amp;lt;code&amp;gt;room&amp;lt;/code&amp;gt;, a direction outside 0 to 9, or a unit that is neither a room nor inside one. &amp;lt;code&amp;gt;DIR_ENTER&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;DIR_EXIT&amp;lt;/code&amp;gt; (10 and 11) are not exits and are refused.&lt;br /&gt;
* Pass only rooms. The procedure doesn't check that &amp;lt;code&amp;gt;room&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;toroom&amp;lt;/code&amp;gt; really are rooms, only that they are in one: a character or an object there is taken as a room and corrupts the server's memory.&lt;br /&gt;
* To close the exit again, pass a unitptr variable that holds null as &amp;lt;code&amp;gt;toroom&amp;lt;/code&amp;gt; (vmc refuses a literal &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;: &amp;quot;Arg 3 of 'setroomexit' not an unitptr&amp;quot;). The exit stays, with no destination: &amp;lt;code&amp;gt;room.exit_to[dir]&amp;lt;/code&amp;gt; is null and players who go that way are told they can't.&lt;br /&gt;
* No access level is needed: any zone can change any room's exits.&lt;br /&gt;
* Players see the new exit at once.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin set_passage(from : string, to : string, isopen : integer);&lt;br /&gt;
var&lt;br /&gt;
   r1 : unitptr;&lt;br /&gt;
   r2 : unitptr;&lt;br /&gt;
   none : unitptr;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   r1 := findroom(from);&lt;br /&gt;
   r2 := findroom(to);&lt;br /&gt;
   if ((r1 == null) or (r2 == null))&lt;br /&gt;
      return;&lt;br /&gt;
   if (isopen)&lt;br /&gt;
   {&lt;br /&gt;
      setroomexit(r1, DIR_NORTH, r2);&lt;br /&gt;
      setroomexit(r2, DIR_SOUTH, r1);&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
      setroomexit(r1, DIR_NORTH, none);&lt;br /&gt;
      setroomexit(r2, DIR_SOUTH, none);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Opens a passage north and back south between two rooms, or closes it again (&amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; is never set, so it is null).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/exit to|exit to]]&lt;br /&gt;
* [[Manual:DIL Manual/exit names|exit names]]&lt;br /&gt;
* [[Manual:DIL Manual/exit info|exit info]]&lt;br /&gt;
* [[Manual:DIL Manual/findroom()|findroom()]]&lt;br /&gt;
* [[Manual:DIL Manual/link()|link()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>