Debian Codegraph @

terps/tads/tads3/lib/adv3/en_us/instruct.t

raw
1 #charset "us-ascii"
2
3 /*
4 * Copyright (c) 2000, 2006 Michael J. Roberts. All Rights Reserved.
5 *
6 * TADS 3 Library: Instructions for new players
7 *
8 * This module defines the INSTRUCTIONS command, which provides the
9 * player with an overview of how to play IF games in general. These
10 * instructions are especially designed as an introduction to IF for
11 * inexperienced players. The instructions given here are meant to be
12 * general enough to apply to most games that follow the common IF
13 * conventions.
14 *
15 * This module defines the English version of the instructions.
16 *
17 * In most cases, each author should customize these general-purpose
18 * instructions at least a little for the specific game. We provide a
19 * few hooks for some specific parameter-driven customizations that don't
20 * require modifying the original text in this file. Authors should also
21 * feel free to make more extensive customizations as needed to address
22 * areas where the game diverges from the common conventions described
23 * here.
24 *
25 * One of the most important things you should do to customize these
26 * instructions for your game is to add a list of any special verbs or
27 * command phrasings that your game uses. Of course, you might think
28 * you'll be spoiling part of the challenge for the player if you do
29 * this; you might worry that you'll give away a puzzle if you don't keep
30 * a certain verb secret. Be warned, though, that many players - maybe
31 * even most - don't think "guess the verb" puzzles are good challenges;
32 * a lot of players feel that puzzles that hinge on finding the right
33 * verb or phrasing are simply bad design that make a game less
34 * enjoyable. You should think carefully about exactly why you don't
35 * want to disclose a particular verb in the instructions. If you want
36 * to withhold a verb because the entire puzzle is to figure out what
37 * command to use, then you have created a classic guess-the-verb puzzle,
38 * and most everyone in the IF community will feel this is simply a bad
39 * puzzle that you should omit from your game. If you want to withhold a
40 * verb because it's too suggestive of a particular solution, then you
41 * should at least make sure that a more common verb - one that you are
42 * willing to disclose in the instructions, and one that will make as
43 * much sense to players as your secret verb - can achieve the same
44 * result. You don't have to disclose every *accepted* verb or phrasing
45 * - as long as you disclose every *required* verb *and* phrasing, you
46 * will have a defense against accusations of using guess-the-verb
47 * puzzles.
48 *
49 * You might also want to mention the "cruelty" level of the game, so
50 * that players will know how frequently they should save the game. It's
51 * helpful to point out whether or not it's possible for the player
52 * character to be killed; whether it's possible to get into situations
53 * where the game becomes "unwinnable"; and, if the game can become
54 * unwinnable, whether or not this will become immediately clear. The
55 * kindest games never kill the PC and are always winnable, no matter
56 * what actions the player takes; it's never necessary to save these
57 * games except to suspend a session for later resumption. The cruelest
58 * games kill the PC without warning (although if they offer an UNDO
59 * command from a "death" prompt, then even this doesn't constitute true
60 * cruelty), and can become unwinnable in ways that aren't readily and
61 * immediately apparent to the player, which means that the player could
62 * proceed for quite some time (and thus invest substantial effort) after
63 * the game is already effectively lost. Note that unwinnable situations
64 * can often be very subtle, and might not even be intended by the
65 * author; for example, if the player needs a candle to perform an
66 * exorcism at some point, but the candle can also be used for
67 * illumination in dark areas, the player could make the game unwinnable
68 * simply by using up the candle early on while exploring some dark
69 * tunnels, and might not discover the problem until much further into
70 * the game.
71 */
72
73 #include "adv3.h"
74 #include "en_us.h"
75
76 /*
77 * The INSTRUCTIONS command. Make this a "system" action, because it's
78 * a meta-action outside of the story. System actions don't consume any
79 * game time.
80 */
81 DefineSystemAction(Instructions)
82 /*
83 * This property tells us how complete the verb list is. By default,
84 * we'll assume that the instructions fail to disclose every required
85 * verb in the game, because the generic set we use here doesn't even
86 * try to anticipate the special verbs that most games include. If
87 * you provide your own list of game-specific verbs, and your custom
88 * list (taken together with the generic list) discloses every verb
89 * required to complete the game, you should set this property to
90 * true; if you set this to true, the instructions will assure the
91 * player that they will not need to think of any verbs besides the
92 * ones listed in the instructions. Authors are strongly encouraged
93 * to disclose a list of verbs that is sufficient by itself to
94 * complete the game, and to set this property to true once they've
95 * done so.
96 */
97 allRequiredVerbsDisclosed = nil
98
99 /*
100 * A list of custom verbs. Each game should set this to a list of
101 * single-quoted strings; each string gives an example of a verb to
102 * display in the list of sample verbs. Something like this:
103 *
104 * customVerbs = ['brush my teeth', 'pick the lock']
105 */
106 customVerbs = []
107
108 /*
109 * Verbs relating specifically to character interaction. This is in
110 * the same format as customVerbs, and has essentially the same
111 * purpose; however, we call these out separately to allow each game
112 * not only to supplement the default list we provide but to replace
113 * our default list. This is desirable for conversation-related
114 * commands in particular because some games will not use the
115 * ASK/TELL conversation system at all and will thus want to remove
116 * any mention of the standard set of verbs.
117 */
118 conversationVerbs =
119 [
120 'ASK WIZARD ABOUT WAND',
121 'ASK WIZARD FOR POTION',
122 'TELL WIZARD ABOUT DUSTY TOME',
123 'SHOW SCROLL TO WIZARD',
124 'GIVE WAND TO WIZARD',
125 'YES (or NO)'
126 ]
127
128 /* conversation verb abbreviations */
129 conversationAbbr = "\n\tASK ABOUT (topic) can be abbreviated
130 to A (topic)
131 \n\tTELL ABOUT (topic) can be entered as T (topic)"
132
133 /*
134 * Truncation length. If the game's parser allows words to be
135 * abbreviated to some minimum number of letters, this should
136 * indicate the minimum length. The English parser uses a truncation
137 * length of 6 letters by default.
138 *
139 * Set this to nil if the game doesn't allow truncation at all.
140 */
141 truncationLength = 6
142
143 /*
144 * This property should be set on a game-by-game basis to indicate
145 * the "cruelty level" of the game, which is a rough estimation of
146 * how likely it is that the player will encounter an unwinnable
147 * position in the game.
148 *
149 * Level 0 is "kind," which means that the player character can
150 * never be killed, and it's impossible to make the game unwinnable.
151 * When this setting is used, the instructions will reassure the
152 * player that saving is necessary only to suspend the session.
153 *
154 * Level 1 is "standard," which means that the player character can
155 * be killed, and/or that unwinnable positions are possible, but
156 * that there are no especially bad unwinnable situations. When
157 * this setting is selected, we'll warn the player that they should
158 * save every so often.
159 *
160 * (An "especially bad" situation is one in which the game becomes
161 * unwinnable at some point, but this won't become apparent to the
162 * player until much later. For example, suppose the first scene
163 * takes place in a location that can never be reached again after
164 * the first scene, and suppose that there's some object you can
165 * obtain in this scene. This object will be required in the very
166 * last scene to win the game; if you don't have the object, you
167 * can't win. This is an "especially bad" unwinnable situation: if
168 * you leave the first scene without getting the necessary object,
169 * the game is unwinnable from that point forward. In order to win,
170 * you have to go back and play almost the whole game over again.
171 * Saved positions are almost useless in a case like this, since
172 * most of the saved positions will be after the fatal mistake; no
173 * matter how often you saved, you'll still have to go back and do
174 * everything over again from near the beginning.)
175 *
176 * Level 2 is "cruel," which means that the game can become
177 * unwinnable in especially bad ways, as described above. If this
178 * level is selected, we'll warn the player more sternly to save
179 * frequently.
180 *
181 * We set this to 1 ("standard") by default, because even games that
182 * aren't intentionally designed to be cruel often have subtle
183 * situations where the game becomes unwinnable, because of things
184 * like the irreversible loss of an object, or an unrepeatable event
185 * sequence; it almost always takes extra design work to ensure that
186 * a game is always winnable.
187 */
188 crueltyLevel = 1
189
190 /*
191 * Does this game have any real-time features? If so, set this to
192 * true. By default, we'll explain that game time passes only in
193 * response to command input.
194 */
195 isRealTime = nil
196
197 /*
198 * Conversation system description. Several different conversation
199 * systems have come into relatively widespread use, so there isn't
200 * any single convention that's generic enough that we can assume it
201 * holds for all games. In deference to this variability, we
202 * provide this hook to make it easy to replace the instructions
203 * pertaining to the conversation system. If the game uses the
204 * standard ASK/TELL system, it can leave this list unchanged; if
205 * the game uses a different system, it can replace this with its
206 * own instructions.
207 *
208 * We'll include information on the TALK TO command if there are any
209 * in-conversation state objects in the game; if not, we'll assume
210 * there's no need for this command.
211 *
212 * We'll mention the TOPICS command if there are any SuggestedTopic
213 * instances in the game; if not, then the game will never have
214 * anything to suggest, so the TOPICS command isn't needed.
215 *
216 * We'll include information on special topics if there are any
217 * SpecialTopic objects defined.
218 */
219 conversationInstructions =
220 "You can talk to other characters by asking or
221 telling them about things in the story. For example, you might
222 ASK WIZARD ABOUT WAND or TELL GUARD ABOUT ALARM. You should
223 always use the ASK ABOUT or TELL ABOUT phrasing; the story
224 won’t be able to understand other formats, so you don’t
225 have to worry about thinking up complicated questions like <q>ask
226 guard how to open the window.</q>
227 In most cases, you&rsquo;ll get the best results by asking
228 about specific objects or other characters you&rsquo;ve encountered
229 in the story, rather than about abstract topics such as
230 MEANING OF LIFE; however, if something in the story leads you
231 to believe you <i>should</i> ask about some particular abstract
232 topic, it can&rsquo;t hurt to try.
233
234 \bIf you&rsquo;re asking or telling the same person about several
235 topics in succession, you can save some typing by abbreviating
236 ASK ABOUT to A, and TELL ABOUT to T. For example, once you&rsquo;re
237 talking to the wizard, you can abbreviate ASK WIZARD ABOUT AMULET
238 to simply A AMULET. This addresses the question to the same
239 character as in the last ASK or TELL.
240
241 <<firstObj(InConversationState, ObjInstances) != nil ?
242 "\bTo greet another character, type TALK TO (Person). This
243 tries to get the other character&rsquo;s attention and start a
244 conversation. TALK TO is always optional, since you can start
245 in with ASK or TELL directly if you prefer." : "">>
246
247 <<firstObj(SpecialTopic, ObjInstances) != nil ?
248 "\bThe story might occasionally suggest some special conversation
249 commands, like this:
250
251 \b\t(You could apologize, or explain about the aliens.)
252
253 \bIf you like, you can use one of the suggestions just by
254 typing in the special phrasing shown. You can usually
255 abbreviate these to the first few words when they&rsquo;re long.
256
257 \b\t&gt;APOLOGIZE
258 \n\t&gt;EXPLAIN ABOUT ALIENS
259
260 \bSpecial suggestions like this only work right at the moment
261 they&rsquo;re offered, so you don&rsquo;t have to worry about
262 memorizing them, or trying them at other random times in the story.
263 They&rsquo;re not new commands for you to learn; they&rsquo;re just
264 extra options you have at specific times, and the story will always
265 let you know when they&rsquo;re available. When the story offers
266 suggestions like this, they don&rsquo;t limit what you can do; you
267 can still type any ordinary command instead of one of the
268 suggestions." : "">>
269
270 <<firstObj(SuggestedTopic, ObjInstances) != nil ?
271 "\bIf you&rsquo;re not sure what to discuss, you can type TOPICS any
272 time you&rsquo;re talking to someone. This will show you a list of
273 things that your character might be interested in discussing
274 with the other person. The TOPICS command usually won&rsquo;t list
275 everything that you can discuss, so feel free to explore other
276 topics even if they&rsquo;re not listed." : "">>
277
278 \bYou can also interact with other characters using physical
279 objects. For example, you might be able to give something to
280 another character, as in GIVE MONEY TO CLERK, or show an object
281 to someone, as in SHOW IDOL TO PROFESSOR. You might also be
282 able to fight other characters, as in ATTACK TROLL WITH
283 SWORD or THROW AXE AT DWARF.
284
285 \bIn some cases, you can tell a character to do
286 something for you. You do this by typing the character&rsquo;s name,
287 then a comma, then the command you want the character to perform,
288 using the same wording you&rsquo;d use for a command to your own
289 character. For example:
290
291 \b\t&gt;ROBOT, GO NORTH
292
293 \bKeep in mind, though, that there&rsquo;s no guarantee that other
294 characters will always obey your orders. Most characters have
295 minds of their own and won&rsquo;t automatically do whatever you
296 ask. "
297
298 /* execute the command */
299 execSystemAction()
300 {
301 local origElapsedTime;
302
303 /*
304 * note the elapsed game time on the real-time clock before we
305 * start, so that we can reset the game time when we're done; we
306 * don't want the instructions display to consume any real game
307 * time
308 */
309 origElapsedTime = realTimeManager.getElapsedTime();
310
311 /* show the instructions */
312 showInstructions();
313
314 /* reset the real-time game clock */
315 realTimeManager.setElapsedTime(origElapsedTime);
316 }
317
318 #ifdef INSTRUCTIONS_MENU
319 /*
320 * Show the instructions, using a menu-based table of contents.
321 */
322 showInstructions()
323 {
324 /* run the instructions menu */
325 topInstructionsMenu.display();
326
327 /* show an acknowledgment */
328 "Done. ";
329 }
330
331 #else /* INSTRUCTIONS_MENU */
332
333 /*
334 * Show the instructions as a standard text display. Give the user
335 * the option of turning on a SCRIPT file to capture the text.
336 */
337 showInstructions()
338 {
339 local startedScript;
340
341 /* presume we won't start a new script file */
342 startedScript = nil;
343
344 /* show the introductory message */
345 "The story is about to show a full set of instructions,
346 designed especially for people who aren&rsquo;t already familiar
347 with interactive fiction. The instructions are lengthy";
348
349 /*
350 * Check to see if we're already scripting. If we aren't, offer
351 * to save the instructions to a file.
352 */
353 if (scriptStatus.scriptFile == nil)
354 {
355 local str;
356
357 /*
358 * they're not already logging; ask if they'd like to start
359 * doing so
360 */
361 ", so you might want to capture them to a file (so that
362 you can print them out, for example). Would you like to
363 proceed?
364 \n(<<aHref('yes', 'Y')>> is affirmative, or type
365 <<aHref('script', 'SCRIPT')>> to capture to a file) &gt; ";
366
367 /* ask for input */
368 str = inputManager.getInputLine(nil, nil);
369
370 /* if they want to capture them to a file, set up scripting */
371 if (rexMatch('<nocase><space>*s(c(r(i(pt?)?)?)?)?<space>*', str)
372 == str.length())
373 {
374 /* try setting up a scripting file */
375 ScriptAction.setUpScripting(nil);
376
377 /* if that failed, don't proceed */
378 if (scriptStatus.scriptFile == nil)
379 return;
380
381 /* note that we've started a script file */
382 startedScript = true;
383 }
384 else if (rexMatch('<nocase><space>*y.*', str) != str.length())
385 {
386 "Canceled. ";
387 return;
388 }
389 }
390 else
391 {
392 /*
393 * they're already logging; just confirm that they want to
394 * see the instructions
395 */
396 "; would you like to proceed?
397 \n(Y is affirmative) &gt; ";
398
399 /* stop if they don't want to proceed */
400 if (!yesOrNo())
401 {
402 "Canceled. ";
403 return;
404 }
405 }
406
407 /* make sure we have something for the next "\b" to skip from */
408 "\ ";
409
410 /* show each chapter in turn */
411 showCommandsChapter();
412 showAbbrevChapter();
413 showTravelChapter();
414 showObjectsChapter();
415 showConversationChapter();
416 showTimeChapter();
417 showSaveRestoreChapter();
418 showSpecialCmdChapter();
419 showUnknownWordsChapter();
420 showAmbiguousCmdChapter();
421 showAdvancedCmdChapter();
422 showTipsChapter();
423
424 /* if we started a script file, close it */
425 if (startedScript)
426 ScriptOffAction.turnOffScripting(nil);
427 }
428
429 #endif /* INSTRUCTIONS_MENU */
430
431 /* Entering Commands chapter */
432 showCommandsChapter()
433 {
434 "\b<b>Entering Commands</b>\b
435 You&rsquo;ve probably already noticed that you interact with the story
436 by typing a command whenever you see the <q>prompt,</q> which
437 usually looks like this:
438 \b";
439
440 gLibMessages.mainCommandPrompt(rmcCommand);
441
442 "\bKnowing this much, you&rsquo;re probably thinking one of two things:
443 <q>Great, I can type absolutely anything I want, in plain English,
444 and the story will do my bidding,</q> or <q>Great, now I have to
445 figure out yet another heinously complex command language for
446 a computer program; I think I&rsquo;ll go play Minesweeper.</q>
447 Well, neither extreme is quite true.
448
449 \bIn actual play, you&rsquo;ll only need a fairly small set of
450 commands, and the commands are mostly in ordinary English, so
451 there&rsquo;s not very much you&rsquo;ll have to learn or remember.
452 Even though that command prompt can look intimidating, don&rsquo;t
453 let it scare you off &mdash; there are just a few simple things you
454 have to know.
455
456 \bFirst, you&rsquo;ll almost never have to refer to anything that
457 isn&rsquo;t directly mentioned in the story; this is a story, after
458 all, not a guessing game where you have to think of everything that
459 goes together with some random object. For example, if
460 you&rsquo;re wearing a jacket, you might assume that the jacket has
461 pockets, or buttons, or a zipper &mdash; but if the story never
462 mentions those things, you shouldn&rsquo;t have to worry about them.
463
464 \bSecond, you won&rsquo;t have to think of every conceivable action
465 you could perform. The point of the game isn&rsquo;t to make you
466 guess at verbs. Instead, you&rsquo;ll only have to use a relatively
467 small number of simple, ordinary actions. To give you an idea
468 of what we mean, here are some of the commands you can use:";
469
470 "\b
471 \n\t LOOK AROUND
472 \n\t INVENTORY
473 \n\t GO NORTH (or EAST, SOUTHWEST, and so on, or UP, DOWN, IN, OUT)
474 \n\t WAIT
475 \n\t TAKE THE BOX
476 \n\t DROP THE DISK
477 \n\t LOOK AT THE DISK
478 \n\t READ THE BOOK
479 \n\t OPEN BOX
480 \n\t CLOSE BOX
481 \n\t LOOK IN THE BOX
482 \n\t LOOK THROUGH WINDOW
483 \n\t PUT FLOPPY DISK INTO BOX
484 \n\t PUT BOX ON TABLE
485 \n\t WEAR THE CONICAL HAT
486 \n\t TAKE OFF HAT
487 \n\t TURN ON LANTERN
488 \n\t LIGHT MATCH
489 \n\t LIGHT CANDLE WITH MATCH
490 \n\t PUSH BUTTON
491 \n\t PULL LEVER
492 \n\t TURN KNOB
493 \n\t TURN DIAL TO 11
494 \n\t EAT COOKIE
495 \n\t DRINK MILK
496 \n\t THROW PIE AT CLOWN
497 \n\t ATTACK TROLL WITH SWORD
498 \n\t UNLOCK DOOR WITH KEY
499 \n\t LOCK DOOR WITH KEY
500 \n\t CLIMB THE LADDER
501 \n\t GET IN THE CAR
502 \n\t SIT ON THE CHAIR
503 \n\t STAND ON THE TABLE
504 \n\t STAND IN FLOWER BED
505 \n\t LIE ON THE BED
506 \n\t TYPE HELLO ON COMPUTER
507 \n\t LOOK UP BOB IN PHONE BOOK";
508
509 /* show the conversation-related verbs */
510 foreach (local cur in conversationVerbs)
511 "\n\t <<cur>>";
512
513 /* show the custom verbs */
514 foreach (local cur in customVerbs)
515 "\n\t <<cur>>";
516
517 /*
518 * if the list is exhaustive, say so; otherwise, mention that
519 * there might be some other verbs to find
520 */
521 if (allRequiredVerbsDisclosed)
522 "\bThat&rsquo;s it &mdash; every verb and every command phrasing
523 you need to complete the story is shown above.
524 If you ever get stuck and feel like the story is expecting
525 you to think of something completely out of the blue, remember
526 this: whatever it is you have to do, you can do it with one
527 or more of the commands shown above.
528 Don&rsquo;t ever worry that you have to start trying lots of
529 random commands to hit upon the magic phrasing, because
530 everything you need is shown plainly above. ";
531 else
532 "\bMost of the verbs you&rsquo;ll need to complete the story are
533 shown above; there might be a few additional commands you&rsquo;ll
534 need from time to time as well, but they&rsquo;ll follow the same
535 simple format as the commands above.";
536
537 "\bA few of these commands deserve some more explanation.
538 LOOK AROUND (which you abbreviate to LOOK, or even just L)
539 shows the description of the current location. You can use
540 this if you want to refresh your memory of your character&rsquo;s
541 surroundings. INVENTORY (or just I) shows a list of everything
542 your character is carrying. WAIT (or Z) just lets a little
543 time pass in the story.";
544 }
545
546 /* Abbreviations chapter */
547 showAbbrevChapter()
548 {
549 "\b<b>Abbreviations</b>
550 \bYou&rsquo;ll probably use a few commands quite a lot, so to save
551 typing, you can abbreviate some of the most frequently-used
552 commands:
553
554 \b
555 \n\t LOOK AROUND can be shortened to LOOK, or merely L
556 \n\t INVENTORY can be simply I
557 \n\t GO NORTH can be written NORTH, or even just N (likewise E, W, S,
558 NE, SE, NW, SW, U for UP and D for DOWN)
559 \n\t LOOK AT THE DISK can be entered as EXAMINE DISK or simply X DISK
560 \n\t WAIT can be shortened to Z
561 <<conversationAbbr>>
562
563 \b<b>A Few More Command Details</b>
564 \bWhen you&rsquo;re entering commands, you can use capital or small
565 letters in any mixture. You can use words such as THE and A
566 when they&rsquo;re appropriate, but you can omit them if you
567 prefer. ";
568
569 if (truncationLength != nil)
570 {
571 "You can abbreviate any word to its first <<
572 spellInt(truncationLength)>> letters, but if you choose not
573 to abbreviate, the story will pay attention to
574 everything you actually type; this means, for example, that you
575 can abbreviate SUPERCALIFRAGILISTICEXPIALIDOCIOUS to <<
576 'SUPERCALIFRAGILISTICEXPIALIDOCIOUS'.substr(1, truncationLength)
577 >> or <<
578 'SUPERCALIFRAGILISTICEXPIALIDOCIOUS'.substr(1, truncationLength+2)
579 >>, but not to <<
580 'SUPERCALIFRAGILISTICEXPIALIDOCIOUS'.substr(1, truncationLength)
581 >>SDF. ";
582 }
583 }
584
585 /* Travel chapter */
586 showTravelChapter()
587 {
588 "\b<b>Travel</b>
589 \bAt any given time in the story, your character is in a
590 <q>location.</q> The story describes the location when your
591 character first enters, and again any time you type LOOK.
592 Each location usually has a short name that&rsquo;s displayed just
593 before its full description; the name is useful when drawing a map,
594 and the short name can help jog your memory as you&rsquo;re finding
595 your way around.
596
597 \bEach location is a separate room, or a large outdoor area,
598 or the like. (Sometimes a single physical room is so large that
599 it comprises several locations in the game, but that&rsquo;s fairly
600 rare.) For the most part, going to a location is as specific
601 as you have to get about travel; once your character is in a
602 location, the character can usually see and reach everything
603 within the location, so you don&rsquo;t have to worry about where
604 exactly your character is standing within the room. Once in
605 a while, you might find that something is out of reach, perhaps
606 because it&rsquo;s on a high shelf or on the other side of a moat; in
607 these cases, it&rsquo;s sometimes useful to be more specific about
608 your character&rsquo;s location, such as by standing on something
609 (STAND ON TABLE, for example).
610
611 \bTraveling from one location to another is usually done using
612 a direction command: GO NORTH, GO NORTHEAST, GO UP, and so on.
613 (You can abbreviate the cardinal and vertical directions to one
614 letter each &mdash; N, S, E, W, U, D &mdash; and the diagonal
615 directions to two: NE, NW, SE, SW.) The story should always
616 tell you the directions that you can go when it describes a
617 location, so you should never have to try all the unmentioned
618 directions to see if they go anywhere.
619
620 \bIn most cases, backtracking (by reversing the direction you
621 took from one location to another) will take you back to where you
622 started, although some passages might have turns.
623
624 \bMost of the time, when the story describes a door or passageway,
625 you won&rsquo;t need to open the door to go through the passage, as
626 the story will do this for you. Only when the story specifically
627 states that a door is blocking your way will you usually have to
628 deal with the door explicitly.";
629 }
630
631 /* Objects chapter */
632 showObjectsChapter()
633 {
634 "\b<b>Manipulating Objects</b>
635 \bYou might find objects in the story that your character can
636 carry or otherwise manipulate. If you want to carry something,
637 type TAKE and the object&rsquo;s name: TAKE BOOK. If you want to
638 drop something your character is carrying, DROP it.
639
640 \bYou usually won&rsquo;t have to be very specific about exactly
641 how your character is supposed to carry or hold something, so you
642 shouldn&rsquo;t have to worry about which hand is holding which item
643 or anything like that. It might sometimes be useful to put one
644 object inside or on top of another, though; for example, PUT BOOK
645 IN SHOPPING BAG or PUT VASE ON TABLE. If your character&rsquo;s
646 hands get full, it might help to put some items being carried
647 into a container, much as in real life you can carry more stuff
648 if it&rsquo;s in a bag or a box.
649
650 \bYou can often get a lot of extra information (and sometimes
651 vital clues) by examining objects, which you can do with the LOOK
652 AT command (or, equivalently, EXAMINE, which you can abbreviate
653 to simply X, as in X PAINTING). Most experienced players get
654 in the habit of examining everything in a new location right
655 away. ";
656 }
657
658 /* show the Conversation chapter */
659 showConversationChapter()
660 {
661 "\b<b>Interacting with Other Characters</b>
662 \bYour character may encounter other people or creatures in the
663 story. You can sometimes interact with these characters.\b";
664
665 /* show the customizable conversation instructions */
666 conversationInstructions;
667 }
668
669 /* Time chapter */
670 showTimeChapter()
671 {
672 "\b<b>Time</b>";
673
674 if (isRealTime)
675 {
676 "\bTime passes in the story in response to the commands
677 you type. In addition, some parts of the story
678 might unfold in <q>real time,</q> which means that things
679 can happen even while you&rsquo;re thinking about your next move.
680
681 \bIf you want to stop the clock while you&rsquo;re away from your
682 computer for a moment (or you just need some time to think),
683 you can type PAUSE.";
684 }
685 else
686 {
687 "\bTime passes in the story only in response to commands
688 you type. This means that nothing happens while the story
689 is waiting for you to type something. Each command takes
690 about the same amount of time in the story. If you
691 specifically want to let some extra time pass within the
692 story, because you think something is about to happen,
693 you can type WAIT (or just Z). ";
694 }
695 }
696
697 /* Saving, Restoring, and Undo chapter */
698 showSaveRestoreChapter()
699 {
700 "\b<b>Saving and Restoring</b>
701 \bYou can save a snapshot of your current position in the story
702 at any time, so that you can later restore the story to the
703 same position. The snapshot will be saved to a file on your
704 computer&rsquo;s disk, and you can save as many different snapshots
705 as you&rsquo;d like (to the extent you have space on your disk,
706 anyway).\b";
707
708 switch (crueltyLevel)
709 {
710 case 0:
711 "In this story, your character will never be killed, and
712 you&rsquo;ll never find yourself in a situation where
713 it&rsquo;s impossible to complete the story. Whatever happens
714 to your character, you&rsquo;ll always be able to find a way
715 to complete the story. So, unlike in many text games, you
716 don&rsquo;t have to worry about saving positions to protect
717 yourself against getting stuck in impossible situations. Of
718 course, you can still save as often as you&rsquo;d like, to
719 suspend your session and return to it later, or to save
720 positions that you think you might want to revisit.";
721 break;
722
723 case 1:
724 case 2:
725 "It might be possible for your character to be killed in
726 the story, or for you to find your character in an impossible
727 situation where you won&rsquo;t be able to complete the story.
728 So, you should be sure to save your position
729 <<crueltyLevel == 1 ? 'from time to time' : 'frequently'>>
730 so that you won&rsquo;t have to go back too far if this should
731 happen. ";
732
733 if (crueltyLevel == 2)
734 "(You should make a point of keeping all of your old saved
735 positions, too, because you might not always realize
736 immediately when a situation has become impossible.
737 You might find at times that you need to go back further
738 than just the last position that you <i>thought</i>
739 was safe.)";
740
741 break;
742 }
743
744 "\bTo save your position, type SAVE at the command prompt.
745 The story will ask you for the name of a disk file to use to store
746 snapshot. You&rsquo;ll have to specify a filename suitable for
747 your computer system, and the disk will need enough free space
748 to store the file; you&rsquo;ll be told if there&rsquo;s any problem
749 saving the file. You should use a filename that doesn&rsquo;t already
750 exist on your machine, because the new file will overwrite any
751 existing file with the same name.
752
753 \bYou can restore a previously saved position by typing RESTORE
754 at any prompt. The story will ask you for the name of the file
755 to restore. After the computer reads the file, everything in
756 the story will be exactly as it was when you saved that file.";
757
758 "\b<b>Undo</b>
759 \bEven if you haven&rsquo;t saved your position recently, you can
760 usually take back your last few commands with the UNDO command.
761 Each time you type UNDO, the story reverses the effect of one command,
762 restoring the story as it was before you typed that command. UNDO
763 is limited to taking back the last few commands, so this isn&rsquo;t
764 a substitute for SAVE/RESTORE, but it&rsquo;s very handy if you
765 find your character unexpectedly in a dangerous situation, or you
766 make a mistake you want to take back.";
767 }
768
769 /* Other Special Commands chapter */
770 showSpecialCmdChapter()
771 {
772 "\b<b>Some Other Special Commands</b>
773 \bThe story understands a few other special commands that
774 you might find useful.
775
776 \bAGAIN (or just G): Repeats the last command. (If your last input
777 line had several commands, only the last single command on the line
778 is repeated.)
779 \bINVENTORY (or just I): Shows what your character is carrying.
780 \bLOOK (or just L): Shows the full description of your
781 character&rsquo;s current location.";
782
783 /* if the exit lister module is active, mention the EXITS command */
784 if (gExitLister != nil)
785 "\bEXITS: Shows the list of obvious exits from the current
786 location.
787 \bEXITS ON/OFF/STATUS/LOOK: Controls the way the game
788 displays exit lists. EXITS ON puts a list of
789 exits in the status line and also lists exits in each room
790 description. EXITS OFF turns off both of these listings.
791 EXITS STATUS turns on just the status line exit list, and
792 EXITS ROOM turns on only the room description lists.";
793
794 "\bOOPS: Corrects a single misspelled word in a command, without
795 retyping the entire command. You can only use OOPS immediately
796 after the story tells you it didn&rsquo;t recognize a word in your
797 previous command. Type OOPS followed by the corrected word.
798 \bQUIT (or just Q): Terminates the story.
799 \bRESTART: Starts the story over from the beginning.
800 \bRESTORE: Restores a position previously saved with SAVE.
801 \bSAVE: Saves the current position in a disk file.
802 \bSCRIPT: Starts making a transcript of your story session,
803 saving all of the displayed text to a disk file, so that you
804 can peruse it later or print it out.
805 \bSCRIPT OFF: Ends a transcript that you started with SCRIPT.
806 \bUNDO: Takes back the last command.
807 \bSAVE DEFAULTS: Saves your current settings for things like
808 NOTIFY, EXITS, and FOOTNOTES as defaults. This means that your
809 settings will be restored automatically the next time you start
810 a new game, or RESTART this one.
811 \bRESTORE DEFAULTS: Explicitly restores the option settings
812 you previously saved with SAVE DEFAULTS. ";
813 }
814
815 /* Unknown Words chapter */
816 showUnknownWordsChapter()
817 {
818 "\b<b>Unknown Words</b>
819 \bThe story doesn&rsquo;t pretend to know every word in the English
820 language. The story might even occasionally use words in its
821 own descriptions that it doesn&rsquo;t understand in commands. If
822 you type a command with a word the story doesn&rsquo;t know, the
823 story will tell you which word it didn&rsquo;t recognize. If the
824 story doesn&rsquo;t know a word for something it described, and
825 it doesn&rsquo;t know any synonyms for that thing, you can probably
826 assume that the object is just there as a detail of the setting,
827 and isn&rsquo;t important to the story. ";
828 }
829
830 /* Ambiguous Commands chapter */
831 showAmbiguousCmdChapter()
832 {
833 "\b<b>Ambiguous Commands</b>
834 \bIf you type a command that leaves out some important information,
835 the story will try its best to figure out what you mean. Whenever
836 it&rsquo;s reasonably obvious from context what you mean, the story
837 will make an assumption about the missing information and proceed
838 with the command. The story will point out what it&rsquo;s assuming
839 in these cases, to avoid any confusion from a mismatch between the
840 story&rsquo;s assumptions and yours. For example:
841
842 \b
843 \n\t &gt;TIE THE ROPE
844 \n\t (to the hook)
845 \n\t The rope is now tied to the hook. The end of the
846 \n\t rope nearly reaches the floor of the pit below.
847
848 \bIf the command is ambiguous enough that the story can&rsquo;t
849 safely make an assumption, you&rsquo;ll be asked for more
850 information. You can answer these questions by typing the
851 missing information.
852
853 \b
854 \n\t &gt;UNLOCK THE DOOR
855 \n\t What do you want to unlock it with?
856 \b
857 \n\t &gt;KEY
858 \n\t Which key do you mean, the gold key, or the silver key?
859 \b
860 \n\t &gt;GOLD
861 \n\t Unlocked.
862
863 \bIf the story asks you one of these questions, and you decide
864 that you don&rsquo;t want to proceed with the original command after
865 all, you can just type in a brand new command instead of answering
866 the question.";
867 }
868
869 /* Advance Command Formats chapter */
870 showAdvancedCmdChapter()
871 {
872 "\b<b>Advanced Command Formats</b>
873 \bOnce you get comfortable with entering commands, you might
874 be interested to know about some more complex command formats
875 that the story will accept. These advanced commands are all
876 completely optional, because you can always do the same things
877 with the simpler formats we&rsquo;ve talked about so far, but
878 experienced players often like the advanced formats because
879 they can save you a little typing.
880
881 \b<b>Using Multiple Objects at Once</b>
882 \bIn most commands, you can operate on multiple objects in
883 a single command. Use the word AND, or a comma, to separate
884 one object from another:
885
886 \b
887 \n\t TAKE THE BOX, THE FLOPPY DISK, AND THE ROPE
888 \n\t PUT DISK AND ROPE IN BOX
889 \n\t DROP BOX AND ROPE
890
891 \bYou can use the words ALL and EVERYTHING to refer to everything
892 applicable to your command, and you can use EXCEPT or BUT
893 (right after the word ALL) to exclude specific objects:
894
895 \b
896 \n\t TAKE ALL
897 \n\t PUT ALL BUT DISK AND ROPE INTO BOX
898 \n\t TAKE EVERYTHING OUT OF THE BOX
899 \n\t TAKE ALL OFF SHELF
900
901 \bALL refers to everything that makes sense for your command,
902 excluding things inside other objects matching the ALL. For example,
903 if you&rsquo;re carrying a box and a rope, and the box contains
904 a floppy disk, typing DROP ALL will drop the box and the rope,
905 and the floppy will remain in the box.
906
907 \b<b><q>It</q> and <q>Them</q></b>
908 \bYou can use IT and THEM to refer to the last object or objects
909 that you used in a command:
910
911 \b
912 \n\t TAKE THE BOX
913 \n\t OPEN IT
914 \n\t TAKE THE DISK AND THE ROPE
915 \n\t PUT THEM IN THE BOX
916
917 \b<b>Multiple Commands At Once</b>
918 \bYou can put multiple commands on a single input line by
919 separating the commands with periods or the word THEN, or
920 with a comma or AND. For example:
921
922 \b
923 \n\t TAKE THE DISK AND PUT IT IN THE BOX
924 \n\t TAKE BOX. OPEN IT.
925 \n\t UNLOCK THE DOOR WITH THE KEY. OPEN IT, THEN GO NORTH.
926
927 \b If the story doesn&rsquo;t understand one of the commands, it will
928 tell you what it couldn&rsquo;t understand, and ignore everything after
929 that on the line.";
930 }
931
932 /* General Tips chapter */
933 showTipsChapter()
934 {
935 "\b<b>A Few Tips</b>
936 \bNow that you know the technical details of entering commands,
937 you might be interested in some strategy pointers. Here are
938 a few techniques that experienced interactive fiction players use
939 when approaching a story.
940
941 \bEXAMINE everything, especially when you enter a new location
942 for the first time. Looking at objects will often reveal details
943 that aren&rsquo;t mentioned in the broader description of the location.
944 If examining an object mentions detailed parts of the object,
945 examine them as well.
946
947 \bMake a map, if the story has more than a few locations. When
948 you encounter a new location for the first time, note all of its
949 exits; this will make it easy to see at a glance if there are any
950 exits you haven&rsquo;t explored yet. If you get stuck, you can scan
951 your map for any unexplored areas, where you might find what
952 you&rsquo;re looking for.
953
954 \bIf the story doesn&rsquo;t recognize a word or any of its synonyms,
955 the object you&rsquo;re trying to manipulate probably isn&rsquo;t
956 important to the story. If you try manipulating something, and the
957 story responds with something like <q>that isn&rsquo;t important,</q>
958 you can probably just ignore the object; it&rsquo;s most likely just
959 there as scenery, to make the setting more detailed.
960
961 \bIf you&rsquo;re trying to accomplish something, and nothing you do
962 seems to work, pay attention to what&rsquo;s going wrong. If
963 everything you try is met with utter dismissal (<q>nothing
964 happens</q> or <q>that&rsquo;s not something you can open</q>), you
965 might simply be on the wrong track; step back and think about other
966 ways of approaching the problem. If the response is something more
967 specific, it might be a clue. <q>The guard says <q>you can&rsquo;t
968 open that here!</q>\ and snatches the box from your hands</q> &mdash;
969 this might indicate that you have to get the guard to leave, or
970 that you should take the box somewhere else before you open it,
971 for example.
972
973 \bIf you get completely stuck, you might try setting aside the
974 current puzzle and working on a different problem for a while.
975 You might even want to save your position and take a break from
976 the game. The solution to the problem that&rsquo;s been
977 thwarting your progress might come to you in a flash of insight
978 when you least expect it, and those moments of insight can be
979 incredibly rewarding. Some stories are best appreciated when
980 played over a period of days, weeks, or even months; if you&rsquo;re
981 enjoying the story, why rush through it?
982
983 \bFinally, if all else fails, you can try asking for help. A
984 great place to go for hints is the Usenet newsgroup
985 <a href='news:rec.games.int-fiction'>rec.games.int-fiction</a>. ";
986
987 "\n";
988 }
989
990 /* INSTRUCTIONS doesn't affect UNDO or AGAIN */
991 isRepeatable = nil
992 includeInUndo = nil
993 ;
994
995
996 /* ------------------------------------------------------------------------ */
997 /*
998 * define the INSTRUCTIONS command's grammar
999 */
1000 VerbRule(instructions) 'instructions' : InstructionsAction
1001 ;
1002
1003
1004 /* ------------------------------------------------------------------------ */
1005 /*
1006 * The instructions, rendered in menu form. The menu format helps break
1007 * up the instructions by dividing the instructions into chapters, and
1008 * displaying a menu that lists the chapters. This way, players can
1009 * easily go directly to the chapters they're most interested in, but
1010 * can also still read through the whole thing fairly easily.
1011 *
1012 * To avoid creating an unnecessary dependency on the menu subsystem for
1013 * games that don't want the menu-style instructions, we'll only define
1014 * the menu objects if the preprocessor symbol INSTRUCTIONS_MENU is
1015 * defined. So, if you want to use the menu-style instructions, just
1016 * add -D INSTRUCTIONS_MENU to your project makefile.
1017 */
1018 #ifdef INSTRUCTIONS_MENU
1019
1020 /* a base class for the instruction chapter menus */
1021 class InstructionsMenu: MenuLongTopicItem
1022 /*
1023 * present the instructions in "chapter" format, so that we can
1024 * navigate from one chapter directly to the next
1025 */
1026 isChapterMenu = true
1027
1028 /* the InstructionsAction property that we invoke to show our chapter */
1029 chapterProp = nil
1030
1031 /* don't use a heading, as we provide our own internal chapter titles */
1032 heading = ''
1033
1034 /* show our chapter text */
1035 menuContents = (InstructionsAction.(self.chapterProp)())
1036 ;
1037
1038 InstructionsMenu template 'title' ->chapterProp;
1039
1040 /*
1041 * The main instructions menu. This can be used as a top-level menu;
1042 * just call the 'display()' method on this object to display the menu.
1043 * This can also be used as a sub-menu of any other menu, simply by
1044 * inserting this menu into a parent menu's 'contents' list.
1045 */
1046 topInstructionsMenu: MenuItem 'How to Play Interactive Fiction';
1047
1048 /* the chapter menus */
1049 + MenuLongTopicItem
1050 isChapterMenu = true
1051 title = 'Introduction'
1052 heading = nil
1053 menuContents()
1054 {
1055 "\b<b>Introduction</b>
1056 \bWelcome! If you&rsquo;ve never played Interactive Fiction
1057 before, these instructions are designed to help you
1058 get started. If you already know how to play this kind
1059 of game, you can probably skip the full instructions, but
1060 you might want to type ABOUT at the command prompt for a
1061 summary of the special features of this story.
1062 \b
1063 To make the instructions easier to navigate, they&rsquo;re
1064 broken up into chapters. ";
1065
1066 if (curKeyList != nil && curKeyList.length() > 0)
1067 "At the end of each chapter, just press
1068 <b><<curKeyList[M_SEL][1].toUpper()>></b> to proceed to
1069 the next chapter, or <b><<curKeyList[M_PREV][1].toUpper()>></b>
1070 to return to the chapter list. ";
1071 else
1072 "To flip through the chapters, click on the links or
1073 use the Left/Right arrow keys. ";
1074 }
1075 ;
1076
1077 + InstructionsMenu 'Entering Commands' ->(&showCommandsChapter);
1078 + InstructionsMenu 'Command Abbreviations' ->(&showAbbrevChapter);
1079 + InstructionsMenu 'Travel' ->(&showTravelChapter);
1080 + InstructionsMenu 'Manipulating Objects' ->(&showObjectsChapter);
1081 + InstructionsMenu 'Interacting with Other Characters'
1082 ->(&showConversationChapter);
1083 + InstructionsMenu 'Time' ->(&showTimeChapter);
1084 + InstructionsMenu 'Saving and Restoring' ->(&showSaveRestoreChapter);
1085 + InstructionsMenu 'Other Special Commands' ->(&showSpecialCmdChapter);
1086 + InstructionsMenu 'Unknown Words' ->(&showUnknownWordsChapter);
1087 + InstructionsMenu 'Ambiguous Commands' ->(&showAmbiguousCmdChapter);
1088 + InstructionsMenu 'Advanced Command Formats' ->(&showAdvancedCmdChapter);
1089 + InstructionsMenu 'A Few Tips' ->(&showTipsChapter);
1090
1091 #endif /* INSTRUCTIONS_MENU */
1092