Debian Codegraph @

terps/tads/tads2/tadsver.htm

raw symbols SCIP
1 <html>
2
3 <title>TADS Revision History</title>
4
5 <body>
6
7 <br><br><br>
8 <center><font size=+3>Recent Changes to TADS</font>
9 </center>
10
11 <h4>Index to Versions</h4>
12 <ul>
13 <!-- {$version-index} -->
14 <li><a href='#tads2517'><b>Version 2.5.17</b></a><br>
15 <li><a href='#tads2516'><b>Version 2.5.16</b></a><br>
16 <li><a href='#tads2515'><b>Version 2.5.15</b></a><br>
17 <li><a href='#tads2514'><b>Version 2.5.14</b></a><br>
18 <li><a href='#tads2513'><b>Version 2.5.13</b></a><br>
19 <li><a href='#tads2512'><b>Version 2.5.12</b></a><br>
20 <li><a href='#tads2511'><b>Version 2.5.11</b></a><br>
21 <li><a href='#tads2510'><b>Version 2.5.10</b></a><br>
22 <li><a href='#tads259'><b>Version 2.5.9</b></a><br>
23 <li><a href='#tads258'><b>Version 2.5.8</b></a><br>
24 <li><a href='#tads257'><b>Version 2.5.7</b></a><br>
25 <li><a href='#tads256'><b>Version 2.5.6</b></a><br>
26 <li><a href='#tads255'><b>Version 2.5.5</b></a><br>
27 <li><a href='#tads254'><b>Version 2.5.4</b></a><br>
28 <li><a href='#tads253'><b>Version 2.5.3</b></a><br>
29 <li><a href='#tads252'><b>Version 2.5.2</b></a><br>
30 <li><a href='#tads251'><b>Version 2.5.1</b></a><br>
31 <li><a href='#tads250'><b>Version 2.5.0</b></a><br>
32 </ul>
33
34 <h4>Organization of this Page</h4>
35
36 <p>This page is a list of recent changes to TADS, arranged
37 chronologically: changes are grouped by release, with the most recent
38 release listed first. Each release incorporates all new features and
39 corrections of each prior release unless otherwise stated.
40
41 <h4>Generic and Platform-Specific Changes</h4>
42
43 <p>
44 Since version 2.2.6, the TADS change log has been divided into
45 two separate files: one for "generic" changes that apply to TADS on
46 all types of computers and operating systems, and one for changes
47 that apply only to specific platforms. This file contains the
48 generic release notes. Platform-specific release notes are in a
49 separate file for each platform:
50
51 <blockquote>
52 <p><a href='dosver.htm'>Changes specific to MS-DOS and Windows</a>
53 </blockquote>
54
55 <h4>Multimedia vs. Text-Only Interpreters</h4>
56
57 <p>These release notes sometimes refer to the "character-mode" or
58 "text-only" TADS Interpreter. This is meant to distinguish the
59 traditional TADS Interpreter, which can only display text, from the
60 multimedia interpreters such as HTML TADS and HyperTADS, which can
61 display graphics as well as text. The traditional TADS Interpreter
62 has a graphical user interface on some systems, such as the
63 Macintosh, so it's not really a character-mode application on those
64 systems; nonetheless, we still refer to it here as the character-mode
65 Interpreter simply to make it clear that we're not talking about one
66 of the multimedia versions.
67
68 <h4><a name='oldlog'>Older Revisions</a></h4>
69
70 <p>To keep the size of this page under control, changes are listed here
71 only for the most recent several versions of TADS. Older release notes
72 are in separate files:
73
74 <ul>
75 <li>Generic changes from version 2.2.3 through 2.4.0 are in TADSV240.TXT.
76
77 <li>DOS-specific changes from version 2.2.3 through 2.4.0 are in
78 TADSV240.DOS.
79
80 <li>For DOS, all revisions from 2.0 through 2.1.0 are available in the
81 file TADSV200.DOS; those from 2.1.1 through 2.2.2 are in TADSV222.DOS.
82
83 <li>Similar files are available for
84 other platforms; please refer to your platform-specific release
85 notes for details.
86
87 </ul>
88
89 <p>Because the older revision history files are quite large and are
90 static (they are, after all, historical), they're not included in the
91 normal TADS distributions, but you can download them from the
92 Interactive Fiction Archive via the internet at <a
93 href='ftp://ftp.ifarchive.org/if-archive/programming/tads2/manuals/'>
94 ftp://ftp.ifarchive.org/if-archive/programming/tads2/manuals/</a>
95 (note that ftp.ifarchive.org is the new home, effective August 2001,
96 of the former ftp.gmd.de archive).
97
98 <!-- {$new-version-insertion-point} -->
99
100 <!------------------------------------------------------------------------>
101 <br><br><hr>
102 <h3><a name='tads2517'>Version 2.5.17</a></h3>
103 <i>Released May 16, 2013</i>
104
105 <ul>
106
107 <li>In the past, HTML &lt;PRE&gt; blocks were problematic if you
108 wanted to use &lt;PRE&gt; for precise indentation. The complication
109 was that the output formatter in the VM pre-filtered the text sent to
110 the HTML parser to consolidate each run of whitespace into a single
111 space. If you wanted to use spaces in a &lt;PRE&gt; block for
112 alignment purposes, you had to use quoted spaces (<tt>"\ "</tt> sequences)
113 to make sure that all of the spaces were sent through to the HTML parser.
114
115 <p>Now, the VM formatter layer watches for &lt;PRE&gt; tags. Within
116 a &lt;PRE&gt; block, the VM formatter passes spaces and
117 newlines through to the HTML parser without any filtering. This
118 change addresses
119 <a href="http://bugdb.tads.org/view.php?id=0000178">bug #0000178</a>
120 (which was filed as a TADS 3 bug, but effectively applied to TADS 2 as
121 well, because the output formatting and HTML handling are very similar
122 in TADS 2 and TADS 3).
123
124 <p>Note that there's another slight complication if you're writing
125 multi-line preformatted blocks with spacing for indentation. The
126 compiler normally removes the spaces that follow a line break within a
127 string. To preserve spaces after a line break within a string, put an
128 explicit <tt>\n</tt> sequence at the start of each line within a
129 multi-line string.
130
131 <li>On 64-bit Linux platforms, a bug in the compiler caused spurious
132 errors ("invalid property value") when an object definition contained
133 a property value set to a list containing constant values (e.g., <tt>p
134 = [1]</tt>). This has been corrected.
135
136 (<a href="http://bugdb.tads.org/view.php?id=0000106">bugdb.tads.org #0000106</a>)
137
138
139 </ul>
140
141
142
143 <!------------------------------------------------------------------------>
144 <br><br><hr>
145 <h3><a name='tads2516'>Version 2.5.16</a></h3>
146 <i>Released on August 30, 2012</i>
147
148 <ul>
149
150 <li>A couple of bugs appeared in version 2.5.15 due to internal
151 changes in the file safety mechanism. In particular, stand-alone
152 executable games on Windows could sometimes crash on start-up, and
153 compiling a game that accessed files within its preinit function
154 sometimes failed due to a spurious file error. The second problem
155 affected games using the gameinfo.t module to create a GameInfo file
156 within preinit. These are now fixed.
157
158 </ul>
159
160
161 <!------------------------------------------------------------------------>
162 <br><br><hr>
163 <h3><a name='tads2515'>Version 2.5.15</a></h3>
164 <i>Released on December 21, 2011</i>
165
166 <ul>
167
168 <li>In past versions of the text-only interpreters, if an
169 &lt;ABOUTBOX&gt; section contained an &lt;IMG&gt; tag with an ALT
170 attribute, the ALT text was displayed. It shouldn't have been,
171 because the text-only systems aren't supposed to display
172 <i>anything</i> that's within an &lt;ABOUTBOX&gt; section. This has
173 been corrected.
174
175 (<a href="http://bugdb.tads.org/view.php?id=0000063">bugdb.tads.org #0000063</a>)
176
177 <li>The text-only interpreters now parse and translate HTML
178 entity markups ("&amp" sequences) within &lt;TITLE&gt; tags when
179 setting the window title. (In past versions, the text-only
180 interpreters simply displayed the literal text of the &amp;
181 sequences. The HTML interpreters didn't have this problem,
182 so this change doesn't affect them.)
183
184 (<a href="http://bugdb.tads.org/view.php?id=0000062">bugdb.tads.org #0000062</a>)
185
186 <li>Some older games (specifically, compiled with a version before
187 TADS 2.3.0, from 1999) use an old version of the file dialog functions
188 that wasn't able to specify the file type. For modern GUI operating
189 systems, the file type is fairly important, because the file selection
190 dialog usually uses this to filter the file list, and to set default
191 file types or extensions for new files. The interpreter now tries to
192 infer when the interpreter is asking for the name of a transcript
193 file, by looking at the prompt string. If it sees the word "script"
194 or "transcript" the prompt string, the interpreter now assumes that
195 it's asking for a transcript file, and sets the appropriate default
196 file type in the dialog.
197
198 <li>The interpreter core engine is now more careful at game
199 termination to release allocated memory. This generally won't make
200 any difference to players, as the operating system usually frees this
201 memory anyway at program exit, but it should improve stability in
202 interpreters that can run multiple games in series.
203
204 <li>In the past, it was possible for a game to crash the interpreter
205 by returning a fairly long (around 200-character) message from
206 parseError or parseErrorParam. This has been corrected. (<a
207 href="http://bugdb.tads.org/view.php?id=100">bugdb.tads.org
208 #0000100</a>)
209
210 <li>Some internal changes in the code address problems related to
211 memory management on 64-bit processors.
212
213 (<a href="http://bugdb.tads.org/view.php?id=0000084">bugdb.tads.org #0000084</a>)
214
215
216 </ul>
217
218
219
220 <!------------------------------------------------------------------------>
221 <br><br><hr>
222 <h3><a name='tads2514'>Version 2.5.14</a></h3>
223 <i>Released on May 5, 2009</i>
224
225 <ul>
226
227 <li>Objects created with 'new' during the preinit phase are now marked
228 as ordinary objects in the .gam file, as though they'd been defined
229 statically in the source code. The same thing applies to the
230 vocabulary words they use. This change means that objects created
231 dynamically during preinit are effectively permanent: they persist
232 through RESTART, RESTORE, UNDO, and the like, and they can't be
233 deleted with the 'delete' operator.
234 (<a href="http://bugdb.tads.org/view.php?id=0000055">bugdb.tads.org #0000055</a>)
235
236 </ul>
237
238
239 <!------------------------------------------------------------------------>
240 <br><br><hr>
241 <h3><a name='tads2513'>Version 2.5.13</a></h3>
242 <i>Released on April 28, 2009</i>
243
244 <ul>
245
246 <li>The new systemInfo() codes __SYSINFO_AUDIO_FADE and
247 __SYSINFO_AUDIO_CROSSFADE let you determine if the interpreter
248 supports audio fades and audio cross-fades, respectively. (Audio
249 fades are accessed through the HTML TADS &lt;SOUND&gt; tag.) These
250 codes return nil or 0 if fades/cross-fades aren't supported at all, or
251 an integer giving a combination of bit-flags indicating which audio
252 formats support fades/cross-fades. The bit flags are
253 __SYSINFO_AUDIOFADE_WAV, __SYSINFO_AUDIOFADE_MPEG,
254 __SYSINFO_AUDIOFADE_OGG, and __SYSINFO_AUDIOFADE_MIDI (for WAV, MP3,
255 Ogg Vorbis, and MIDI files, respectively). For example, if
256 systemInfo(__SYSINFO_AUDIO_FADE) returns (__SYSINFO_AUDIOFADE_WAV |
257 __SYSINFO_AUDIOFADE_OGG), it means that WAV and Ogg Vorbis files
258 support fades, but other audio formats don't.
259
260 <li>A bug in the compiler sometimes made the debugger show the wrong
261 source location when single-stepping within a single-line expression
262 property. (That is, a property with an executable expression, but no
263 curly braces, with the whole definition on a single line of text.)
264 This bug was mostly cosmetic, but in rare cases triggered a separate
265 bug in the debugger that could crash the debugger. When a single-line
266 expression property was immediately followed by a single-line method
267 (with braces), and execution stopped in the method due to
268 single-stepping or due to a run-time error, the debugger was unable to
269 show the execution location, and sometimes even crashed. Both of
270 these bugs are now fixed.
271
272 </ul>
273
274
275 <!------------------------------------------------------------------------>
276 <br><br><hr>
277 <h3><a name='tads2512'>Version 2.5.12</a></h3>
278 <i>Released on September 28, 2008</i>
279
280 <ul>
281
282 <li>The cvtnum() built-in function returned the wrong result for
283 negative values on occasion. The problem was dependent on chance
284 arrangements of the run-time string/list heap, so it occurred
285 essentially at random. This has been corrected - cvtnum() now
286 correctly stops at the end of the string. (<b>Workaround for
287 older versions:</b> append a non-digit character to the cvtnum()
288 argument - e.g., <tt>cvtnum(str + ';')</tt>. The problem was that
289 cvtnum() didn't properly detect the end of the input string, so it
290 sometimes scanned into random bytes in memory following the string
291 <i>if</i> those bytes happened to look like ASCII digits. However,
292 the function did always correctly stop upon reaching any non-digit
293 character, so explicitly appending a non-digit was enough to make the
294 function stop scanning, ensuring that it wouldn't stray past the end
295 of the string. This workaround isn't necessary with 2.5.12 and later,
296 since the underlying problem in cvtnum() is now fixed, but you can use
297 the workaround if you want to ensure compatibility with older
298 interpreter versions that some players might still be using.)
299
300 <li>In the past, run-time error messages (e.g., "[TADS-1010: object
301 value required]") were omitted from the transcript. This was
302 particularly inconvenient for beta testing, since any errors
303 encountered by testers were invisible in their session logs. These
304 messages are now included in the transcript.
305 (<a href="http://bugdb.tads.org/view.php?id=0000032">bugdb.tads.org #0000032</a>)
306
307 </ul>
308
309
310 <!------------------------------------------------------------------------>
311 <br><br><hr>
312 <h3><a name='tads2511'>Version 2.5.11</a></h3>
313 <i>Released on August 9, 2008</i>
314
315 <ul>
316
317 <li>The parser now leaves the antecedent of "it" intact when a command
318 involves a number or string. That is, "it" will simply refer to the
319 noun phrase from the second-most-recent command when the most recent
320 command involves a number or string as its noun phrase: "x box; note
321 5; x it" will now treat the "it" in the last command as referring to
322 the box. In the past, the parser simply forgot any antecedent in this
323 type of situation. That was intentional, to avoid any confusion over
324 whether "it" should refer to the number or string, but in practice
325 players don't seem to find this confusing at all and expect "it" to
326 continue referring to the last real object.
327 (<a href="http://bugdb.tads.org/view.php?id=0000014">bugdb.tads.org #0000014</a>)
328
329 <li>The parser showed a somewhat confusing parser error message for
330 player commands of the form "verb x OF y" in some cases. If x and y
331 were valid nouns or adjectives, but the combination "x OF y" didn't
332 match any object's vocabulary (e.g., there's a BOX and some PAPER, but
333 there's no such object as BOX OF PAPER), the parser treated this
334 command as though it were a <i>two-object</i> verb, such as PUT IN or
335 LOCK WITH - that is, the OF was treated as a verb-phrase preposition,
336 and x and y were treated as (respectively) the direct and indirect
337 objects. This often resulted in the parser error "I don't recognize
338 that sentence," since OF is a rare preposition in verb phrases. For
339 example, EXAMINE BOX OF PAPER would be treated as an EXAMINE OF
340 command, which most games don't defined as a valid verb phrase. In
341 such cases, the parser now checks to see if it <i>could</i> have
342 formed a syntactically valid noun phrase from the whole "x OF y"
343 phrase, and if so, shows the more sensible error "I don't see any x of
344 y here."
345 (<a href="http://bugdb.tads.org/view.php?id=0000010">bugdb.tads.org #0000010</a>)
346
347 <li>If the game executed parserReplaceCommand() from within certain of
348 the "parser hook" functions, the interpreter displayed the run-time
349 error "TADS-1024: 'abort' statement executed". This happened because
350 of the way parserReplaceCommand() works internally, but it obviously
351 shouldn't result in an error message. This is now fixed.
352 (<a href="http://bugdb.tads.org/view.php?id=0000011">bugdb.tads.org #0000011</a>)
353
354 <li>The compiler's -p option (to make the compiler pause before
355 terminating, to give you a chance to read the output) didn't work
356 in some cases where an error occurred during compilation. This
357 has been fixed.
358 (<a href="http://bugdb.tads.org/view.php?id=0000015">bugdb.tads.org #0000015</a>)
359
360 </ul>
361
362 <!------------------------------------------------------------------------>
363 <br><br><hr>
364 <h3><a name='tads2510'>Version 2.5.10</a></h3>
365
366 <i>Released on August 17, 2006</i>
367
368 <ul>
369
370 <li>The INVENTORY TALL command now respects "quiet" containers and
371 surfaces (that is, the contents of these objects will not be listed in
372 the inventory). In the past, the default INVENTORY WIDE mode
373 respected the "quiet" flags, but TALL mode didn't. INVENTORY TALL
374 also now properly takes into account the "contentsVisible" settings of
375 the objects listed. These changes ensure that WIDE and TALL modes
376 yield the same information.
377
378 <li>In adv.t, the default message for TELL <i>thing</i> ABOUT
379 <i>topic</i> now properly takes into account the number (singular or
380 plural) of the thing, so the message will now change to "...are
381 interested" when the thing has a plural name. In the past, the text
382 always said "is interested," which was ungrammatical when the thing
383 had a plural name.
384
385 <li>A bug in the interpreter caused unpredictable behavior, sometimes
386 crashing the interpreter, when starting certain games, including
387 recent release <i>Finding Martin</i>. The problem was triggered by
388 a very large number of objects (more than about 150) in a single
389 location, so it didn't affect most games, and it appeared somewhat
390 sporadically even for games that did trigger it. The bug has now
391 been fixed.
392
393 <li>An interpreter bug caused delword() to occasionally and
394 unpredictably delete extra words beyond what it was actually
395 asked to delete. This has been corrected.
396
397 <li>In the past, if the player's answer to a disambiguation question
398 had certain kinds of syntax errors, the parser responded with a
399 suitable error message, but incorrectly showed that message twice in a
400 row. This was due to an interpreter bug, which has now been corrected.
401
402 <li>In adv.t, the messages for "the key doesn't fit" in
403 doorway.doLockWith and doorway.doUnlockWith were phrased incorrectly
404 in some cases (in particular, the subject and verb didn't always
405 agree). This has been corrected.
406
407 </ul>
408
409
410 <!------------------------------------------------------------------------>
411 <br><br><hr>
412 <h3><a name='tads259'>Version 2.5.9</a></h3>
413
414 <i>Released on September 12, 2004</i>
415
416 <ul>
417
418 <li>The "file safety" levels have changed slightly to provide better
419 security against malicious game programs. First, level 2, which
420 formerly provided global read access but no write access, now instead
421 provides read/write access to the current working directory only (the
422 game isn't allowed any access to files outside of the working
423 directory). Second, the default safety level is now level 2. In the
424 past, level 1 (read from any file/write to current directory only) was
425 the default, which left open the possibility that a game could access
426 data outside of the working directory. A malicious game could
427 conceivably have exploited this by, for example, secretly copying
428 sensitive data to the game directory for later use by a coordinating
429 network worm, or by encoding the data in a hyperlink (displayed in an
430 HTML-enabled game) that takes the player to a spyware site when
431 clicked. The new default setting should effectively eliminate these
432 risks by barring access to any files outside of the working directory.
433
434 <li>A bug in the compiler sometimes caused crashes when the "preinit"
435 function called certain built-in functions, particularly for file
436 manipulation. The problem was somewhat random, and tended to show up
437 on some machines and not others, because it depended on memory
438 conditions left over from other programs. The problem showed up for
439 several people when they included the "gameinfo.t" module in their
440 games, because that module writes a text file during preinit. The bug
441 has now been fixed.
442
443 <li>An interpreter bug was capable of corrupting list values during
444 game execution under very rare conditions. The bug only showed up
445 when assigning a value to an indexed element of a list (either
446 directly or via the "+=" or "-=" operators) at just the right moment
447 to trigger garbage collection, and only then when the list happened to
448 be situated in memory in just the right way. The bug was more likely
449 to occur with small "heap" memory settings (the "-mh" option); with
450 the large default heap of most current interpreters, the bug almost
451 never showed up. The bug was also quite unlikely to occur except in
452 games that perform unusually heavy list processing. The bug
453 manifested itself in unpredictable ways, ranging from spurious
454 run-time errors to interpreter crashes. This has now been fixed.
455 Note that most games that were likely to trigger the bug in the past
456 will now instead cause a "heap overflow" error; this error is valid,
457 and indicates that the game exhausted the available memory for
458 processing list and string values. If a heap overflow does occur
459 while running a game, try increasing the heap size using the "-mh"
460 command-line option when you run the game.
461
462 <li>An inconsistency in the command parser has been fixed. In the
463 past, the parser didn't properly take into account whether responses
464 to missing object prompts were singular or plural. This caused some
465 subtle differences between typing a full command and piecing a command
466 together with missing object prompts. In particular, the parser
467 didn't announce the object names for a plural response, and didn't
468 check rejectMultiDobj. This has been fixed, so the parser's behavior
469 is now consistent for missing object responses.
470
471 <li>In the past, the parser incorrectly treated THEM as plural even
472 when it referred to only one object, so it checked with
473 rejectMultiDobj in these cases. This is undesirable in some cases,
474 especially when the single object being referred to is an object whose
475 name has plural usage. The parser now treats THEM as singular when it
476 refers to just one object.
477
478 </ul>
479
480 <!------------------------------------------------------------------------>
481 <br><br><hr>
482 <h3><a name='tads258'>Version 2.5.8</a></h3>
483
484 <i>Released on June 12, 2004</i>
485
486 <ul>
487
488 <li>In adv.t, THROW AT now uses a new method, throwHitDest, to
489 determine where the thrown object lands. This method is called for
490 the actor's current location; by default, it simply returns 'self', so
491 a thrown object simply lands in the actor's current location. This is
492 the same behavior as in the past. However, the special 'theFloor'
493 object overrides this to return the current room. This corrects a
494 problem that occurred when the player sat on the floor and then threw
495 something: because the object formerly ended up in the actor's
496 location, the object landed in the 'theFloor' object, at which point
497 the object became inaccessible. This change ensures that a thrown
498 object will never be moved into 'theFloor', but will always land in
499 the actor's actual room location. As a side benefit, the new method
500 also makes it possible to customize the location where objects land
501 when thrown from within a nested room.
502
503 <li>When running in HTML mode, the default parser error message 1 ("I
504 don't understand the punctuation %c") now includes an "\H-" sequence
505 before the message to ensure that the unrecognized character is
506 displayed literally if it's an HTML markup-significant character
507 (such as '&lt;' or '&amp;'). It also shows an "\H+" sequence after
508 the message to restore HTML mode. In the past, if the player entered
509 a markup-significant character while the interpreter was in HTML
510 mode, the HTML parser could become momentarily confused, leading to
511 strange output.
512
513 <li>The new parser hook parseDefaultExt() extends the parseDefault()
514 function. The new function takes two additional parameters, giving
515 the actor and deepverb object involved in the command; the new
516 parameter list is parseDefaultExt(actor, verb, obj, prp). If the game
517 defines parseDefaultExt(), then the interpreter ignores parseDefault()
518 and calls parseDefaultExt() instead. If the game does not define
519 parseDefaultExt(), but does define parseDefault(), the interpreter
520 uses parseDefault() as it used to, which ensures that existing games
521 will continue to run unchanged. You can use the new extended version
522 of the function if you need the actor and/or verb information in
523 displaying the default object message; this is useful in some
524 non-English languages where a default object name's noun phrase must
525 be inflected according to its usage in the command.
526
527 <li>The new parser hook preparseExt() allows the game to inspect and
528 optionally change text the player types in response to parser
529 questions: disambiguation queries, requests for missing direct or
530 indirect objects, and OOPS typo-correction opportunities. The new
531 function's parameter list is preparseExt(actor, verb, str, typ), where
532 'actor' is the actor performing the command, 'verb' is the deepverb
533 object, 'str' is a string containing the exact text the player typed
534 in, and 'typ' is an integer giving the type of query the player is
535 responding to. The meaning of 'typ' is the same as the that of the
536 type codes passed to commandPrompt() and commandAfterRead(). The
537 function can return a new string, which the parser will use to replace
538 the text the user typed; true, to proceed with the original text the
539 user typed; or nil, to treat the user's text as a brand new command,
540 bypassing the special interpretation as a response to the parser's
541 question. The game doesn't have to define the preparseExt() function;
542 it's purely optional, so existing games will not be affected.
543
544 <li>When the interpreter looks for external resource bundles (*.rsN files),
545 it now looks for the files using lower-case <i>and</i> upper-case suffixes
546 (in other words, it looks for both *.rs0 and *.RS0, and likewise for digits
547 1-9). Lower-case suffixes are tried first, then upper-case. This change
548 makes the naming system more flexible on systems with case-sensitive
549 file systems, such as Unix; for systems such as Windows and Macintosh that
550 have case-insensitive file systems, this change will have no effect.
551
552 <li>A bug in the parser made it impossible to use numeric adjectives
553 in certain phrasings. In particular, if a given word was defined in
554 a game as both a noun and an adjective, but the word was defined only as
555 a noun for a given object that takes a numeric adjective, then the
556 phrasing <i>noun</i> <i>number</i> didn't match the object. For example,
557 if the word "switch" was defined as a noun for a given numbered switch,
558 but "switch" was defined as an adjective for some other object, then
559 "switch 5" didn't match the switch even if "5 switch" did. This has
560 been corrected.
561
562 <li>The compiler now checks for missing symbols before running the
563 'preinit' function, and skips running preinit if any symbols are
564 undefined. In the past, the compiler called preinit even if some
565 symbols were undefined; if preinit itself called any undefined
566 functions or invoked methods of undefined objects, this sometimes
567 led to misleading error messages. The compiler will now simply
568 point out the missing symbols, and skip running preinit entirely.
569
570 <li>The compiler now allows filenames up to 255 characters to appear
571 in the source file names in debugging records. In the past, the limit
572 was 127 characters. <b>Important note:</b> due to a bug, older
573 interpreters cannot properly handle .gam files compiled with debugging
574 information with path names over 127 characters. Attempting to load
575 .gam files with debugging information containing long source file
576 names will cause unpredictable results. Since some users might still
577 have older interpreter versions, <b>we strongly advise against
578 releasing games compiled with debugging information</b>. That is, you
579 should never release a game that you compiled with the "-ds" or "-ds2"
580 options.
581
582 <li>In the past, if the game code called a function or method, using
583 the return value of another function or method as an argument, and the
584 other function or method didn't actually return any value for the
585 argument, the results were unpredictable; in some cases, this even
586 caused the interpreter to crash. The interpreter is now more careful
587 about checking for these cases; when they occur, the interpreter now
588 automatically adds 'nil' values for the missing arguments. This
589 should ensure that errant code won't crash the interpreter, without
590 breaking any existing code with "asymptomatic" instances of this
591 error.
592
593 <li>The default "file safety level" for the command-line interpreters
594 is now set to 1, which allows reading files from anywhere on the disk,
595 but allows writing files only to the current working directory. This
596 protects against malicious game authors attempting, for example, to
597 modify your operating system's files. You can manually override this
598 to use a more permissive or more protective level using the "-s" option.
599
600 <li>External functions are now obsolete and can no longer be used on
601 any platform. One of the nice things about running games with a
602 system like TADS is that you don't have to worry as much about
603 viruses and other malicious code when playing downloaded games, since
604 games run in the interpreter environment rather than as native code.
605 The external function feature made it possible for games to call out
606 to native code, though, so a malicious author could have used
607 external functions to do damage to a user's system. Removing this
608 feature eliminates this security loophole. External functions were
609 only supported on a few platforms to start with, and they never
610 caught on with authors, probably because they were difficult to use
611 and had serious drawbacks (such as complete unportability). Since no
612 one has ever had much use for this feature, and because of the
613 potential security vulnerability, we've decided that there's no
614 reason to keep it around.
615
616 <li>In the past, the compiler did not accept 'self' as an element in a
617 list, even in contexts where 'self' was otherwise valid. The compiler
618 now does accept 'self' as a list element in method contexts.
619
620 <li>A bug in the interpreter sometimes made the result of the
621 subtract-and-assign operator ("-=") incorrect under certain
622 circumstances: specifically, the problem occurred when the left-hand
623 side was a local variable, the local variable contained a list value,
624 and the list value did <i>not</i> contain the value on the right-hand
625 side of the operator. In some such cases, a run-time error occurred;
626 in some others, the wrong value was assigned to the local variable.
627 This has been corrected; when the value on the right side is not in
628 the list, the list value in the local is simply left unchanged.
629
630 <li>Due to a bug, the compiler sometimes crashed if you used a "break"
631 and "continue" statement in an invalid context (i.e., outside of a
632 "while", "for", "do", or, in the case of "break", a "switch"
633 statement). This has been corrected; the compiler now simply flags
634 these as errors, but shouldn't crash.
635
636 </ul>
637
638
639 <!------------------------------------------------------------------------>
640 <br><br><hr>
641 <h3><a name='tads257'>Version 2.5.7</a></h3>
642
643 <i>Released on September 22, 2002</i>
644
645 <ul>
646
647 <li>The new system information code __SYSINFO_INTERP_CLASS returns
648 information on the "class" of interpreter currently running. This
649 returns one of the following codes:
650
651 <ul>
652 <li>__SYSINFO_IC_TEXT: a text-only, character-mode interpreter,
653 such as an MS-DOS or Unix interpreter. These interpreters use
654 a single, fixed-pitch font, and support the text-only HTML subset.
655
656 <li>__SYSINFO_IC_TEXTGUI: a text-only interpreter on a graphical
657 platform, such as MacTADS or WinTADS. These interpreters behave
658 essentially identically to character-mode text-only interpreters,
659 so from the game program's perspective there is no practical
660 difference between this and character-mode interpreters.
661
662 <li>__SYSINFO_IC_HTML: a full HTML-enabled interpreter on a
663 graphical platform, such as HTML TADS on Windows or HyperTADS on
664 Macintosh. These interpreters can display text and graphics,
665 use multiple fonts, and interpret the full HTML TADS markup language.
666 </ul>
667
668 <li>The travel system in adv.t has been enhanced slightly to allow
669 rooms to differentiate their travel behavior for travel by the player
670 character vs. travel by non-player characters. The new properties
671 actorNorth, actorSouth, actorEast, actorWest, actorNE, actorNW,
672 actorSE, actorSW, actorUp, actorDown, actorIn, and actorOut are now
673 called when an NPC attempts travel; these properties correspond to the
674 traditional properties north, south, east, west, and so on, and the
675 only difference is that the new properties are called when NPC's
676 travel. The traditional properties are still called for all player
677 character travel. By default, each of the new actorXxx properties
678 simply returns the value of the corresponding traditional property: so
679 actorNorth by default simply returns the value of (self.north). This
680 means that if you don't want to differentiate NPC travel from PC
681 travel, you need do nothing at all; but if you want a particular
682 travel direction from a particular room to work differently for
683 an NPC than it does for the player character, you simply need to
684 override actorNorth (or whichever direction you want to customize)
685 in that location. Thanks to Tommy Nordgren for suggesting this
686 enhancement.
687
688 </ul>
689
690 <!------------------------------------------------------------------------>
691 <br><br><hr>
692 <h3><a name='tads256'>Version 2.5.6</a></h3>
693
694 <i>Released on June 1, 2002</i>
695
696 <ul>
697
698 <li>The new system information code __SYSINFO_TEXT_COLORS tests for
699 text color support. Currently, only the HTML interpreters support
700 text colors; the text-only interpreters have no text color support.
701 The return value indicates the level of support available:
702
703 <ul>
704 <li>0/nil - no text color support
705 <li>1 - parameterized color names only (TEXT, STATUSTEXT, etc.)
706 <li>2 - the eight ANSI colors (white, black, red, blue, green,
707 yellow, magenta, cyan) are supported for the text
708 foreground color, but the background color cannot be set
709 <li>3 - the eight ANSI colors are supported for text foreground
710 and background colors
711 <li>4 - full RGB colors are supported, foreground and background
712 (the HTML interpreters generally return this code)
713 </ul>
714
715 <li>The new system information code __SYSINFO_TEXT_HILITE tests for
716 text highlighting support. This returns 1 if the interpreter is
717 capable of rendering highlighted text (i.e., text within "\( \)"
718 sequences, or text in HTML &lt;B&gt; sequences) with a distinctive
719 appearance, 0 or nil if not. Most interpreters are capable of
720 showing highlighting, except when running in "plain" mode or when
721 using a terminal or display device that has no ability to show
722 different text colors or styles.
723
724 <li>The new system information code __SYSINFO_OGG tests for Ogg Vorbis
725 audio format support. systemInfo(__SYSINFO_OGG) returns 1 if the Ogg
726 Vorbis format is supported by the interpreter, 0 if not.
727
728 <li>The new system information codes __SYSINFO_MNG, __SYSINFO_MNG_TRANS,
729 and __SYSINFO_MNG_ALPHA test for basic MNG (animated image) suport,
730 MNG transparency support, and MNG alpha-channel support, respectively.
731 These are analogous in meaning to the PNG information codes.
732
733 <li>The interpreter now includes the name of the external resource
734 (.rsn) file in error messages that result from errors reading these
735 files. In the past, the interpreter did not indicate which specific
736 file was causing the problem, which made it difficult to track down
737 where the problem was. (The non-specific error message worked fine
738 in the days before external resource files, when everything was
739 always in the single .gam file, but the new, more specific diagnostic
740 information is important now that a game's resources can be put in
741 several separate files.)
742
743 <li>In adv.t, <tt>basicMe.moveInto(room)</tt> now calls a new method,
744 <tt>room.meIsMovingInto(self)</tt>, whenever the <tt>basicMe</tt> object being
745 moved is the current player character (i.e., <tt>self</tt> is the object that
746 <tt>parserGetMe()</tt> returns). A default implementation of
747 <tt>meIsMovingInto(meActor)</tt> has been added to <tt>room</tt>;
748 this default implementation does nothing. Finally, an overriding
749 implementation of <tt>meIsMovingInto(meActor)</tt> has been added
750 to <tt>theFloor</tt>; this implementation sets <tt>theFloor.sitloc</tt>
751 to the player character actor's previous location. The purpose of all
752 of this new mechanism is to ensure that <tt>theFloor.sitloc</tt> is
753 properly set to the player character's prior location whenever the
754 player character is explicitly moved into <tt>theFloor</tt>. In the
755 past, <tt>theFloor.sitloc</tt> was set whenever the player character
756 moved to <tt>theFloor</tt> via a "sit on the floor" command from the
757 player, but wasn't set when the object was moved to <tt>theFloor</tt>
758 through other means. The <tt>theFloor</tt> object uses the <tt>sitloc</tt>
759 property to remember the location that originally contained the actor
760 before sitting on the floor; this is needed because <tt>theFloor</tt>
761 is a floating item and thus doesn't have an actual location of its own.
762
763 <li>In adv.t, the various <tt>hider</tt> subclasses (<tt>underHider</tt>,
764 <tt>searchHider</tt>, <tt>behindHider</tt>) now check to see if they
765 were never hiding anything to start with, and issue an appropriate
766 message if so. In the past, if an object was defined using one of
767 the <tt>hider</tt> subclasses, but no other object was ever hidden
768 inside the <tt>hider</tt>, looking in/under/behind the object generated
769 an erroneous message, of the form "You find , which you take." Now,
770 when the list of hidden objects is initially empty, the generated
771 message is simply "You find nothing under (the object)."
772
773 <li>The <tt>parserDictLookup()</tt> function can now be called
774 from within <tt>init()</tt>. In the past, this function caused
775 a run-time error if called while <tt>init()</tt> was running; this
776 has been corrected.
777
778 <li>Fixed a problem in parserGetObj(PO_ACTOR) that caused the incorrect
779 actor to be reported between the time <tt>preinit</tt> was called and
780 the time <tt>preCommand</tt> was called. During this window, if a
781 command was the first command on a new command line, and the command
782 line didn't start with a target actor ("bob, ..."), then
783 parserGetObj(PO_ACTOR) incorrectly returned the actor from the
784 previous command. This no longer occurs; the function now correctly
785 returns the current "me" object in such cases.
786
787 <li>Fixed a problem in the output formatter that caused problems
788 with displaying a series of quoted spaces ('\ ' sequences) in some
789 situations, especially on platforms with proportionally-spaced
790 display fonts such as the Mac. This has been corrected.
791
792 <li>The compiler no longer treats any characters in the "extended"
793 character set (i.e., characters with character codes outside the
794 ASCII range 0 to 127) as whitespace. In the past, the compiler on
795 some platforms treated certain extended characters as spaces, which
796 sometimes caused problems for authors working in non-English
797 languages. The compiler has no knowledge of the attributes of any
798 localized character sets (the compiler's character set translation
799 mechanism does not provide attribute information, only set-to-set
800 mapping information), so it was incorrect of the compiler to assume
801 anything about which extended characters represented whitespace
802 characters. This problem manifested itself most apparently when
803 a string containing extended characters spanned several lines of
804 source; if the compiler mistook any of the leading characters on
805 continuation lines for whitespace, it would remove them, resulting
806 in incorrect text displayed at run-time. This has been corrected;
807 the compiler now treats all extended characters as non-whitespace
808 characters.
809
810 <li>Fixed a problem in the <tt>execCommand()</tt> built-in function
811 that caused various problems ranging from data value corruptions to
812 interpreter crashes. The problem appeared when <tt>execCommand</tt>
813 was used to execute a command that terminated with an <tt>exit</tt> or
814 <tt>abort</tt>, and then only when certain combinations of operations
815 on local variables followed. The problem has been corrected.
816
817 <li>Fixed a compiler bug that caused an infinite loop when parsing
818 certain nested <tt>switch</tt> statements. A <tt>switch</tt> containing
819 string constant <tt>case</tt> labels nested within another <tt>switch</tt>
820 with string constant <tt>case</tt> labels sporadically caused this
821 problem. This has been corrected.
822
823 <li>Fixed a problem in the compiler that caused the <tt>contents</tt>
824 lists of objects to be initialized improperly in certain cases. In
825 particular, if an object's <tt>contents</tt> list was used during
826 execution of the <tt>preinit</tt> function, any object that inherited
827 a <tt>location</tt> value equal to the given object was omitted from
828 the given object's <tt>contents</tt> list, when clearly the object
829 should have been included in the list. This only affected
830 <tt>preinit</tt>, and then only when a <tt>contents</tt> that should
831 have contained an object with an inherited location was referenced
832 from within the <tt>preinit</tt> function. This has been corrected;
833 inherited <tt>location</tt> values are now properly handled when
834 <tt>preinit</tt> is executing.
835
836 <li>The compiler and interpreter must sometimes create temporary
837 files for internal memory management purposes. On certain systems
838 (in particular, DOS, Windows, and Unix), TADS determines a suitable
839 directory location to store any needed temporary files by looking in
840 the environment for variables called TEMPDIR, TMPDIR, TEMP, and TMP
841 (in that order), and using the value of the first such variable it
842 finds as the temporary directory path. In past versions, if the path
843 found in this manner was invalid, the interpreter or compiler would
844 usually terminate with an error message that wasn't very helpful in
845 tracking down the problem. In most cases, the error message was
846 "unable to open swap file." This has been changed; now, if the
847 temporary path obtained from the environment variables is invalid,
848 TADS ignores the path and simply creates any necessary temporary
849 files in the current working directory.
850
851 <li>A number of messages in adv.t now use format strings ("%you%" and
852 the like) where they didn't before but should have, to facilitate
853 games written in styles other than second-person. Thanks go to
854 Bennett Standeven for catching these.
855
856 <li>Fixed a problem that caused interpreter crashes under rare
857 circumstances for interpreters that could play more than one game in
858 a single session (such as the HTML TADS interpreter). If the
859 interpreter loaded a game that used the "output filter function"
860 feature, and then that game was terminated and another game was
861 loaded into the same interpreter session, and the new game didn't use
862 its own output filter function, results were unpredictable, and
863 interpreter crashes sometimes occurred. This has been corrected.
864 (This problem did not affect most platforms, because most
865 interpreters terminate when the game being executed terminates.)
866
867 <li>Fixed an interpreter problem that caused the "<tt>new</tt>"
868 operator to generate a run-time error in some unusual situations.
869 In particular, if the constructor modified a property of the
870 object containing the method that invoked the <tt>new</tt>
871 operator (directly in its own code, or in any code it invoked),
872 then the error "TADS-5: attempting to reallocate a locked object"
873 appeared sporadically. This has been corrected.
874
875 </ul>
876
877 <!------------------------------------------------------------------------>
878 <br><br><hr>
879 <h3><a name='tads255'>Version 2.5.5</a></h3>
880
881 <i>Released on September 27, 2000</i>
882
883 <ul>
884
885 <li>In adv.t, a comment in listcontgen() has been fixed to reflect
886 that it's actually part of the "tall" listing rather than the "wide"
887 listing.
888
889 <li>In adv.t, in moveableActor.travelTo, if the actor's previous
890 location was nil, a run-time error occurred. This has been corrected.
891
892 <li>In adv.t, in thing.thatdesc, the plural form has been changed to
893 display "those" rather than "them"; this provides a better parallel to
894 the singular display ("that").
895
896 </ul>
897
898 <!------------------------------------------------------------------------>
899 <br><br><hr>
900 <h3><a name='tads254'>Version 2.5.4</a></h3>
901
902 <i>Released on June 17, 2000</i>
903
904 <h4>New systemInfo() flags for PNG transparency</h4>
905
906 <p>Two new systemInfo() flags have been added to test for support of
907 certain features of the PNG image format:
908
909 <ul>
910
911 <li>__SYSINFO_PNG_TRANS: tests for PNG transparency support. Some
912 newer versions of the HTML interpreter support PNG transparency,
913 which allows parts of a PNG image to be designated as transparent so
914 that the background shows through. systemInfo(__SYSINFO_PNG_TRANS)
915 returns true if transparency is supported when displaying PNG images,
916 nil if not. This will never return true under interpreters that don't
917 support PNG images at all. Note that this flag indicates only <i>simple</i>
918 transparency support, which allows pixels to be designated as fully
919 opaque or fully transparent, and does not imply support of full alpha
920 blending; some interpreters (such as the Windows
921 HTML interpreter 2.5.4) support only simple transparency but not
922 alpha blending.
923
924 <li>__SYSINFO_PNG_ALPHA: tests for PNG "alpha blending" support, which
925 allows individual pixels of a PNG image to be designated as partially
926 transparent. Currently, none of the interpreters support alpha blending
927 in PNG images; this flag has been added for possible future use.
928
929 </ul>
930
931 <h4>Bug Fixes</h4>
932
933 <ul>
934
935 <li>A bug in the compiler caused a crash under certain unusual conditions
936 when the program defined a symbol as an object, and the symbol
937 was already defined as a property or function. Most of the time, the
938 compiler reported an error ("redefining symbol as object"), but in some
939 cases the compiler crashed. This has been corrected.
940
941 </ul>
942
943
944 <br><br><hr>
945 <h3><a name='tads253'>Version 2.5.3</a></h3>
946
947 <i>Released on April 16, 2000</i>
948
949 <p>This version contains no changes to text-only versions of TADS; the
950 only changes are in HTML versions.
951
952 <br><br><hr>
953 <h3><a name='tads252'>Version 2.5.2</a></h3>
954
955 <i>Released on March 27, 2000</i>
956
957 <h4>Index of Changes</h4>
958
959 <ul>
960 <li><a href='#isThem'>Parser recognizes isThem</a>
961 <li><a href='#scoreFormat'>New scoreFormat() Function</a>
962 <li><a href='#sysinfo252'>New systemInfo() Capability Codes</a>
963 <li><a href='#bugs252'>Bugs Fixed</a>
964 </ul>
965
966 <a name='isThem'></a>
967 <h4>Parser recognizes isThem</h4>
968
969 <p>
970 The parser now recognizes the <tt>isThem</tt> property for the purposes
971 of deciding on the pronoun to display when prompting for an indirect
972 object. In the past, the parser only recognized the <tt>isHim</tt>
973 and <tt>isHer</tt> properties, and used the pronoun "it" if neither of
974 these properties were consistently defined for the objects matching the
975 direct object. The parser now uses the pronoun "them" if the matching
976 objects all have <tt>isThem</tt> set to <tt>true</tt>.
977
978 <p>
979 For example:
980
981 <p><pre>
982 &gt;throw pants
983 What do you want to throw them at?
984 </pre>
985
986 <a name='scoreFormat'></a>
987 <h4>New <tt>scoreFormat()</tt> Function</h4>
988
989 <p>
990 The way that adv.t displays the status line has been changed slightly
991 to simplify coding of special formats. A new function,
992 <tt>scoreFormat()</tt>, is now responsible for formatting the string
993 to display in the right half of the status line. <tt>scoreFormat()</tt>
994 takes the current score and the current turn counter as arguments, and
995 returns a string to display in the right half of the status line. The
996 default implementation in adv.t simply returns a string consisting of
997 the score, a slash ("/"), and the turn count, which provides the same
998 format that adv.t has traditionally used for the status line.
999
1000 <p>
1001 The existing function
1002 <tt>scoreStatus()</tt> now calls <tt>scoreFormat()</tt> to generate the
1003 display. In addition, the code in <tt>room.statusLine</tt> that generates
1004 the HTML version of the status line now calls <tt>scoreFormat()</tt> as
1005 well. This makes <tt>scoreFormat()</tt> the single point in adv.t where
1006 the right half of the status line is formatted.
1007
1008 <p>
1009 The advantage of this new mechanism is that you can customize the display
1010 of the right half of the status line for both text-only and HTML-enabled
1011 games simply by replacing the <tt>scoreFormat()</tt> function.
1012
1013 <p>
1014 Of course, HTML-enabled games are not limited to using the traditional
1015 status line display; if you want a completely custom status line display
1016 when running under an HTML-enabled interpreter, you can replace adv.t's
1017 <tt>room.statusLine</tt> and generate your own &lt;BANNER&gt; display.
1018 The new <tt>scoreFormat()</tt> mechanism, however, is convenient when
1019 you simply want to customize the right half of the status line, but still
1020 use the traditional single-line status format.
1021
1022
1023 <a name='sysinfo252'></a>
1024 <h4>New <tt>systemInfo()</tt> Capability Codes</h4>
1025
1026 <p>
1027 The <tt>systemInfo()</tt> function accepts several new capability
1028 codes that let you discover whether the system is capable of following
1029 URL-style &lt;A HREF&gt; hypertext links in HTML-formatted text.
1030 The new codes are:
1031
1032 <p>
1033 <ul>
1034 <li><tt>__SYSINFO_LINKS_HTTP</tt> - checks if the system can follow
1035 HTTP links to display web pages. HTTP URL's start with "<tt>http:</tt>".
1036
1037 <li><tt>__SYSINFO_LINKS_FTP</tt> - determines if the system can follow
1038 FTP links, which start with "<tt>ftp:</tt>".
1039
1040 <li><tt>__SYSINFO_LINKS_NEWS</tt> - determines if the system can follow
1041 news links to Usenet newsgroups, which start with "<tt>news:</tt>".
1042
1043 <li><tt>__SYSINFO_LINKS_MAILTO</tt> - determines if the system can follow
1044 mail links to send email; these links start with "<tt>mailto:</tt>".
1045
1046 <li><tt>__SYSINFO_LINKS_TELNET</tt> - checks if the system can follow
1047 telnet links, which start with "<tt>telnet:</tt>".
1048 </ul>
1049
1050 <p>For example, suppose you want to display a link to a web page you've
1051 created for your game, so that players can check for updates and hints
1052 on your web site. You can use <tt>__SYSINFO_LINKS_HTTP</tt> to check the
1053 user's TADS interpreter for HTTP link capability; if the interpreter can
1054 follow HTTP links, you can show your link with a friendly display, and
1055 fall back on spelling out the URL when the interpreter can't directly
1056 follow the link.
1057
1058 <pre>
1059 "You can check for updates to this game at ";
1060 if (systemInfo(__SYSINFO_LINKS_HTTP))
1061 "&lt;A HREF='http://www.mysite.com/mygame.htm'&gt;my web site&lt;/A&gt;";
1062 else
1063 "my web site (http://www.mysite.com/mygame.htm)"
1064 ". This site also has hints and some background
1065 information about the game. ";
1066 </pre>
1067
1068
1069 <a name='bugs252'></a>
1070 <h4>Bugs Fixed</h4>
1071
1072 <ul>
1073
1074 <li>For a verb defined with the <tt>[disambigDobjFirst]</tt> flag, the
1075 parser called the indirect object's <tt>verIo<i>Verb</i></tt> method
1076 incorrectly in cases where the player omitted an indirect object,
1077 causing the parser to try to find a default indirect object. For
1078 example, suppose you were to make the following definitions:
1079
1080 <p><pre>
1081 waveVerb: deepverb
1082 verb='wave'
1083 sdesc="wave"
1084 prepDefault = atPrep
1085 ioAction(atPrep) = [disambigDobjFirst] 'WaveAt'
1086 ;
1087 modify thing
1088 verDoWaveAt(actor) = {}
1089 verIoWaveAt(actor, dobj) = {}
1090 ioWaveAt(actor, dobj) = { "Nothing special happens. "; }
1091 ;
1092 </pre>
1093 <p>
1094 In the past, if you typed a "wave" command with no indirect object, as
1095 in "wave flag," the parser incorrectly invoked the <tt>verIoWaveAt</tt>
1096 method with only one argument, causing a run-time error. This no
1097 longer occurs; the parser consistently calls the <tt>verIo<i>Verb</i></tt>
1098 method in these cases with the correct number of arguments.
1099
1100 <li>In past versions, the <tt>parserTokenize()</tt> built-in function
1101 did not work properly when the input text contained a quoted string;
1102 in particular, the text of the quoted string was not included in the
1103 list. This has been corrected; the tokenized list now correctly
1104 includes the quoted string, enclosed in double quote marks (following
1105 the same rules as <tt>preparseCmd()</tt>). The same problem affected
1106 the token list passed to <tt>parseUnknownVerb()</tt>; this has been
1107 corrected as well.
1108
1109 <li>If the <tt>preparse()</tt> or <tt>preparseCmd()</tt> functions
1110 executed an <tt>exit</tt>, <tt>exitobj</tt>, or <tt>abort</tt>, the
1111 interpreter displayed an error message (such as "'abort' statement
1112 executed"). This was mostly harmless; these types of statements
1113 are generally not needed within <tt>preparse()</tt> and
1114 <tt>preparseCmd()</tt>, because these functions use return codes rather
1115 than <tt>exit</tt> and the like to control further processing.
1116 However, certain built-in functions perform <tt>abort</tt> operations
1117 implicitly; in particular, the <tt>parserReplaceCommand()</tt> function
1118 uses <tt>abort</tt> to start processing the new command immediately.
1119 To enable the use of such built-ins in <tt>preparse()</tt> and
1120 <tt>preparseCmd()</tt>, the interpreter no longer displays an error
1121 message when <tt>exit</tt>, <tt>exitobj</tt>, or <tt>abort</tt> are
1122 used in these user functions.
1123
1124 <li>In the past, the <tt>parserResolveObjects()</tt> built-in
1125 function did not correctly handle unknown words; in particular, the
1126 function did not display any message if the noun phrase contained an
1127 unknown word, even when the "silent" parameter was nil. This has
1128 been corrected. Now, when "silent" is nil, the function handles
1129 unknown words by displaying the normal error message ("I don't know
1130 the word..."), then prompting the player for a new command. If
1131 the player responds with "oops" (or "o") followed by another word,
1132 the function returns the new result code <tt>PRSERR_OOPS_UPDATE</tt>,
1133 with the corrected version of the noun phrase string as the second
1134 element. Refer to the <i>Parser Manual</i> for details.
1135
1136 <li>A problematic interaction between <tt>parseUnknownVerb()</tt>,
1137 and <tt>parserReplaceCommand()</tt> has been corrected. In the past,
1138 if <tt>parserReplaceCommand()</tt> was used within the
1139 <tt>parseUnknownVerb()</tt> function, and the parser called
1140 <tt>parseUnknownVerb()</tt> because of an unknown word in the command,
1141 the parser incorrectly deferred processing the replacement command
1142 until after checking to see if the player tried to use OOPS to correct
1143 the unknown word. This is undesirable, because in this case the game
1144 has already provided the replacement command, so there is no reason to
1145 give the player a chance to use OOPS. This has been corrected.
1146
1147 <li>Due to a bug, the parser did not correctly set the
1148 <tt>PRSFLG_ENDADJ</tt> flag for some objects when calling the
1149 <tt>disambigDobj</tt> and <tt>disambigIobj</tt> methods. The parser
1150 omitted the flag when a noun phrase ended in an adjective, and the
1151 vocabulary word involved was <i>only</i> defined as an adjective (in
1152 other words, the word was never defined as a noun or plural for any
1153 object in the entire game). This has been corrected. (Thanks to
1154 Amir Karger for helping to track down this problem.)
1155
1156 <li>A parser bug caused a strange response message in certain cases.
1157 If the player answered a disambiguation question with a special word
1158 (such as "it" or "her"), the parser displayed a
1159 <tt>preparse</tt>-style special word code in the response, as in "I
1160 don't see any R book here." This has been corrected; the parser now
1161 displays an improved message ("I don't see any such book here").
1162
1163 <li>A bug in the compiler caused a crash under certain obscure
1164 circumstances. If a symbol was defined as a property or an object,
1165 and then later in the source code a function definition appeared using
1166 the same symbol name, the compiler sometimes crashed. This has been
1167 corrected.
1168
1169 <li>A compiler bug caused the incorrect method to be called at
1170 run-time in a certain situation. If code in an object used
1171 <tt>pass</tt> or <tt>inherited</tt> to inherit code in a base
1172 class, and the base class was an object that had been
1173 modified with the <tt>modify</tt> keyword, and the method
1174 being inherited had been replaced with the <tt>replace</tt> keyword
1175 within the modifying class, the system did not correctly call the
1176 replaced version of the method. This has been corrected.
1177
1178 <li>In past versions, the compiler accepted a <tt>case</tt> label in
1179 a <tt>switch</tt> statement with <tt>self</tt> as the value. Since
1180 <tt>self</tt> is not a constant, this type of <tt>case</tt> label has
1181 never been legal, and at run-time the code after the "<tt>case
1182 self:</tt>" label was never executed; however, the compiler should
1183 not have accepted the construct in the first place. The compiler now
1184 displays an error when it encounters a "<tt>case self:</tt>" label in
1185 a <tt>switch</tt> statement.
1186
1187 <li>In the <tt>basicMe</tt> class in adv.t, the <tt>ioGiveTo</tt>
1188 method generated an incorrect message. This has been corrected.
1189
1190 <li>The inventory listing code in adv.t (in the <tt>iVerb</tt>
1191 object) produced an incorrect display ("You are carrying.") when the
1192 player character was carrying only items marked as unlistable
1193 (<tt>isListed = nil</tt>). This has been corrected.
1194
1195 <li>The <tt>thing</tt> class in adv.t now has default verification
1196 methods for the verbs "attach x to y," "detach x," and "detach x from y."
1197 These default verification methods each simply display the message "There's
1198 no obvious way to do that."
1199
1200 <li>In the past, the text-only interpreter did not correctly suppress
1201 certain markup sequences (in particular, BR, TAB, and HR) that appeared
1202 within &lt;TITLE&gt; and &lt;ABOUTBOX&gt; tags. All text, including
1203 these markups, is now properly suppressed within TITLE and ABOUTBOX
1204 sequences.
1205
1206
1207 </ul>
1208
1209
1210 <br><br><hr>
1211 <h3><a name='tads251'>Version 2.5.1</a></h3>
1212
1213 <i>Released on September 21, 1999</i>
1214
1215 <h4>Index of Changes</h4>
1216
1217 <ul>
1218 <li><a href='#parseAskobjIndirect'>New Parser Hook: parseAskobjIndirect()</a>
1219 <li><a href='#prefixdesc'>New Parser Hook: prefixdesc</a>
1220 <li><a href='#resourceExists'>New built-in function: resourceExists()</a>
1221 <li><a href='#newDefined'>New defined() Codes</a>
1222 <li><a href='#newParserGetObj'>New parserGetObj() Codes</a>
1223 <li><a href='#rscUrl'>Filename-to-URL Conversions in tadsrsc</a>
1224 <li><a href='#cantReachMulti'>cantReach with Multiple Objects</a>
1225 <li><a href='#inputkey251'>Changes to inputkey()</a>
1226 <li><a href='#adv251'>Changes to adv.t</a>
1227 <li><a href='#bugs251'>Bugs Fixed</a>
1228 </ul>
1229
1230 <h4><a name='parseAskobjIndirect'>
1231 New Parser Hook: <tt>parseAskobjIndirect</tt></a></h4>
1232
1233 <p>
1234 A new parser hook, named <tt>parseAskobjIndirect()</tt>, has been added
1235 to provide more control over the message that the parser uses to ask
1236 the player to supply an indirect object when none is provided in the
1237 command but the verb requires one. This new function supplements the
1238 existing <tt>parseAskobj()</tt> and <tt>parseAskobjActor()</tt>
1239 functions.
1240
1241 <p>
1242 Refer to the <i>TADS Parser Manual</i> (version 2.5.1) for details
1243 on this new parser hook.
1244
1245
1246 <h4><a name='prefixdesc'>
1247 New Parser Hook: <tt>prefixdesc</tt></a></h4>
1248
1249 <p>
1250 The parser now calls a new method, called <tt>prefixdesc</tt>, to
1251 display the object name prefix that comes before the execution results for
1252 each object in a command with multiple direct objects. This new
1253 method effectively replaces the existing <tt>multisdesc</tt> mechanism.
1254 Refer to the <i>TADS Parser Manual</i> (version 2.5.1) for details
1255 on this new parser hook.
1256
1257 <h4><a name='resourceExists'>
1258 New built-in function: <tt>resourceExists()</tt></a></h4>
1259
1260 <p>
1261 A new built-in function, <tt>resourceExists()</tt>, allows you to determine
1262 whether a named resource (such as a JPEG image or an MP3 audio file) can
1263 be loaded. This function takes as its single argument a string giving the
1264 name of a resource to find; the function returns true if the resource can
1265 be loaded, nil if not. The function returns nil if the interpreter is
1266 simply not capable of loading resources at all (the text-only interpreters
1267 thus always return nil for this function), or if the resource can't be
1268 found. The function returns true only if the interpreter is capable of
1269 loading resources at all, and the resource is available.
1270
1271 <p>
1272 If you're writing a multi-media game for the HTML interpreters, but you
1273 also want your game to work on text-only systems, you can use this function
1274 for finer control over the presentation on the text systems; you might,
1275 for example, want to provide additional text to make up for missing
1276 graphics or sounds. You can also use this function if you're planning
1277 to distribute your game in different subset versions in order to provide
1278 players with different options for download and install sizes; if you
1279 make some of your graphics optional (by bundling some into a separate
1280 ".RSn" resource file, for example), you can use <tt>resourceExists()</tt>
1281 to detect at run-time which resources the player has chosen to install,
1282 and customize the presentation accordingly.
1283
1284 <p>
1285 Here's an example that checks to see if a JPEG image is available
1286 for display:
1287
1288 <p>
1289 <pre>
1290 if (!resourceExists('images/title.jpg'))
1291 {
1292 // the title graphic isn't available - display a text version
1293 ...
1294 }
1295 </pre>
1296
1297
1298 <h4><a name='newDefined'>
1299 New <tt>defined()</tt> Codes</a></h4>
1300
1301 <p>
1302 The <tt>defined()</tt> function, which tests an object to determine
1303 whether it defines or inherits a given property, provides a new "flags"
1304 argument that lets you get more specific information about the property
1305 definition. The new third argument is optional; if provided, it can be
1306 one of the following values, defined in adv.t:
1307
1308 <p>
1309 <table>
1310 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;
1311 <td>
1312 <table cellpadding=2>
1313
1314 <tr><td valign=top><tt>DEFINED_ANY</tt>&nbsp;&nbsp;<td valign=top>
1315
1316 This is the default, and has the same effect as omitting the flag
1317 argument. The function returns true if the object defines or inherits
1318 the property, nil if not.
1319
1320 <tr><td valign=top><tt>DEFINED_DIRECTLY</tt>&nbsp;&nbsp;<td valign=top>
1321
1322 The function returns true only if the object <i>directly</i> defines
1323 the property. If the object doesn't define the property at all,
1324 or merely inherits the definition from a superclass, the function
1325 returns nil.
1326
1327 <tr><td valign=top><tt>DEFINED_INHERITS</tt>&nbsp;&nbsp;<td valign=top>
1328
1329 The function returns true only if the object inherits the property.
1330 If the object doesn't define the property, or defines the property
1331 directly rather than inheriting it from a superclass, the function
1332 returns nil.
1333
1334 <tr><td valign=top><tt>DEFINED_GET_CLASS</tt>&nbsp;&nbsp;<td valign=top>
1335
1336 The function returns the class where the property is defined. If the
1337 object directly defines the property, the function returns the object
1338 itself. If the object inherits the property from a superclass, the
1339 function returns the superclass from which the property is inherited.
1340 If the object doesn't define or inherit the property, the function
1341 returns nil.
1342
1343 </table></table>
1344
1345 <p>
1346 For example, to determine if the object <tt>redBook</tt> directly
1347 defines <tt>verDoTake</tt>, you could use this code:
1348
1349 <p>
1350 <pre>
1351 if (defined(redBook, &amp;verDoTake, DEFINED_DIRECTLY))
1352 "verDoTake is overridden directly in redBook. ";
1353 </pre>
1354
1355
1356 <h4><a name='newParserGetObj'>
1357 New <tt>parserGetObj()</tt> Codes</a></h4>
1358
1359 <p>
1360 The <tt>parserGetObj()</tt> function now accepts several new code
1361 values to get additional objects. These new code values are defined
1362 in adv.t:
1363
1364 <p>
1365 <p>
1366 <table>
1367 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;
1368 <td>
1369 <table cellpadding=2>
1370
1371 <tr><td valign=top><tt>PO_IT</tt>&nbsp;&nbsp;<td valign=top>
1372 Get the object that the word "it" refers to in player commands.
1373 This is nil if there is not "it" object.
1374
1375 <tr><td valign=top><tt>PO_HIM</tt>&nbsp;&nbsp;<td valign=top>
1376 Get the object that the word "him" refers to in player commands.
1377
1378 <tr><td valign=top><tt>PO_HER</tt>&nbsp;&nbsp;<td valign=top>
1379 Get the object that the word "her" refers to in player commands.
1380
1381 <tr><td valign=top><tt>PO_THEM</tt>&nbsp;&nbsp;<td valign=top>
1382 Get the list of objects that the word "them" refers to in player
1383 commands. This is an empty list if "them" doesn't refer to anything
1384 at the moment.
1385
1386 </table></table>
1387
1388 These new codes are used in the same manner as the original ones.
1389 For example, to get the object that the word "him" currently
1390 refers to, you'd write this:
1391
1392 <p>
1393 <pre>
1394 local himObj;
1395
1396 himObj := parserGetObj(PO_HIM);
1397 </pre>
1398
1399 <p>
1400
1401 <h4><a name='rscUrl'>
1402 Filename-to-URL Conversions in <tt>tadsrsc</tt></a></h4>
1403
1404 <p>
1405 The resource bundling tool, <tt>tadsrsc</tt>, in the past did not convert
1406 filenames entered with explicit paths to URL notation. This problem
1407 only affected individual filenames entered with explicit paths (i.e.,
1408 files in subdirectories); the tool correctly converted paths to URL
1409 notation when adding entire directories to a resource file, and also
1410 worked when adding individual files that were in the current
1411 directory and thus didn't need an explicit path.
1412
1413 <p>
1414 Instead of storing resource names in URL notation, the resource tool
1415 stored the actual filenames in local file system notation. This didn't
1416 work with HTML TADS, because the HTML resource loader requires image
1417 and sound resources to be named using URL notation.
1418
1419 <p>
1420 This problem has been corrected; the resource tool now converts all
1421 paths used in resource filenames to URL notation.
1422
1423
1424 <h4><a name='cantReachMulti'>
1425 <tt>cantReach</tt> with Multiple Objects</a></h4>
1426
1427 When the player refers to an object that is visible but is not
1428 reachable (an item within a closed transparent container, for example),
1429 the parser calls the object's <tt>cantReach</tt> to display a message
1430 explaining why the object is not accessible. This has not been changed,
1431 but the multiple-object prefix mechanism has been.
1432
1433 <p>In the past, when the
1434 command had multiple unreachable objects, the parser called the object's
1435 <tt>sdesc</tt> method, then displayed message 200 (":").
1436 This has been changed. Now, the parser uses the same mechanism
1437 that it does for any other multiple-object listing prefix: for each
1438 object, before calling <tt>cantReach</tt>, the parser
1439 calls the object's <tt>multisdesc</tt> method then displays message 120
1440 (":").
1441
1442 <p>
1443 This minor change is for consistency; in particular, the change allows
1444 the game to override multiple-object prefix displays in a uniform
1445 manner for all types of these displays.
1446
1447
1448 <h4><a name='inputkey251'>Changes to <tt>inputkey()</tt></a></h4>
1449
1450 <p>
1451 The <tt>inputkey()</tt> built-in function now returns certain keys
1452 more consistently and portably. The codes that
1453 <tt>inputkey()</tt> returns vary by platform according to what keys
1454 are available on the keyboard. In addition, in the past, the function
1455 mapped certain keystrokes to high-level functional codes in different
1456 ways on different platforms; this corresponded to the differing ways
1457 that platforms used certain keyboard keys.
1458
1459 <p>The return codes from <tt>inputkey()</tt> are now somewhat more
1460 consistent. The Escape key now returns the string <tt>'[esc]'</tt>
1461 on most platforms that provide such a key, and the "control" keys
1462 now return <tt>'[ctrl-<i>X</i>]'</tt> for almost all of the control
1463 keys on most platforms. In the past, the escape key didn't return
1464 anything on most platforms, and control keys frequently were mapped
1465 to other functions (for example, on Unix, the Ctrl-E key returned
1466 <tt>'[end]'</tt>, since this key is used on Unix TADS interpreters
1467 to move the cursor to the end of the line when entering a command).
1468
1469 <p>
1470 A few new command keys have been added. The full set of command keys
1471 is shown below. The exact assignment of these keys varies by platform,
1472 as it has in past versions, and any given platform might support only
1473 a subset of these keys.
1474
1475 <p>
1476 <table>
1477 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;
1478 <td>
1479 <table cellpadding=2>
1480
1481 <tr><td valign=top><tt>[up]</tt>
1482 <td>Up arrow
1483
1484 <tr><td valign=top><tt>[down]</tt>
1485 <td>Down arrow
1486
1487 <tr><td valign=top><tt>[right]</tt>
1488 <td>Right arrow
1489
1490 <tr><td valign=top><tt>[left]</tt>
1491 <td>Left arrow
1492
1493 <tr><td valign=top><tt>[end]</tt>
1494 <td>End of line
1495
1496 <tr><td valign=top><tt>[home]</tt>
1497 <td>Home
1498
1499 <tr><td valign=top><tt>[del-eol]</tt>
1500 <td>Delete to end of line
1501
1502 <tr><td valign=top><tt>[del-line]</tt>
1503 <td>Delete line
1504
1505 <tr><td valign=top><tt>[del]</tt>
1506 <td>Del (delete character)
1507
1508 <tr><td valign=top><tt>[page up]</tt>
1509 <td>Page up
1510
1511 <tr><td valign=top><tt>[page down]</tt>
1512 <td>Page down
1513
1514 <tr><td valign=top><tt>[top]</tt>
1515 <td>Top of file
1516
1517 <tr><td valign=top><tt>[bottom]</tt>
1518 <td>Bottom of file
1519
1520 <tr><td valign=top><tt>[f<i>N</i>]</tt>
1521 <td>Function key <i>N</i> (<i>N</i> is replaced by a number, 1 through 10)
1522
1523 <tr><td valign=top><tt>[tab]</tt>
1524 <td>Tab
1525
1526 <tr><td valign=top><tt>[word-left]</tt>
1527 <td>Word left
1528
1529 <tr><td valign=top><tt>[word-right]</tt>
1530 <td>Word right
1531
1532 <tr><td valign=top><tt>[del-word]</tt>
1533 <td>Delete word
1534
1535 <tr><td valign=top><tt>[bksp]</tt>
1536 <td>Backspace
1537
1538 <tr><td valign=top><tt>[esc]</tt>
1539 <td>Escape
1540
1541 <tr><td valign=top><tt>[ctrl-<i>X</i>]</tt>
1542 <td>Control-<i>X</i> (<i>X</i> is replaced by a lower-case letter:
1543 Control-C is <tt>[ctrl-c]</tt>)
1544
1545 <tr><td valign=top><tt>[alt-<i>X</i>]</tt>
1546 <td>Alt-<i>X</i> or Meta-<i>X</i> (<i>X</i> is replaced by a lower-case
1547 letter: Alt-F is <tt>[alt-f]</tt>)
1548
1549 </table>
1550 </table>
1551 <p>
1552
1553
1554 <h4><a name='adv251'>Changes to adv.t</a></h4>
1555
1556 <ul>
1557 <li>Added verifier methods to class <tt>thing</tt> to accomodate
1558 the verbs <tt>screwVerb</tt> and <tt>unscrewVerb</tt>. All of
1559 these verifier methods simply stop the command with a default
1560 failure message (variations on "You see now way to do that").
1561 The new methods are:
1562
1563 <ul>
1564 <li><tt>verDoScrew</tt>
1565 <li><tt>verDoScrewWith</tt>
1566 <li><tt>verIoScrewWith</tt>
1567 <li><tt>verDoUnscrew</tt>
1568 <li><tt>verDoUnscrewWith</tt>
1569 <li><tt>verIoUnscrewWith</tt>
1570 </ul>
1571
1572 <li>The <tt>fopen()</tt> built-in function's <tt>'r+'</tt> mode did
1573 not correctly create a new file when the file being opened did not
1574 previously exist, as it is documented to do. This has been corrected;
1575 if no file exists, the <tt>'r+'</tt> mode creates a new file, otherwise
1576 it opens the existing file, keeping its contents intact.
1577
1578 <li>The <tt>moveInto</tt> method in the <tt>basicMe</tt> object
1579 in adv.t now works properly when the object is not the current player
1580 character. <tt>moveInto</tt> now uses the default handling inherited
1581 from <tt>Actor</tt> when the object is not the current player character;
1582 this is important for games that switch among different player character
1583 objects.
1584
1585 <li>The <tt>ioGiveTo</tt> method in <tt>basicMe</tt> in adv.t now
1586 uses format strings (such as "%You%"), so that it adapts properly
1587 when the object is not the current player character.
1588
1589 </ul>
1590
1591
1592 <h4><a name='bugs251'>Bugs Fixed</a></h4>
1593
1594 <ul>
1595
1596 <li>Format strings (such as "%You%") can now be used from within the
1597 <tt>endCommand()</tt> function. In the past, the actor setting that
1598 the output formatter uses to translate format strings was forgotten
1599 before the parser called <tt>endCommand()</tt>, even though the
1600 parser still had the necessary information internally. The output
1601 formatter now keeps track of this information until after
1602 <tt>endCommand()</tt> returns, which allows you to use format strings
1603 from within <tt>endCommand()</tt>.
1604
1605 <li>Fixed a parser bug: Executing <tt>exit</tt> within
1606 <tt>preCommand()</tt> did not have the documented effect of skipping
1607 all of the remaining objects in the command, but simply skipped the
1608 first object in the command. <tt>exit</tt> in <tt>preCommand()</tt>
1609 now correctly skips the entire object list for the command.
1610
1611 <li>Fixed a parser bug: An object defined with the same leading
1612 substring six characters or longer in multiple adjectives sometimes
1613 appeared more than once in a disambiguation query ("Which book do you
1614 mean, the yellow book, or the yellow book?"). This same type of
1615 problem was fixed in most cases in version 2.4.0, but one type of
1616 the problem remained; this has now been fixed.
1617
1618 <li>Another bug, related to the bug above, was fixed. In some cases,
1619 when the player responded to a disambiguation query with <i>multiple</i>
1620 objects, the parser would ask the disambiguation question again with
1621 every object in the entire game, whether accessible to the player or not,
1622 in the list of possible objects. This has been corrected.
1623
1624 <li>Another parser bug was fixed: If a word referred to more than about 200
1625 objects, the parser displayed a double error message (specifically,
1626 "The word 'foo' refers to too many objects.I don't see any foo here.").
1627 This has been corrected; only the first message ("too many objects")
1628 is displayed now.
1629
1630 <li>Fixed a bug in adv.t: the <tt>listcontgen()</tt> function, when
1631 the "recursive" flag was set, incorrectly tried to evaluate <tt>itemcnt()</tt>
1632 with an object rather than a list, causing a run-time error. This has
1633 been corrected.
1634
1635 <li>The parser's handling of situations where an "again" command is
1636 impossible due to object deletion has been improved. In the past,
1637 if an object involved in the previous command was deleted, and the
1638 player typed "again," the parser would respond with parser message
1639 26 ("There's no command to repeat"). The parser now responds with
1640 the more suitable message 27 ("You can't repeat that command").
1641
1642 <li>The parser now properly restores the text of the player's
1643 original command words for the direct and indirect object when the
1644 player repeats a command with "again." In the past, the parser did
1645 not retain the text of the previous command's words, so <tt>objwords()</tt>
1646 returned empty lists when the game attempted to retrieve the object
1647 words during execution of a repeated command. This inconsistency
1648 has been corrected.
1649
1650 <li>The <tt>parseNounList()</tt> function returned an incorrect word
1651 index value in the first element of its return list in two cases:
1652 when the noun phrase did not match any objects; and when there was no
1653 noun phrase present. In both of these cases, the returned index value
1654 had a value one less than the correct value. This has been corrected.
1655
1656 <li>Fixed a problem that occasionally caused a crash when the player
1657 entered a command containing an ampersand ("&amp;") when the game was
1658 running in HTML mode.
1659
1660 <li>Fixed a parser bug that occasionally caused a crash when the player
1661 responded to a disambiguation prompt ("which book do you mean...") with
1662 "him" or "her."
1663
1664 </ul>
1665
1666 <br><br><hr>
1667 <h3><a name='tads250'>Version 2.5.0</a></h3>
1668
1669 <i>Released on July 10, 1999</i>
1670
1671 <h4>Index of Changes</h4>
1672
1673 <ul>
1674 <li><a href='#precmd'>preCommand()</a>
1675 <li><a href='#postact'>postAction() and endTurn()</a>
1676 <li><a href='#inputdialog'>inputdialog()</a>
1677 <li><a href='#inputline'>inputline()</a>
1678 <li><a href='#restore_ret'>New restore() return codes</a>
1679 <li><a href='#askfile_ext'>Extended askfile() interface</a>
1680 <li><a href='#switchPlayer'>switchPlayer()</a>
1681 <li><a href='#iwide'>Inventory Wide and Tall</a>
1682 <li><a href='#nestlistcont'>nestlistcont()</a>
1683 <li><a href='#listcontgen'>listcontgen()</a>
1684 <li><a href='#basicMeTravelTo'>basicMe.travelTo changes</a>
1685 <li><a href='#movableActorTravelTo'>movableActor.travelTo changes</a>
1686 <li><a href='#ds2'>New compiler debug record format (-ds2)</a>
1687 <li><a href='#parserbug250'>Parser bug fixes</a>
1688 <li><a href='#tdbbug250'>Debugger bug fixes</a>
1689 <li><a href='#tcbug250'>Compiler bug fixes</a>
1690 </ul>
1691
1692
1693
1694 <h4><a name='precmd'>
1695 New pre-execution processing: <tt>preCommand</tt></a></h4>
1696
1697 <p>
1698 At the start of the execution phase, before calling <tt>verbAction()</tt>
1699 for the first direct object in the command, the parser invokes
1700 the new function <tt>preCommand()</tt>:
1701
1702 <p>
1703 <pre>
1704 preCommand(<i>actor, verb, dobj_list, prep, iobj</i>);
1705 </pre>
1706
1707 <p>
1708 The "actor", "verb", "prep", and "iobj" parameters are objects giving
1709 the actor, verb, preposition, and indirect object in the command,
1710 respectively. The "dobj_list" parameter is a list of the direct objects
1711 in the command, in the same order as they appear in the command.
1712
1713 <p>
1714 This function can use <tt>exit</tt> to skip to fuses and daemons,
1715 or it can use <tt>abort</tt> to cancel the command entirely, in which
1716 case the parser will skip directly to the <tt>endCommand</tt> function
1717 (see below). If this function simply returns, the parser continues
1718 processing the command as normal.
1719
1720
1721 <h4><a name='postact'>New end-of-turn processing: <tt>postAction</tt> and
1722 <tt>endCommand</tt></a></h4>
1723
1724 <p>
1725 In past versions of TADS, it wasn't possible to add special event
1726 processing at the end of a turn. The closest approximation was to
1727 put processing in a fuse or daemon, but this approach has several
1728 drawbacks: no information is available in a fuse or daemon on the
1729 last command executed, and it is not possible to specify the order
1730 of execution of fuses and daemons.
1731
1732 <p>
1733 Two new parser hooks provide for structured event handling at the
1734 end of a turn. The first hook, the <tt>postAction</tt> function,
1735 lets you write code that the parser calls immediately after the
1736 "action" method, and before any fuses or daemons. The second hook,
1737 the <tt>endCommand</tt> function, lets you write code that the
1738 parser calls at the end of a turn, just after running all of the
1739 fuses and daemons for the turn.
1740
1741 <p>The parser calls <tt>postAction</tt> once for each object in a
1742 command with multiple direct objects, just after it calls the
1743 "action" method for the object. If the command is terminated early
1744 with <tt>exit</tt>, <tt>exitobj</tt>, or <tt>abort</tt>, the parser
1745 invoked <tt>postAction</tt> immediately after the <tt>exit</tt>,
1746 <tt>exitobj</tt>, or <tt>abort</tt> statement executes. The parser
1747 calls <tt>postAction</tt> with the following arguments:
1748
1749 <p>
1750 <pre>
1751 postAction(<i>actor, verb, dobj, prep, iobj, status</i>);
1752 </pre>
1753
1754 <p>
1755 The first five parameters specify the current command; any of the objects
1756 except "actor" and "verb" can be nil. The "status" parameter has the
1757 same meaning as the return codes from the <tt>execCommand</tt> built-in
1758 function; it can be one of the following values, defined in adv.t:
1759
1760 <p>
1761 <table>
1762 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;
1763 <td>
1764 <table cellpadding=2>
1765
1766 <tr><td valign=top><tt>EC_SUCCESS</tt>&nbsp;&nbsp;<td valign=top>
1767 The command executed successfully, which indicates that everything
1768 up through and including the command's "action" method
1769 (<tt><i>verb</i>.action</tt>, <tt><i>dobj</i>.doAction</tt>, or
1770 <tt><i>iobj</i>.ioAction</tt>, as appropriate).
1771
1772 <tr><td valign=top><tt>EC_EXIT</tt>&nbsp;&nbsp;<td valign=top>
1773 An <tt>exit</tt> statement was executed.
1774
1775 <tr><td valign=top><tt>EC_EXITOBJ</tt>&nbsp;&nbsp;<td valign=top>
1776 An <tt>exitobj</tt> statement was executed.
1777
1778 <tr><td valign=top><tt>EC_ABORT</tt>&nbsp;&nbsp;<td valign=top>
1779 An <tt>exit</tt> statement was executed.
1780
1781 </table>
1782 </table>
1783
1784 <p>
1785 The <tt>postAction</tt> function returns no value.
1786
1787 <p>
1788 The parser invokes the <tt>endCommand</tt> after all of the fuses
1789 and daemons have finished running at the end of a turn. This function
1790 is called once per command, not per object; in a command with multiple
1791 direct objects, this function is called only once, just as fuses and
1792 daemons are called only once for the entire command.
1793
1794 <p>
1795 The parser calls <tt>endCommand</tt> as follows:
1796
1797 <p>
1798 <pre>
1799 endCommand(<i>actor, verb, dobj_list, prep, iobj, status</i>);
1800 </pre>
1801
1802 <p>
1803 The "status" parameter has the same meaning as the status code parameter
1804 to <tt>postAction</tt>. The other parameters have the same values
1805 as they did in the call to <tt>preCommand</tt> that the parser makes
1806 at the start of the execution phase for the command.
1807
1808 <p> <tt>endCommand</tt> is always invoked at the end of a turn. If an
1809 <tt>abort</tt> statement is executed in the course of a turn, the parser
1810 skips directly to <tt>endCommand</tt>, because <tt>abort</tt> skips the
1811 daemons and fuses. This means that <tt>endCommand</tt> is executed at
1812 the end of a turn even when fuses and daemons are skipped.
1813
1814 <p>
1815 The <tt>endCommand</tt> function returns no value.
1816
1817 <h4><a name='inputdialog'>
1818 New built-in function <tt>inputdialog()</tt></a></h4>
1819
1820 <p>A new built-in function, <tt>inputdialog()</tt>, lets you ask the
1821 player a multiple-choice question. On graphical systems,
1822 </tt>inputdialog()</tt> displays a system dialog box, and lets the
1823 user respond by clicking a button. On text systems, this function
1824 displays a textual prompt and lets the user respond with the keyboard.
1825
1826 <p>
1827 <tt>inputdialog</tt> takes the following parameters:
1828
1829 <p>
1830 <pre>
1831 inputdialog(<i>icon, prompt, response_list, default_idx, cancel_idx</i>)
1832 </pre>
1833
1834 <p>
1835 The "icon" parameter indicates which icon, if any, to display. The icon
1836 will only be displayed on graphical systems; text-only systems ignore
1837 this parameter. These icon constants are defined in adv.t:
1838
1839 <p>
1840 <table>
1841 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;
1842 <td>
1843 <table cellpadding=2>
1844 <tr><td valign=top><tt>INDLG_ICON_NONE</tt>&nbsp;&nbsp;<td valign=top>
1845 Do not use any icon.
1846
1847 <tr><td valign=top><tt>INDLG_ICON_WARNING</tt>&nbsp;&nbsp;<td valign=top>
1848 Show a "warning" icon. This indicates a potential or minor problem.
1849 (On Windows, this displays an exclamation-point icon.)
1850
1851 <tr><td valign=top><tt>INDLG_ICON_INFO</tt>&nbsp;&nbsp;<td valign=top>
1852 Show an "information" icon. This indicates to the user that the dialog
1853 is being displayed to inform them of the status of an operation.
1854 (On Windows, this displays an icon with a small letter "i" in a circle.)
1855
1856 <tr><td valign=top><tt>INDLG_ICON_QUESTION</tt>&nbsp;&nbsp;<td valign=top>
1857 Show a "question" icon. This indicates that additional information
1858 from the user is required.
1859 (On Windows, this displays a question-mark icon.)
1860
1861 <tr><td valign=top><tt>INDLG_ICON_ERROR</tt>&nbsp;&nbsp;<td valign=top>
1862 Show an "error" icon. This indicates that a problem has occurred.
1863 (On Windows, this displays a stop-sign icon.)
1864
1865 </table>
1866 </table>
1867
1868 <p>
1869 The "prompt" parameter is the message string to display. For graphical
1870 systems, this message is displayed in a dialog box; for text systems,
1871 it's simply displayed on the terminal.
1872
1873 <p>The "response_list" is a list of strings giving the valid responses.
1874 Each entry in the list is a string giving one possible response.
1875 On graphical systems, one button is displayed in the dialog for each
1876 response string; the response string is the button's label. On text
1877 systems, the responses are displayed to the player after the prompt
1878 string.
1879
1880 <p>
1881 Each string in the response list can optionally include an ampersand
1882 character ("&amp;") before the character that serves as a keyboard
1883 short-cut for the response. The ampersand is not displayed in the
1884 button label or response list displayed to the player. For example,
1885 the response list string '&amp;Yes' makes the "Y" key a short-cut for
1886 the button, which is labeled "Yes" in the dialog. On some systems
1887 the short-cut key will be indicated visually in the dialog; on Windows,
1888 for example, the "Y" in the "Yes" button would be underlined to indicate
1889 that the letter "Y" is the short-cut for the button. If no ampersand
1890 appears in a response list item, the item has no short-cut.
1891
1892 <p>
1893 On text-only systems, the keyboard short-cut will be indicated visually
1894 by enclosing the short-cut letter in parentheses when dispalying the
1895 list of possible responses to the player. If a response item has no
1896 short-cut key, the player must enter a sufficiently long leading substring
1897 of the response item so that the response is unambiguous with the other
1898 valid responses.
1899
1900 <p>Each element of the list can be a number, rather than a string.
1901 If an element is a number, it specifies that the button should use
1902 a pre-defined standard label. You should use standard labels when
1903 possible, because these labels will follow local system conventions
1904 and will be localized to the player's language settings; these labels
1905 are read from external resources on platforms with appropriate operating
1906 system support, so they can be localized easily. To select a standard
1907 label, use one of the following values, defined in adv.t:
1908
1909 <p>
1910 <table>
1911 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;
1912 <td>
1913 <table cellpadding=2>
1914 <tr><td valign=top><tt>INDLG_LBL_OK</tt>&nbsp;&nbsp;<td valign=top>
1915 "OK", or local system or language equivalent
1916
1917 <tr><td valign=top><tt>INDLG_LBL_CANCEL</tt>&nbsp;&nbsp;<td valign=top>
1918 "Cancel"
1919
1920 <tr><td valign=top><tt>INDLG_LBL_YES</tt>&nbsp;&nbsp;<td valign=top>
1921 "Yes"
1922
1923 <tr><td valign=top><tt>INDLG_LBL_NO</tt>&nbsp;&nbsp;<td valign=top>
1924 "No"
1925 </table>
1926 </table>
1927 <p>
1928 The strings shown above do not necessarily reflect the actual button
1929 text that the player will see, because the actual label will vary by
1930 platform and by language. Whatever label is displayed, though, will
1931 convey to the user the same meaning.
1932
1933 <p>You can also select an entire standard set of buttons, rather than
1934 specifying each button individually. If the response_list parameter
1935 is a number, rather than a list, it indicates that a standard set of
1936 buttons is to be used, selected from a pre-defined list. The
1937 advantage of using one of these pre-defined button sets when possible
1938 is that the buttons will automatically follow local system
1939 conventions and be localized to the player's language settings, on
1940 platforms with appropriate operating system support. To select a
1941 pre-defined button set, use one of the following values, defined in
1942 adv.t, for the response_list parameter:
1943
1944 <p>
1945 <table>
1946 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;
1947 <td>
1948 <table cellpadding=2>
1949 <tr><td valign=top><tt>INDLG_OK</tt>&nbsp;&nbsp;<td valign=top>
1950 The dialog will display an "OK" button, properly localized.
1951
1952 <tr><td valign=top><tt>INDLG_OKCANCEL</tt>&nbsp;&nbsp;<td valign=top>
1953 The dialog will display an "OK" button and a "Cancel" button, properly
1954 localized.
1955
1956 <tr><td valign=top><tt>INDLG_YESNO</tt>&nbsp;&nbsp;<td valign=top>
1957 The dialog will display an "Yes" button and a "No" button, properly
1958 localized.
1959
1960 <tr><td valign=top><tt>INDLG_YESNOCANCEL</tt>&nbsp;&nbsp;<td valign=top>
1961 The dialog will display a "Yes" button, a "No" button, and a
1962 "Cancel" button, properly localized.
1963
1964 </table>
1965 </table>
1966
1967 <p> The "default_idx" parameter gives the index in the response list
1968 of the default response. If the user presses the "Return" key, or
1969 performs any other action appropriate to the system user interface
1970 that by local convention accepts the default response to a dialog,
1971 this response will be used. The first list entry is at index 1.
1972 Pass nil in this parameter if there is no default response, in which
1973 case TADS will require the user to select a specific button. (Note
1974 that, on some systems, passing nil for this parameter will not make a
1975 noticeable difference; on Windows, for example, one of the buttons
1976 will always have keyboard focus, so pressing the Return key will
1977 always select one of the buttons.)
1978
1979 <p>
1980 The "cancel_idx" parameter gives the index in the response list of the
1981 cancellation response. Most GUI systems have a standard way of cancelling
1982 a dialog; the Escape key has this effect on Windows, for example, as does
1983 the Command-Period key combination on the Macintosh. If the user performs
1984 the appropriate system-specific action to cancel the dialog, this response
1985 is used. The first list entry is at index 1. Pass nil in this parameter
1986 if there is no cancel response, in which case TADS will not allow the
1987 player to cancel the dialog.
1988
1989 <p> The dialog returns the index of the response that the player
1990 selects: 1 for the first response in the response list, 2 for the
1991 second entry in the list, and so on. For the standard response lists
1992 (<tt>INDLG_YESNO</tt> and so on), the response are in the order described
1993 for the constant name: <tt>INDLG_YESNO</tt> has a "Yes" button at index
1994 1 and a "No" button at index 2, for example.
1995
1996 <p>
1997 Here's an example of using this function.
1998
1999 <p>
2000 <pre>
2001 ret := inputdialog('What would you like to do next?',
2002 ['&amp;Restore', 'Re&amp;start', '&amp;Quit'],
2003 nil, 3);
2004 switch(ret)
2005 {
2006 case 1:
2007 /* restore a game... */
2008 break;
2009
2010 case 2:
2011 /* restart the game */
2012 restart();
2013 break;
2014
2015 case 3:
2016 /* quit */
2017 quit();
2018 break;
2019 }
2020 </pre>
2021
2022 <p>
2023 On a graphical system, this would display a dialog with the message
2024 text "What would you like to do next?", and three buttons: one
2025 with the label "Restore", one with the label "Restart", and one with
2026 the label "Quit". If the user presses the "R" key, the "Restore" button
2027 would be selected; if the user presses "S", the "Restart" button would
2028 be selected; if the user presses "Q", or cancels the dialog (by pressing
2029 the Escape key on a Windows machine, for example), the "Quit" button
2030 would be selected.
2031
2032 <p>
2033 On a text-only system, TADS would display this text on the terminal,
2034 on a new line (TADS would output a "\n" sequence to start a new line):
2035
2036 <p><pre>
2037 What would you like to do next? (R)estore/Re(s)tart/(Q)uit &gt;
2038 </pre>
2039
2040 <p>
2041 TADS would then wait for the player to enter a line of text (as with
2042 the <tt>input()</tt> built-in function). If the player enters one
2043 letter, TADS would check the letter against each response's short-cut,
2044 and return the one that matches. If the player enters more than one
2045 letter, TADS would check the string against the leading substring of
2046 each possible response; if the string matches one of the responses
2047 unambiguously, TADS would return that response. If the player enters
2048 something invalid or ambiguous, TADS would redisplay the prompt and
2049 await another response.
2050
2051 <p><tt>inputdialog()</tt> has certain limits. The prompt string can
2052 be no longer than 256 characters. There can be no more than ten
2053 responses, and the total length of the text in all of the responses
2054 must not exceed 256 characters. In addition, to ensure portability,
2055 you should choose a reasonably short label for each button; some
2056 systems use buttons of a fixed size, so a long label name might not
2057 fit in the available space on some systems. Whenever possible, use
2058 a single word for each button label.
2059
2060
2061 <h4><a name='inputline'>New <tt>inputline()</tt> function in adv.t</a></h4>
2062
2063 <p>A new function, <tt>inputline()</tt>, is defined in adv.t. This
2064 function is a simple cover for the built-in function <tt>input()</tt>,
2065 with the additional feature that <tt>inputline()</tt> switches to
2066 the "TADS-Input" font when the game is running in HTML mode. This
2067 means that the text that the player enters during an <tt>inputline()</tt>
2068 has the same appearance as the text entered on a normal command line.
2069
2070 <p>
2071 Note that the <tt>input()</tt> function does not switch to the
2072 "TADS-Input" font itself, because if it did, you'd have no way to
2073 override this behavior. Rather than forcing input text to be displayed
2074 in the "TADS-Input" font, the <tt>input()</tt> function leaves it up to
2075 the game author to determine how input text should look. In most cases,
2076 you should use <tt>inputline()</tt> rather than calling <tt>input()</tt>
2077 directly, to ensure that the player's input has the normal command line
2078 appearance. In some cases, however, you might wish to use a specific
2079 appearance for input text, rather than using the default setting;
2080 in these cases, you should set your own font choice, then call
2081 the <tt>input()</tt> function directly, since it won't change the
2082 appearance from what you choose.
2083
2084 <h4><a name='restore_ret'>New <tt>restore()</tt> return code</a></h4>
2085
2086 <p>The <tt>restore()</tt> built-in function's return code has been changed.
2087 In the past, this function returned nil to indicate success, and true
2088 to indicate failure. The return value is now a number; different
2089 values are returned for different error conditions, which makes it
2090 possible to provide better information to the player about the
2091 specific problem that caused the operation to fail.
2092
2093 <p>
2094 The new return values, defined in adv.t, are:
2095
2096 <p>
2097
2098 <table>
2099 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;
2100 <td>
2101 <table cellpadding=2>
2102 <tr><td valign=top><tt>RESTORE_SUCCESS</tt>&nbsp;&nbsp;<td valign=top>
2103 Success
2104
2105 <tr><td valign=top><tt>RESTORE_FILE_NOT_FOUND</tt>&nbsp;&nbsp;<td valign=top>
2106 The file to be restored does not
2107 exist (or could not be opened for some other reason).
2108
2109 <tr><td valign=top><tt>RESTORE_NOT_SAVE_FILE</tt>&nbsp;&nbsp;<td valign=top>
2110 The file is not a valid saved game.
2111
2112 <tr><td valign=top><tt>RESTORE_BAD_FMT_VSN</tt>&nbsp;&nbsp;<td valign=top>
2113 The file was saved by an incompatible
2114 version of the TADS Interpreter
2115
2116 <tr><td valign=top><tt>RESTORE_BAD_GAME_VSN</tt>&nbsp;&nbsp;<td valign=top>
2117 The file was saved by a different
2118 game, or by a different version of the same game.
2119
2120 <tr><td valign=top><tt>RESTORE_READ_ERROR</tt>&nbsp;&nbsp;<td valign=top>
2121 An error occurred reading the file.
2122 This could indicate that the file was corrupted, or that the physical
2123 medium containing the file is damaged.
2124
2125 <tr><td valign=top><tt>RESTORE_NO_PARAM_FILE</tt>&nbsp;&nbsp;<td valign=top>
2126 No parameter file has been
2127 specified. This is returned only when <tt>restore(nil)</tt> is
2128 called to attempt to load the file specified by a start-up parameter;
2129 it indicates that there is in fact no parameter file to load.
2130
2131 </table>
2132 </table>
2133
2134
2135 <p>For compatibility, <tt>RESTORE_SUCCESS</tt> is defined as 0, and
2136 all of the other values are non-zero. In most cases, this should
2137 allow existing code (that assumes the nil/true return value) to
2138 continue working without changes, since <tt>if (restore(fname))</tt> will
2139 continue to have the same effect with this change. Only code that
2140 explicitly compared the return value to nil or true will need to be
2141 changed.
2142
2143 <p>The code in adv.t that calls <tt>restore()</tt> has been updated to
2144 reflect this change, and uses the additional information to display a
2145 more precise message when an error occurs.
2146
2147 <h4><a name='askfile_ext'>Extended <tt>askfile()</tt> Interface</a></h4>
2148
2149 <p>The <tt>askfile()</tt> built-in function's interface has been extended.
2150
2151 <p>A new, optional fourth argument lets you specify additional flags
2152 to the <tt>askfile</tt> function. The possible flag values, defined
2153 in adv.t, are:
2154
2155 <p>
2156 <table>
2157 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;
2158 <td>
2159 <table cellpadding=2>
2160
2161 <tr><td valign=top><tt>ASKFILE_EXT_RESULT</tt>&nbsp;&nbsp;<td valign=top>
2162 Return extended result codes (described below). If this flag is
2163 provided, the function returns extended results; if this flag is
2164 not specified, the function returns the traditional results.
2165
2166 </table>
2167 </table>
2168
2169 <p>
2170 In order to specify the new flag value argument, you must specify
2171 the prompt type and file type arguments as well; if you omitted the
2172 prompt or file type argument, the <tt>askfile</tt> function would not
2173 be able to tell that you meant the last argument as the flags value.
2174
2175 <p>If you omit the flags argument, <tt>askfile</tt> uses a default
2176 value of zero, which makes the function behave the same as in past
2177 versions. Because older code never specifies a flags value, the
2178 function will always behave compatibly with past versions when called
2179 from older code.
2180
2181 <p>Traditionally, <tt>askfile</tt> returned a string on success, or
2182 nil for any type of failure; this didn't permit the caller to
2183 determine exactly what kind of failure occurred, and in particular
2184 did not allow the caller to distinguish between an actual error and
2185 the player cancelling the file selector dialog. When
2186 <tt>ASKFILE_EXT_RESULT</tt> is specified, the function will return
2187 additional information that allows the caller to distinguish these
2188 cases.
2189
2190 <p>When the <tt>ASKFILE_EXT_RESULT</tt> flag is specified,
2191 <tt>askfile</tt> returns a list that contains two elements. The
2192 first element is a number which indicates the status of the file
2193 selection; the second element is a string if a file was successfully
2194 chosen, or nil if not. The possible values for the first element of
2195 the returned list, defined in adv.t, are:
2196
2197 <p>
2198 <table>
2199 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;
2200 <td>
2201 <table cellpadding=2>
2202
2203 <tr><td valign=top><tt>ASKFILE_SUCCESS</tt>&nbsp;&nbsp;<td valign=top>
2204 A file was successfully chosen. The second element of the list contains
2205 a string giving the chosen filename.
2206
2207 <tr><td valign=top><tt>ASKFILE_FAILURE</tt>&nbsp;&nbsp;<td valign=top>
2208 An error occurred prompting for a filename. This usually indicates
2209 that the file selector dialog could not be shown for some reason
2210 (insufficient memory, for example).
2211
2212 <tr><td valign=top><tt>ASKFILE_CANCEL</tt>&nbsp;&nbsp;<td valign=top>
2213 The user canceled the file selector dialog. On the Macintosh, for
2214 example, this means that the user clicked the "Cancel" button. This
2215 indicates that the user does not wish to proceed with whatever operation
2216 is in progress, so the operation should be aborted. Since the user
2217 explicitly chose to cancel the operation, the program should not indicate
2218 that an error occurred, but simply that the operation will be terminated
2219 in accordance with the user's request.
2220
2221 </table>
2222 </table>
2223
2224 <p>
2225 All code in adv.t that calls <tt>askfile</tt> has been updated to use
2226 the new extended results information, so that it can provide more
2227 appropriate responses when the user cancels a file selector dialog.
2228
2229 <p>
2230 Here's an example, from the "restore" command's implementation in
2231 adv.t, of using the new extended results.
2232
2233 <p>
2234 <pre>
2235 local savefile;
2236
2237 savefile := askfile('File to restore game from',
2238 ASKFILE_PROMPT_OPEN, FILE_TYPE_SAVE,
2239 ASKFILE_EXT_RESULT);
2240 switch(savefile[1])
2241 {
2242 case ASKFILE_SUCCESS:
2243 return mainRestore(savefile[2]);
2244
2245 case ASKFILE_CANCEL:
2246 "Canceled. ";
2247 return nil;
2248
2249 case ASKFILE_FAILURE:
2250 default:
2251 "Failed. ";
2252 return nil;
2253 }
2254 </pre>
2255
2256 <h4><a name='switchPlayer'>
2257 New <tt>switchPlayer()</tt> function in adv.t</a></h4>
2258
2259 <p>
2260 The standard library file adv.t provides a new function,
2261 <tt>switchPlayer</tt>, that you can use to switch the player character
2262 to a new actor. This function uses the built-in function
2263 <tt>parserSetMe()</tt> to change the parser's internal player
2264 character record, and in addition performs some book-keeping
2265 work that's necessary when switching to a new player.
2266
2267 <p>Call <tt>switchPlayer()</tt> with one argument: the actor object
2268 that is to become the new player character.
2269
2270 <p>First, <tt>switchPlayer()</tt> adds the outgoing player
2271 character object to its room's contents list, and removes the
2272 new player character object from its room's contents list. By
2273 convention in adv.t, the active player character is never in its
2274 location's contents list, but other actor objects are. Since the
2275 outgoing object is switching from being the active player object to
2276 an ordinary actor, it must be added to its room's contents list;
2277 likewise, since the new object is changing from an ordinary actor
2278 to the player character, it must be removed from its location's
2279 contents list.
2280
2281 <p>Second, <tt>switchPlayer()</tt> removes the vocabulary words
2282 "me" and "myself" from the outgoing player character object, and
2283 adds these vocabulary words to the incoming player character.
2284 This way, these words always refer to the current player character.
2285
2286 <p>If your game is based on adv.t, you should use <tt>switchPlayer()</tt>
2287 to change to a new player character object, rather than calling
2288 <tt>parserSetMe()</tt> directly, to ensure that the adv.t conventions
2289 for the active player character object are maintained through the
2290 change.
2291
2292 <p>Thanks to Scott Starkey for his help defining this function.
2293
2294 <h4><a name='iwide'>New adv.t verbs: inventory wide, inventory tall</a></h4>
2295
2296 <p>
2297 The standard library file adv.t defines two new verbs: "inventory wide"
2298 and "inventory tall." These verbs let the player control the inventory
2299 display format. "Inventory wide" displays the player's inventory in
2300 the traditional paragraph-style format. "Inventory tall" displays the
2301 inventory in a single-column format, showing one object per line, and
2302 showing the contents of each object indented one tab stop from its
2303 container.
2304
2305 <p>
2306 Once the player enters an "inventory tall" or "inventory wide" command,
2307 subsequent "inventory" commands (without a format specified) will default
2308 to the format of the previous command. The traditional "wide" format is
2309 the initial setting, but you can change this in your game by setting
2310 <tt>iVerb.useInventoryTall</tt> to <tt>true</tt> in your
2311 <tt>init</tt> function.
2312
2313
2314 <h4><a name='nestlistcont'>
2315 New <tt>nestlistcont()</tt> function in adv.t</a></h4>
2316
2317 <p>
2318 The standard library file adv.t has a new function, <tt>nestlistcont()</tt>,
2319 that displays a listing of an object's contents in a nested single-column
2320 format. This function can be used to display "tall" inventory listing,
2321 rather than the paragraph-style "wide" listings that adv.t normally
2322 displays.
2323
2324 <p>
2325 <tt>nestlistcont()</tt> takes two arguments: the object whose contents are
2326 to be listed, and a number giving the initial indenting. The function
2327 indents the contents of the given object by the given number of tabs.
2328 For each object contained in the given object that has a contents list
2329 of its own, the function displays that object's contents indented one
2330 additional tab level, and so on for their contents.
2331
2332 <p>
2333 <tt>nestlistcont()</tt> displays an object's contents only if the
2334 object's contents are visible, using the normal visibility rules.
2335 If the object's contents are not visible, this function has no effect.
2336 Furthermore, the function displays the contents of objects it displays
2337 only for those objects whose contents are themselves visible.
2338
2339 <p>
2340 Thanks to Kevin Forchione for providing this addition to adv.t.
2341
2342 <h4><a name='listcontgen'>
2343 New <tt>listcontgen()</tt> function in adv.t</a></h4>
2344
2345 <p>
2346 To support the <tt>nestlistcont()</tt> function, adv.t includes another
2347 new listing function, <tt>listcontgen()</tt>. This function is a
2348 general-purpose lister that provides the functionality of the traditional
2349 <tt>listcont()</tt> function as well as the new <tt>nestlistcont()</tt>
2350 function, which are essentially the same except for the display format.
2351
2352 <p>
2353 <tt>listcontgen()</tt> takes three parameters:
2354
2355 <p>
2356 <pre>
2357 listcontgen(<i>obj, flags, depth</i>);
2358 </pre>
2359
2360 <p>
2361 The "obj" parameter is the object whose contents are to be listed, or
2362 simply a list of objects to display. "flags" specifies a set of flag
2363 values, defined in adv.t:
2364
2365 <p>
2366 <table>
2367 <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;
2368 <td>
2369 <table cellpadding=2>
2370 <tr><td valign=top><tt>LCG_TALL</tt>&nbsp;&nbsp;<td valign=top>
2371 Show a "tall" listing, with one item listed per line. If this flag
2372 is specified, each line will be indented by the number of tab stops
2373 given by the "indent" parameter. If <tt>LCG_TALL</tt> isn't specified,
2374 the function shows a "wide" paragraph-style listing, with the items
2375 separated by commas.
2376
2377 <tr><td valign=top><tt>LCG_CHECKVIS</tt>&nbsp;&nbsp;<td valign=top>
2378 Checks the visibility of the contents of "obj" before listing the
2379 contents. If "obj" is a list, this flag is ignored. If this flag
2380 isn't specified, the function lists the contents of "obj" without
2381 checking to see if they're visible.
2382
2383 <tr><td valign=top><tt>LCG_RECURSE</tt>&nbsp;&nbsp;<td valign=top>
2384 Show a recursive listing. If this flag is specified, the function
2385 lists the contents of each item it displays. The recursive call
2386 uses the same "flags" value and increments the "indent" depth by
2387 one. If this flag isn't specified, the function doesn't show the
2388 contents of the objects it lists.
2389 </table></table>
2390
2391 <p>
2392 Note that <tt>listcontgen()</tt> allows you to produce an object
2393 listing for lists other than contents of objects. If you pass a
2394 list in the "obj" parameter, the function lists the items in the
2395 list using the same formatting that it would for a contents list.
2396 This allows you to display a contents-style listing for some collection
2397 of objects other than a contents list.
2398
2399
2400 <h4><a name='basicMeTravelTo'><tt>basicMe.travelTo</tt> changes</a></h4>
2401
2402 <p>In adv.t, the <tt>basicMe.travelTo</tt> method now checks to see
2403 if "self" is actually the active player character object; if not, the
2404 method inherits the <tt>travelTo</tt> processing for a regular actor,
2405 rather than using the special behavior for the current player character.
2406 This change facilitates using <tt>basicMe</tt> as a base class for
2407 defining player character objects in a game with more than one player
2408 character.
2409
2410
2411 <h4><a name='movableActorTravelTo'>
2412 <tt>movableActor.travelTo</tt> changes</a></h4>
2413
2414 <p>In adv.t, the <tt>movableActor.travelTo</tt> method uses an improved
2415 algorithm for determining when to show the "leaving" and "arriving"
2416 messages for the actor. The new algorithm considers the actor's visibility
2417 to the player, before and after the move, in determining whether to show
2418 the messages; the old algorithm considered only the immediate container
2419 of the actor and of the player, which produced the wrong results when
2420 the actor was moving between locations that are both visible to the
2421 player, such as a nested room. In addition, the new algorithm handles
2422 obstacles (such as doors) properly.
2423
2424 <p>
2425 Thanks to Kevin Forchione for providing this improved implementation.
2426
2427
2428 <h4><a name='ds2'>New compiler debug record format</a></h4>
2429
2430 <p>A new compiler option, <tt>-ds2</tt>, tells the compiler to
2431 generate a new style of debugging information designed to work with
2432 the Windows HTML TADS Debugger (part of TADS Workbench). If you're
2433 running your game with the Windows debugger version 2.5.0 or later,
2434 you <b>must</b> compile with the <tt>-ds2</tt> option. If you're
2435 using an older version of the Windows debugger, or you're using the
2436 debugger on another platform (DOS, Unix, Mac), you must continue to
2437 use the original <tt>-ds</tt> option as before.
2438
2439
2440 <h4><a name='parserbug250'>Parser bug fixes</a></h4>
2441
2442 <p>The following player command parser bugs have been fixed:
2443
2444 <ul>
2445
2446 <li>Fixed a parser bug that caused an infinite loop (which caused the
2447 game to lock up) if a game defined the same vocabulary word as both
2448 an adjective and a plural.
2449
2450 <li>Fixed a parser bug involving <tt>disambigDobj</tt> and
2451 <tt>disambigIobj</tt>. When these methods returned a list of objects
2452 that was still ambiguous, the parser's default question ("Which
2453 <i>noun-phrase</i> do you mean...") didn't format the list of
2454 possibilities correctly; in particular, extra commas and "or"'s
2455 sometimes appeared at the end of the list. This has been corrected.
2456
2457 </ul>
2458
2459 <h4><a name='tdbbug250'>Debugger bug fixes</a></h4>
2460
2461 <p>The following debugger problems have been corrected:
2462
2463 <ul>
2464
2465 <li>Fixed a debugger problem that caused single-step execution to skip
2466 past a line containing a disabled breakpoint.
2467
2468 <li>Fixed a problem in the debugger that caused a sporadic crash when
2469 displaying a stack traceback where a function in the stack trace had
2470 a string argument value, and the string was over about 40 characters
2471 long. This bug affected all versions of the debugger, but was most
2472 noticeable on the Windows HTML version, because the Windows debugger
2473 builds a stack traceback every time it takes control (on hitting a
2474 breakpoint, for example, or after single-stepping a line of code).
2475
2476 <li>In certain cases, the debugger showed the current source line
2477 (and breakpoints) off by a couple of lines from where it should have
2478 been. This happened when the source file had one or more lines that
2479 were exactly 97 characters long, and had DOS-style line termination
2480 (CR-LF newline sequences). (This was actually a bug in the compiler
2481 and not the debugger, but it showed up most visibly using the
2482 debugger.) This has been corrected.
2483
2484 </ul>
2485
2486 <h4><a name='tcbug250'>Compiler bug fix</a></h4>
2487
2488 <p> This version corrects an obscure compiler bug that caused
2489 <tt>preinit</tt> to execute incorrectly under certain circumstances.
2490 This bug occurred when <tt>preinit</tt> called a method in an object,
2491 and the method modified a list-valued property of the object, and the
2492 property was defined earlier in the object than the method (i.e., the
2493 property's definition in the source file preceded that of the
2494 method). In such cases, the compiler's behavior was unpredictable;
2495 sometimes it ran correctly, sometimes it stored incorrect values in
2496 the list, and sometimes the compiler crashed. This problem should no
2497 longer occur.
2498
2499 <br><br><br>
2500
2501 </html>
2502