1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4
<title>DM4 Contents</title>
5
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
<link rel="stylesheet" type="text/css" href="dm4.css">
7
<style type="text/css">
9
h3 {font-style: italic; }
10
p.section_header {margin-bottom: 0; font-style: italic; }
11
p.section_detail {margin-top: 0; margin-left: 30px; text-align: justify; }
12
ul.section_detail {list-style-type: none; margin-top: 0; margin-left: 30px; }
18
<a href="index.html">home</a> /
21
<a href="index.html">prev</a> /
22
<a href="intro.html" title="Introduction">next</a> /
23
<a href="dm4index.html">index</a>
29
<p class="section_header"><a href="intro.html">Introduction</a></p>
31
<h3><a href="ch1.html">Chapter I</a>: The Inform Language</h3>
33
<p class="section_header"><a href="s1.html">§1</a> Routines</p>
34
<ul class="section_detail">
35
<li><a href="s1.html#s1_1">1.1.</a> Getting started</li>
36
<li><a href="s1.html#s1_2">1.2.</a> Hello World</li>
37
<li><a href="s1.html#s1_3">1.3.</a> Routine calls, errors and warnings</li>
38
<li><a href="s1.html#s1_4">1.4.</a> Numbers and other constants</li>
39
<li><a href="s1.html#s1_5">1.5.</a> Variables</li>
40
<li><a href="s1.html#s1_6">1.6.</a> Arithmetic, assignment and bitwise operators</li>
41
<li><a href="s1.html#s1_7">1.7.</a> Arguments and return values</li>
42
<li><a href="s1.html#s1_8">1.8.</a> Conditions: <code>if</code>, <code>true</code> and <code>false</code></li>
43
<li><a href="s1.html#s1_9">1.9.</a> Code blocks, <code>else</code> and <code>switch</code></li>
44
<li><a href="s1.html#s1_10">1.10.</a> <code>while</code>, <code>do</code>… <code>until</code>,
45
<code>for</code>, <code>break</code>, <code>continue</code></li>
46
<li><a href="s1.html#s1_11">1.11.</a> How text is printed</li>
47
<li><a href="s1.html#s1_12">1.12.</a> The <code>print</code> and <code>print_ret</code> statements</li>
48
<li><a href="s1.html#s1_13">1.13.</a> Other printing statements</li>
49
<li><a href="s1.html#s1_14">1.14.</a> Generating random numbers</li>
50
<li><a href="s1.html#s1_15">1.15.</a> Deprecated ways to jump around</li>
53
<p class="section_header"><a href="s2.html">§2</a> The state of play</p>
54
<ul class="section_detail">
55
<li><a href="s2.html#s2_1">2.1.</a> Directives construct things</li>
56
<li><a href="s2.html#s2_2">2.2.</a> Constants</li>
57
<li><a href="s2.html#s2_3">2.3.</a> Global variables</li>
58
<li><a href="s2.html#s2_4">2.4.</a> Arrays</li>
59
<li><a href="s2.html#s2_5">2.5.</a> Reading into arrays from the keyboard</li>
62
<p class="section_header"><a href="s3.html">§3</a> Objects</p>
63
<ul class="section_detail">
64
<li><a href="s3.html#s3_1">3.1.</a> Objects, classes, metaclasses and <code>nothing</code></li>
65
<li><a href="s3.html#s3_2">3.2.</a> The object tree</li>
66
<li><a href="s3.html#s3_2">3.3.</a> Declaring objects 1: setting up the object tree</li>
67
<li><a href="s3.html#s3_4">3.4.</a> Tree statements: <code>move</code>, <code>remove</code>, <code>objectloop</code></li>
68
<li><a href="s3.html#s3_5">3.5.</a> Declaring objects 2: <code>with</code> and <code>provides</code></li>
69
<li><a href="s3.html#s3_6">3.6.</a> Declaring objects 3: <code>private</code> properties</li>
70
<li><a href="s3.html#s3_7">3.7.</a> Declaring objects 4: <code>has</code> and <code>give</code></li>
71
<li><a href="s3.html#s3_8">3.8.</a> Declaring objects 5: <code>class</code> inheritance</li>
72
<li><a href="s3.html#s3_9">3.9.</a> Messages</li>
73
<li><a href="s3.html#s3_10">3.10.</a> Passing messages up to the superclass</li>
74
<li><a href="s3.html#s3_11">3.11.</a> Creating and deleting objects during play</li>
75
<li><a href="s3.html#s3_12">3.12.</a> Sending messages to routines and strings</li>
76
<li><a href="s3.html#s3_13">3.13.</a> Common properties and <code>Property</code></li>
77
<li><a href="s3.html#s3_14">3.14.</a> Philosophy</li>
80
<h3><a href="ch2.html">Chapter II:</a> Introduction to Designing</h3>
82
<p class="section_header"><a href="s4.html">§4</a> ‘Ruins’ begun</p>
83
<p class="section_detail">Beginning to lay ‘Ruins’; including library files; the <code>Initialise</code> routine;
84
some properties of mushrooms; <code>name</code>, <code>description</code> and <code>initial</code>; <code>edible</code>
85
foodstuffs; introducing <code>before</code> and <code>after</code> rules; the stone steps.</p>
87
<p class="section_header"><a href="s5.html">§5</a> Introducing messages and classes</p>
88
<p class="section_detail">Recap of message-sending: a parrot; classes for treasure artifacts: the pygmy
89
statuette, the honeycomb; how clashes are sorted out in class inheritance,
92
<p class="section_header"><a href="s6.html">§6</a> Actions and reactions</p>
93
<p class="section_detail">Actions are attempts; generating them with <code><</code>, <code><<</code>; the <code>actor</code>, <code>action</code>, <code>noun</code>
94
and <code>second</code> noun; the <code>##</code> notation; actions fall into three groups; fake actions
95
like <code>ThrownAt</code>; creating new actions, the <code>Blorple</code> example; how actions are
96
processed, over ‘Before’, ‘During’ and ‘After’ stages.</p>
98
<p class="section_header"><a href="s7.html">§7</a> Infix and the debugging verbs</p>
99
<p class="section_detail">Three levels; general strategies; command lists and “recording”, “replay”
100
and “random” debugging verbs; “showobj”, “tree”, “showverb”, “scope”;
101
keeping watch of “actions”, “changes”, “messages”, “timers”; tracing
102
the parser with “trace”; supernatural ability to “purloin”, “abstract”,
103
“goto”, “gonear”; the Infix “; ”, “;give”, “;move”, “;remove”, “;examine”,
104
“;watch”, “;inventory”; marking routines with a * to be watched.</p>
106
<h3><a href="ch3.html">Chapter III:</a> The Model World</h3>
108
<p class="section_header"><a href="s8.html">§8</a> Places and scenery</p>
109
<p class="section_detail">The Square Chamber of ‘Ruins’; what “you don't need to refer to”; <code>static</code>
110
and <code>scenery</code> objects; spreading mist with <code>found_in</code>; α Canis Minoris; the
111
five senses and reaction rules; rooms have <code>before</code> and <code>after</code> too.</p>
113
<p class="section_header"><a href="s9.html">§9</a> Directions and the map</p>
114
<p class="section_detail">Giving ‘Ruins’ a small map; <code>n_to</code>, <code>d_to</code>, etc.; when you <code>cant_go</code>; direction
115
objects in the <code>compass</code>; not the same as direction properties.</p>
117
<p class="section_header"><a href="s10.html">§10</a> Food and drink</p>
118
<p class="section_detail"><code>edible</code> foodstuffs; the <code>Drink</code> action; difficulties with liquids.</p>
120
<p class="section_header"><a href="s11.html">§11</a> Clothing</p>
121
<p class="section_detail"><code>Wear</code> and <code>Disrobe</code>; <code>wearable</code> items of clothing; a jade face mask.</p>
123
<p class="section_header"><a href="s12.html">§12</a> Containers, supporters and sub-objects</p>
124
<p class="section_detail">Containers: <code>container</code>, <code>supporter</code>, <code>capacity</code>, <code>open</code>, <code>openable</code>; locks and
125
keys: <code>locked</code>, <code>lockable</code>, <code>with_key</code>; <code>LetGo</code> and <code>Receive</code> to trap use of a
126
container: a chasm; transparency and component parts.</p>
128
<p class="section_header"><a href="s13.html">§13</a> Doors</p>
129
<p class="section_detail">How to create a <code>door</code>;
130
<code>door_to</code>, <code>door_dir</code>; <code>when_open</code>,
131
<code>when_closed</code>; a stone door for ‘Ruins’; a
132
two-way door, the ‘Advent’ grate; why <code>door_dir</code> is
133
needed and how to trap every attempt to go through.</p>
135
<p class="section_header"><a href="s14">§14</a> Switchable objects</p>
136
<p class="section_detail"><code>switchable</code> and <code>on</code>:
137
<code>when_on</code>, <code>when_off</code>; the Gotham City searchlight;
138
a sodium lamp; <code>describe</code> taking precedence.</p>
140
<p class="section_header"><a href="s15">§15</a> Things to enter, travel in and push around</p>
141
<p class="section_detail"><code>enterable</code> objects: a slab altar;
142
vehicles: KAR 1; special rule about the <code>Go</code> action when
143
inside something <code>enterable</code>; the <code>PushDir</code>
144
action: a huge pumice-stone ball; pushing up and down.</p>
146
<p class="section_header"><a href="s16.html">§16</a> Reading matter and consultation</p>
147
<p class="section_detail">The <code>Consult</code> action, “look
148
up”; <code>consult_from</code> and <code>consult_words</code>:
149
a dictionary of glyphs, Tyndale's Bible; making “read”
150
and “examine” different.</p>
153
<p class="section_header"><a href="s17.html">§17</a> People and animals</p>
154
<p class="section_detail"><code>animate</code> objects and the <code>life</code>
155
rule; a coiled snake and a mummified priest; Blofeld's reactions;
156
<code>talkable</code> objects; some people are <code>transparent</code>.</p>
158
<p class="section_header"><a href="s18.html">§18</a> Making conversation</p>
159
<p class="section_detail">Orders are actions for other people;
160
giving people their own grammars; untypeable verbs; several
161
voice-activated machines; fake fake actions; telephony.</p>
163
<p class="section_header"><a href="s19.html">§19</a> The light and the dark</p>
164
<p class="section_detail">Light versus darkness is automatic; modifying
165
the darkness; going from dark into dark and the <code>DarkToDark</code>
166
entry point; rules on ‘when there is light’.</p>
168
<p class="section_header"><a href="s20.html">§20</a> Daemons and the passing
170
<p class="section_detail">Daemons and the <code>daemon</code> property;
171
starting and stopping them; background daemons; timers (fuses);
172
<code>time_left</code> and <code>time_out</code>; <code>each_turn</code>
173
events for places and nearby objects; the time of day; changing it
174
with <code>SetTime</code>; on the status line; midnight, sunrise, sunset;
175
the exact sequence of events at end-of-turn.</p>
177
<p class="section_header"><a href="s21.html">§21</a> Starting, moving, changing
178
and killing the player</p>
179
<p class="section_detail">What <code>Initialise</code> should do;
180
the <code>location</code>; <code>initial</code> restoration;
181
teleportation and the <code>PlayerTo</code> routine; what happens
182
when the room changes: <code>NewRoom</code>, <code>initial</code>
183
for a room, <code>visited</code>; giving the player his own <code>before</code>
184
rule; using <code>ChangePlayer</code> to transform him into any object;
185
multi-character games; <code>life</code> and <code>deadflag</code>;
186
the <code>DeathMessage</code> routine; resurrection and the <code>AfterLife</code>.</p>
188
<p class="section_header"><a href="s22.html">§22</a> Miscellaneous constants,
189
scoring, quotations</p>
190
<p class="section_detail"><code>Story</code> and <code>Headline</code>;
191
<code>MAX_CARRIED</code>; the automatic “sack object”;
192
‘amusing’ rewards for the victorious; two scoring systems:
193
for places and items, or for completing tasks; rankings and <code>PrintRank</code>;
194
automatic score notification and <code>notify_mode</code>; “objects”
195
and “places” verbs, removable with <code>NO_PLACES</code>;
196
boxed quotations.</p>
198
<p class="section_header"><a href="s23.html">§23</a> ‘Ruins’ revisited</p>
199
<p class="section_detail">Further examples to complete ‘Ruins’;
200
a map and a step by step solution of the final game.</p>
202
<p class="section_header"><a href="s24.html">§24</a> The world model described</p>
203
<p class="section_detail">¶1. Substance –
204
¶2. Containment – ¶3. Space – ¶4. Sense –
205
¶5. Time – ¶6. Action.</p>
207
<p class="section_header"><a href="s25.html">§25</a> Extending and redefining the world model</p>
208
<p class="section_detail">Enriching the model; Egyptian amulets and
209
their spells; making a new library file; the <code>LibraryMessages</code>
210
system for changing messages like “Dropped.”; changing
211
the prompt; the last resort of <code>Replace</code> directives; using
212
the world model description; fire and flammability.</p>
214
<h3><a href="ch4.html">Chapter IV</a>: Describing and Parsing</h3>
216
<p class="section_header"><a href="s26.html">§26</a> Describing objects and rooms</p>
217
<p class="section_detail"><code>print (The) obj, ... (the) obj</code> and
218
so on; indefinite and definite <code>article</code>; <code>proper</code>
219
nouns; the <code>short_name</code> of an object; <code>invent</code>
220
strings and routines; exactly how inventory lines are printed; a matchbook;
221
<code>describe</code> routines; exactly how rooms
222
are described; <code>Locale</code>.</p>
224
<p class="section_header"><a href="s27.html">§27</a> Listing and grouping objects</p>
225
<p class="section_detail">The list-maker <code>WriteListFrom</code>; its style
226
bitmap; examples: tall and wide inventories; grouping similar items
227
together in lists: foodstuffs, Scrabble pieces and denominations
230
<p class="section_header"><a href="s28.html">§28</a> How nouns are parsed</p>
231
<p class="section_detail">How <code>name</code> is used; a fried green tomato
232
turning red; the parser breaks text into a stream of words;
233
<code>wn</code> and <code>NextWord</code>; reading words as numbers or from their
234
raw text; a <code>parse_name</code> routine is much more flexible than <code>name</code>;
235
the <code>ParseNoun</code> entry point; distinguishing adjectives from nouns.</p>
237
<p class="section_header"><a href="s29.html">§29</a> Plural names for duplicated objects</p>
238
<p class="section_detail">Collections of indistinguishable objects;
239
a bag of six coins; the <code>plural</code> property for printing out plurals;
240
definition of ‘indistinguishable’; writing <code>parse_name</code>
241
routines to allow plurals to be understood; class of crowns.</p>
243
<p class="section_header"><a href="s30.html">§30</a> How verbs are parsed</p>
244
<p class="section_detail">The parser's fundamental method; <code>BeforeParsing</code>
245
entry point; the actor and verb word; synonyms for verbs; definitions
246
of grammar, line and token; <code>action_to_be</code>; <code>Verb</code> directive: a
247
simplified “take” grammar; <code>meta</code> verbs; grammar creates
248
actions; creating an “xyzzy” verb; how to <code>Extend</code> grammar
249
for an existing verb: pushing numbered buttons; priority: <code>replace</code>,
250
<code>first</code>, <code>last</code>; splitting synonymous verbs apart with <code>Extend only</code>;
251
the <code>UnknownVerb</code> and <code>PrintVerb</code> entry points.</p>
253
<p class="section_header"><a href="s31.html">§31</a> Tokens of grammar</p>
254
<p class="section_detail">Full list of grammar tokens; prepositions;
255
<code>noun</code> and <code>held</code>; implicit taking; tokens allowing multiple objects
256
like “all”; filtering out nouns by attribute:
257
“use” verb; and by general routine: “free”
258
verb; parsing numbers: “type” verb, <code>ParseNumber</code>;
259
general parsing routines; reading from the parser's raw text
260
<code>buffer</code> and <code>parse</code> table; exercises, including French, telephone
261
and floating-point numbers, times of day, adding a <code>third</code> parameter
262
to a grammar line.</p>
264
<p class="section_header"><a href="s32.html">§32</a> Scope and what you can see</p>
265
<p class="section_detail">The definition of ‘in scope’;
266
touchability is stricter than scope; answering questions:
267
“what is a grue”; <code>scope=...</code> tokens with programmable
268
scope; <code>scope_stage</code>, <code>ScopeWithin</code> and <code>PlaceInScope</code>; changing
269
the global definition of ‘in scope’ using <code>InScope</code>;
270
<code>scope_reason</code>; looping over and testing scope; making the rules
271
more sensitive to darkness; a long room divided by a glass
272
wall; the <code>add_to_scope</code> property for component parts of containers.</p>
274
<p class="section_header"><a href="s33.html">§33</a> Helping the parser out of trouble</p>
275
<p class="section_detail">Parser error messages and <code>ParserError</code>;
276
ambiguity-resolution and influencing it with <code>ChooseObjects</code>; making
277
“eat” prefer <code>edible</code> objects; redefining “all”;
278
exactly how ambiguities are resolved.</p>
280
<h3><a href="ch5.html">Chapter V</a>: Natural Language</h3>
282
<p class="section_header"><a href="s34.html">§34</a> Linguistics and the Inform parser</p>
283
<p class="section_detail">¡Bienvenido a Aventura!; Informese;
284
commands, verb phrases, prepositions, noun phrases, gender-number-animation
285
(GNA), descriptors, nouns, pronouns; example of parsing; grammatical
286
features not present in Informese.</p>
288
<p class="section_header"><a href="s35.html">§35</a> Case and parsing noun phrases</p>
289
<p class="section_detail">Flexion and cases; parsing inflected
290
noun phrases; for example, Old English dative word-endings.</p>
292
<p class="section_header"><a href="s36.html">§36</a> Parsing non-English languages</p>
293
<p class="section_detail">Compromises; accented characters at the
294
keyboard?; dialects; language definition files; <code>Zcharacter</code> and
295
the customisation of ZSCII; specifying pronouns and descriptors;
296
translating natural languages to Informese.</p>
298
<p class="section_header"><a href="s37.html">§37</a> Names and messages in non-English languages</p>
299
<p class="section_detail">Gender-number-animation of short names;
300
agreement with articles and cases; contraction forms and articles;
301
library messages of all kinds.</p>
303
<h3><a href="ch6.html">Chapter VI</a>: Using the Compiler</h3>
305
<p class="section_header"><a href="s38.html">§38</a> Controlling compilation from within</p>
306
<p class="section_detail"><code>Include</code>; conditional compilation: <code>If...</code>,
307
<code>Ifnot</code>, <code>Endif</code>; <code>Message</code>; linking in the library; writing new modules
308
to link in; serial and release numbers.</p>
310
<p class="section_header"><a href="s39.html">§39</a> Controlling compilation from without</p>
311
<p class="section_detail">Switches; memory settings; pathname variables;
312
Inform Control Language (ICL).</p>
314
<p class="section_header"><a href="s40.html">§40</a> All the Inform error messages</p>
315
<p class="section_detail">Fatal errors; errors, including linker and
316
assembler errors; warnings, including obsolete usage warnings.</p>
318
<h3><a href="ch7.html">Chapter VII</a>: The Z-Machine</h3>
320
<p class="section_header"><a href="s41.html">§41</a> Architecture and assembly</p>
321
<p class="section_detail">ZIL, Inform and the Z-machine; its Versions;
322
assembly language; store and branch opcodes, labels; memory map and
325
<p class="section_header"><a href="s42.html">§42</a> Devices and opcodes</p>
326
<p class="section_detail">The Standard for interpreters; input and
327
output streams; the Version 5 and Version 6 screen models; colours,
328
windows and status lines; interrupt countdowns; pictures; sounds;
329
keyboard reading with timed interrupts; terminating characters; the
330
mouse; menus; loading and saving auxiliary files; throwing and
331
catching stack frames.</p>
333
<p class="section_header"><a href="s43.html">§43</a> Pictures, sounds, blurbs and Blorb</p>
334
<p class="section_detail">What a Blorb file is; the perlBlorb utility
335
program; blurb files; palette, resolution, scaling; specifying what
336
sounds and pictures belong to a story file.</p>
338
<p class="section_header"><a href="s44.html">§44</a> Case study: a library file for menus</p>
339
<p class="section_detail">Invisiclues; basic design; the <code>Option</code> class;
340
the <code>Menu</code> class; the <code>SwitchOption</code> class.</p>
342
<p class="section_header"><a href="s45.html">§45</a> Limitations and getting around them</p>
343
<p class="section_detail">Story file size; readable memory size; grammar;
344
vocabulary; dictionary resolution; objects, attributes, properties, names;
345
function and message arguments; recursion and stack usage; abbreviations
348
<h3><a href="ch8.html">Chapter VIII</a>: The Craft of Adventure</h3>
350
<p class="section_header"><a href="s46.html">§46</a>
351
A brief history of interactive fiction</p>
352
<ul class="section_detail">
353
<li><a href="s46.html#s46_1">§46.1.</a>
354
Precursors and university games 1972–81</li>
355
<li><a href="s46.html#s46_2">§46.2.</a>
356
The commercial boom 1982–6</li>
357
<li><a href="s46.html#s46_3">§46.3.</a>
358
The growth of a community c. 1985–91</li>
359
<li><a href="s46.html#s46_4">§46.4.</a>
360
Newsgroups and revival 1992–</li>
363
<p class="section_header"><a href="s47.html">§47</a>
364
Realities and origins</p>
365
<p class="section_detail">Fictional backgrounds; crimes against mimesis;
366
historical research; book adaptations.</p>
368
<p class="section_header"><a href="s48.html">§48</a>
369
A triangle of identities</p>
370
<p class="section_detail">Player, protagonist and narrator; participatory
371
magic; the overture and other narrated text.</p>
373
<p class="section_header"><a href="s49.html">§49</a>
375
<p class="section_detail">Size and density; the prologue, middle game and end
376
game; wide versus narrow; lattice diagrams, including one for
377
‘Ruins’.</p>
379
<p class="section_header"><a href="s50.html">§50</a>
380
The design of puzzles</p>
381
<p class="section_detail">General remarks on good and bad puzzles; mazes, light
382
sources, capacity and exhaustion, timed puzzles, utility objects,
383
keys and doors, machinery and vehicles, fire, water, air, earth,
384
plants, animals, monsters, people, ropes and chains, riddles,
385
decipherment puzzles; clues, luck and accidental solutions;
386
optional and multiple solutions; rewards.</p>
388
<p class="section_header"><a href="s51.html">§51</a>
389
The room description</p>
390
<p class="section_detail">Examples of good, mediocre and poor description; how
391
much space is one location?; variable descriptions; outdoor games;
392
differing perspectives.</p>
394
<p class="section_header"><a href="s52.html">§52</a>
396
<p class="section_detail">Scoring systems; responding to wrong guesses; examples
397
of typical bugs; play-testing and editing; concluding homily.</p>
399
<p class="section_header">APPENDICES</p>
400
<ul class="section_detail">
401
<li><a href="sa1.html">§A1</a> Library attributes</li>
402
<li><a href="sa2.html">§A2</a> Library properties</li>
403
<li><a href="sa3.html">§A3</a> Library routines</li>
404
<li><a href="sa4.html">§A4</a> Library message numbers</li>
405
<li><a href="sa5.html">§A5</a> Entry point routines</li>
406
<li><a href="sa6.html">§A6</a> Answers to all the exercises</li>
409
<p class="section_header">TABLES</p>
410
<ul class="section_detail">
411
<li><a href="tables.html#tbl1a">Table 1</a> Operators</li>
412
<li><a href="tables.html#tbl2a">Table 2</a> The ZSCII Character Set</li>
413
<li><a href="tables.html#tbl3">Table 3</a> Command Line Switches</li>
414
<li><a href="tables.html#tbl4">Table 4</a> Statements</li>
415
<li><a href="tables.html#tbl5">Table 5</a> Directives</li>
416
<li><a href="tables.html#tbl6a">Table 6</a> Library actions</li>
419
<p class="section_header">INDEX</p>
420
<ul class="section_detail">
421
<li><a href="cited.html">Cited Works of Interactive Fiction</a></li>
422
<li><a href="exdm4index.html">Index of Exercises</a></li>
423
<li><a href="dm4index.html">General Index</a></li>
426
<p class="section_header" style="margin-bottom:1em"><a href="colophon.html">Colophon</a><br>
427
<a href="colophon.html#ld">Long Descriptions of Selected Images</a><br>
428
<a href="backcover.html">Back Cover</a></p>
432
<a href="index.html">home</a> /
435
<a href="index.html">prev</a> /
436
<a href="intro.html" title="Introduction">next</a> /
437
<a href="dm4index.html">index</a>