<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.zzt.org/w/index.php?action=history&amp;feed=atom&amp;title=Door</id>
	<title>Door - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.zzt.org/w/index.php?action=history&amp;feed=atom&amp;title=Door"/>
	<link rel="alternate" type="text/html" href="https://wiki.zzt.org/w/index.php?title=Door&amp;action=history"/>
	<updated>2026-06-24T20:24:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.zzt.org/w/index.php?title=Door&amp;diff=317&amp;oldid=prev</id>
		<title>The Green Herring: terrain -&gt; item</title>
		<link rel="alternate" type="text/html" href="https://wiki.zzt.org/w/index.php?title=Door&amp;diff=317&amp;oldid=prev"/>
		<updated>2021-02-10T05:46:25Z</updated>

		<summary type="html">&lt;p&gt;terrain -&amp;gt; item&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:46, 10 February 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|id={{Byte|9}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|id={{Byte|9}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|char={{CharSwatch|10}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|char={{CharSwatch|10}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|category=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;terrain&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|category=&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;item&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|stats=no&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|stats=no&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|destructible=no&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|destructible=no&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>The Green Herring</name></author>
	</entry>
	<entry>
		<id>https://wiki.zzt.org/w/index.php?title=Door&amp;diff=314&amp;oldid=prev</id>
		<title>The Green Herring at 02:28, 10 February 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.zzt.org/w/index.php?title=Door&amp;diff=314&amp;oldid=prev"/>
		<updated>2021-02-10T02:28:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:28, 10 February 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|uses zzt-oop color=yes&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|uses zzt-oop color=yes&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &#039;&#039;&#039;door&#039;&#039;&#039; element is one of the built-in puzzle elements of [[ZZT]]. It blocks the [[player]]&#039;s path unless the player has the corresponding [[key]]; together, they allow the designer to create a simple lock-and-key puzzle. When a door is touched without the player carrying its key, the game prints &quot;The X door is locked!&quot; where X is the color, and impedes the player. When the player touches the door while carrying its key, the game prints &quot;The X door is now open.&quot; where X is the color, and replaces the door with an identically-colored [[empty]]. The engine uses the background color of the door to determine what color of key it requires.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &#039;&#039;&#039;door&#039;&#039;&#039; element is one of the built-in puzzle elements of [[ZZT]]. It blocks the [[player]]&#039;s path unless the player has the corresponding [[key]]; together, they allow the designer to create a simple lock-and-key puzzle. When a door is touched without the player carrying its key, the game prints &quot;The X door is locked!&quot; where X is the color, and impedes the player. When the player touches the door while carrying its key, the game prints &quot;The X door is now open.&quot; where X is the color&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, consumes the key&lt;/ins&gt;, and replaces the door with an identically-colored [[empty]]. The engine uses the background color of the door to determine what color of key it requires.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;By default, when creating a door, the engine creates a white-foreground element with a background color corresponding to the requested color. For example, any request for a blue door results an element that is {{ColorSwatch|fg=white|bg=dark blue}}. This can be exploited with [[ZZT-OOP]] to programmatically create elements with a white foreground and a dark background color other than black, which is not normally possible, by using [[Put|#put]] to overwrite the door with an applicable element (such as a key or a [[gem]]) or using the [[Change|#change]] command to turn it into one. An external editor can be used to place any color of door the designer likes, as long as the background color matches the key that must be used to open it. Blinking doors (or bright-background doors if blinking is disabled) function identically to non-blinking (or dark-background) doors. A chart indicating the default door colors follows:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;By default, when creating a door, the engine creates a white-foreground element with a background color corresponding to the requested color. For example, any request for a blue door results an element that is {{ColorSwatch|fg=white|bg=dark blue}}. This can be exploited with [[ZZT-OOP]] to programmatically create elements with a white foreground and a dark background color other than black, which is not normally possible, by using [[Put|#put]] to overwrite the door with an applicable element (such as a key or a [[gem]]) or using the [[Change|#change]] command to turn it into one. An external editor can be used to place any color of door the designer likes, as long as the background color matches the key that must be used to open it. Blinking doors (or bright-background doors if blinking is disabled) function identically to non-blinking (or dark-background) doors. A chart indicating the default door colors follows:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>The Green Herring</name></author>
	</entry>
	<entry>
		<id>https://wiki.zzt.org/w/index.php?title=Door&amp;diff=313&amp;oldid=prev</id>
		<title>The Green Herring: 🚪</title>
		<link rel="alternate" type="text/html" href="https://wiki.zzt.org/w/index.php?title=Door&amp;diff=313&amp;oldid=prev"/>
		<updated>2021-02-10T02:27:04Z</updated>

		<summary type="html">&lt;p&gt;🚪&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Element&lt;br /&gt;
|zzt-oop name=door&lt;br /&gt;
|id={{Byte|9}}&lt;br /&gt;
|char={{CharSwatch|10}}&lt;br /&gt;
|category=terrain&lt;br /&gt;
|stats=no&lt;br /&gt;
|destructible=no&lt;br /&gt;
|effect on movement=wall&lt;br /&gt;
|uses zzt-oop color=yes&lt;br /&gt;
}}&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;door&amp;#039;&amp;#039;&amp;#039; element is one of the built-in puzzle elements of [[ZZT]]. It blocks the [[player]]&amp;#039;s path unless the player has the corresponding [[key]]; together, they allow the designer to create a simple lock-and-key puzzle. When a door is touched without the player carrying its key, the game prints &amp;quot;The X door is locked!&amp;quot; where X is the color, and impedes the player. When the player touches the door while carrying its key, the game prints &amp;quot;The X door is now open.&amp;quot; where X is the color, and replaces the door with an identically-colored [[empty]]. The engine uses the background color of the door to determine what color of key it requires.&lt;br /&gt;
&lt;br /&gt;
By default, when creating a door, the engine creates a white-foreground element with a background color corresponding to the requested color. For example, any request for a blue door results an element that is {{ColorSwatch|fg=white|bg=dark blue}}. This can be exploited with [[ZZT-OOP]] to programmatically create elements with a white foreground and a dark background color other than black, which is not normally possible, by using [[Put|#put]] to overwrite the door with an applicable element (such as a key or a [[gem]]) or using the [[Change|#change]] command to turn it into one. An external editor can be used to place any color of door the designer likes, as long as the background color matches the key that must be used to open it. Blinking doors (or bright-background doors if blinking is disabled) function identically to non-blinking (or dark-background) doors. A chart indicating the default door colors follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Default door color chart&lt;br /&gt;
|-&lt;br /&gt;
! ZZT-OOP name !! Element color&lt;br /&gt;
|-&lt;br /&gt;
| Blue || {{ColorSwatch|fg=white|bg=dark blue}}&lt;br /&gt;
|-&lt;br /&gt;
| Green || {{ColorSwatch|fg=white|bg=dark green}}&lt;br /&gt;
|-&lt;br /&gt;
| Cyan || {{ColorSwatch|fg=white|bg=dark cyan}}&lt;br /&gt;
|-&lt;br /&gt;
| Red || {{ColorSwatch|fg=white|bg=dark red}}&lt;br /&gt;
|-&lt;br /&gt;
| Purple || {{ColorSwatch|fg=white|bg=dark purple}}&lt;br /&gt;
|-&lt;br /&gt;
| Yellow || {{ColorSwatch|fg=white|bg=brown}}&lt;br /&gt;
|-&lt;br /&gt;
| White || {{ColorSwatch|fg=white|bg=light grey}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Black doors ==&lt;br /&gt;
While doors can be placed in all of the available colors, and black-foreground doors work with no issues, doors with black background colors (or dark-grey when blinking is disabled) will have glitched behavior when interacted with:&lt;br /&gt;
# Touching a door or opening one will create a garbled mess in place of the color name that includes &amp;quot;Blue&amp;quot;, &amp;quot;Green&amp;quot;, &amp;quot;Cyan&amp;quot;, &amp;quot;Red&amp;quot; and &amp;quot;P&amp;quot;;&lt;br /&gt;
# The player cannot open it unless they have at least 256 gems, whereupon the gems counter will be decremented by at least 256&amp;amp;mdash;or more.&lt;br /&gt;
Both of these are out-of-bounds errors related to the arrays used for keys, as follows:&lt;br /&gt;
&lt;br /&gt;
=== Color naming ===&lt;br /&gt;
The color naming for pickup messages is handled by the &amp;lt;tt&amp;gt;ColorNames&amp;lt;/tt&amp;gt; array in GAME.PAS line 92, which has entries for color indexes 1 to 7 of the CGA color palette. This is an array of strings up to eight characters in length. When the engine attempts to access the color name for index 0, the color black, it attempts to access the entry prior to the first entry, &amp;lt;tt&amp;gt;Blue&amp;lt;/tt&amp;gt;, and goes out of bounds into where the preceding &amp;lt;tt&amp;gt;ProgressAnimStrings&amp;lt;/tt&amp;gt; array exists in memory. It then fails to detect when an entry ends, and prints as much of the succeeding portion of memory as it can fit, producing the glitched message. When editing the engine, the bug can be fixed by changing the array range from &amp;lt;tt&amp;gt;1 .. 7&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;0 .. 7&amp;lt;/tt&amp;gt; and adding &amp;lt;tt&amp;gt;&amp;#039;Black&amp;#039;,&amp;lt;/tt&amp;gt; to the start of the array before &amp;lt;tt&amp;gt;&amp;#039;Blue&amp;#039;,&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Counters ===&lt;br /&gt;
The key counter in the world format is defined in GAMEVARS.PAS line 111, under &amp;lt;tt&amp;gt;TWorldInfo&amp;lt;/tt&amp;gt;, as a boolean array named &amp;lt;tt&amp;gt;Keys&amp;lt;/tt&amp;gt; which ranges from 1 to 7, covering CGA color indexes 1 to 7. Collecting the keys of these colors sets their equivalent boolean to &amp;quot;true&amp;quot;, which is indicated internally as &amp;lt;tt&amp;gt;01&amp;lt;/tt&amp;gt;; when used, they are set to false, or &amp;lt;tt&amp;gt;00&amp;lt;/tt&amp;gt;. When the engine attempts to access the entry of this array for color index 0, the color black, it sets &amp;lt;tt&amp;gt;00&amp;lt;/tt&amp;gt; in the byte prior to that of the Blue key, and in doing so goes out of bounds into the second byte of the gems counter, a 16-bit signed integer that thus uses the second byte to indicate units of 256. Because of this, the player&amp;#039;s gems counter will be reset to just the amount covered by the first byte, from 0 to 255. The bug can be fixed by changing the &amp;lt;tt&amp;gt;Keys&amp;lt;/tt&amp;gt; array range from &amp;lt;tt&amp;gt;1..7&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;0..7&amp;lt;/tt&amp;gt;, but doing so will also change the world format, making all standard world files incompatible with the engine.&lt;br /&gt;
&lt;br /&gt;
[[Category:Elements]]&lt;br /&gt;
{{ElementsNavbox}}&lt;/div&gt;</summary>
		<author><name>The Green Herring</name></author>
	</entry>
</feed>