Default Messages

version 3 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Example: * Tips & Techniques - This appendix contains phrases for miscellaneous tasks: testing and finding messages, finding bits of information, etc.

    This testing command will print the library message for any number given on the command line. For example, entering MISC 9 will print "It is now pitch dark in here!", or whatever message we've replaced it with.
        Understand "misc [number]" as a mistake ("[miscellaneous library message the number understood][run paragraph on]").
        
        To say miscellaneous library message (N - a number):
            (- L__M( ##Miscellany, {N} ); -).


    The following will print the names of all the actions as they should appear in the table. This is useful when we can't figure out the exact wording. (Note that one action, "the requesting the story file version action", has no text of its own to replace, so will never appear in our table.)
        When play begins:
            repeat with X running through all action names:
                say "[X] action."


    A common parser message in games of yore went along the lines of "I don't understand the word 'kludge'." For this, miscellaneous message #30 could use "[the misunderstood word]". Try it with "examine lovely me." Or try it in miscellaneous message #23 with "I don't know a Mr. [misunderstood word]." Test that one with "Elvis, look" after Elvis has left the story. Note that it isn't always set properly, so try many variations just in case.
        To decide which snippet is the misunderstood word:
            (- (((wn - 1) * 100) + 1) -).

    Similarly for the "I only understood you as far as examining yourself." in response to commands like EXAMINE ME CLOSELY NOW comes the rest of the phrase. See the previous example "But Then What?" for its usage.
        To decide which snippet is what was misunderstood:
            (- (((wn - 1) * 100) + (WordCount() - 2)) -).

    One more tool for some parser messages is asking whether the misunderstood word is known at all, or is known but not expected at the place where the player used it.
        To decide if the misunderstood word is known at all:
            (- (wn--, NextWord() ~= 0) -).


    Related is entering action #2, "That's not something you can enter/stand/sit on." Regardless whether the player sits on a chair, lies on a bed, climbs into a car, or stands on a stool, the same action, entering, is used. But when the player attempts these actions on something that isn't enterable, it's nice if the refusal message correctly acknowledges which action the player tried. We do this by again quoting the relevant part of the player's command, namely, "[the quoted verb]". Additionally, the standard message, in order to tack on appropriate prepositions, sends the snippet to a phrase that works much like an After Reading A Command rule. Try that one with "[the quoted verb posture]".
        To decide which snippet is the quoted verb:
            (- ((verb_wordnum * 100) + 1) -). [if command is TAKE OFF HAT, gives just TAKE]
        
        To decide which text is (quoted word - a snippet) posture:
            if the quoted word matches "stand", decide on "stand on";
            if the quoted word matches "sit", decide on "sit down on";
            if the quoted word matches "lie", decide on "lie down on";
            otherwise decide on "enter".


    Snippets in general are very useful things when used to liven up error messages. For example, replacing the bland "There is no reply." of the catch-all answering action with "'And [the topic understood] to you too, good sir,' replies [the noun]." goes a long way in sustaining versimilitude. So what, then, is a snippet? It is a run of words, entered by the player, such as "the three words starting at word #4" which picks word #4, word #5, and word #6, including the spaces between.
        To decide which snippet is the (amount - a number) words/word starting with/at word number (position - a number):
            (- (({position} * 100) + {amount}) -).

        To decide which snippet is the player's first two command words:
            decide on the two words starting with word number one.

        To decide which number is the position of the verb:
            (- (verb_wordnum) -).



    One message, taking action #13, mentions the player putting something into his holdall. While a phrase such as "[a random player's holdall]" would likely suffice when we replace the message, games with more than one holdall might need the following variable.
        The current player's holdall is a player's holdall that varies.
        The current player's holdall variable translates into I6 as "SACK_OBJECT".


    Several standard messages need to list several objects, notably opening, searching, and looking. While this may be one time where using rule-replacement is the way to go, listing the contents from a say phrase is a generally useful thing to have. And since commas cannot appear in say-phrases, try replacing them with plus signs, such as this doozy from opening action #4: "You open [the noun], revealing [if the number of not undescribed not scenery things in the noun is at least one][list the contents of the noun with the as a sentence list option + the tersely list option + the not listing concealed items list option][otherwise]nothing[end if]."

    We'll even throw in a section heading for free, keeping the contents pane of the index tidy.
        Section - List the Contents of Something, with added options
        
        To say list the contents of (X - object) with (N - number): (- WriteListFrom(child({X}), {N}); -).
        
        The as a sentence list option is a number that varies. The as a sentence list option variable translates into I6 as "ENGLISH_BIT".
        The tersely list option is a number that varies. The tersely list option variable translates into I6 as "TERSE_BIT".
        
        The is-are list option is a number that varies. The is-are list option variable translates into I6 as "ISARE_BIT".
        
        The suppressing all articles list option is a number that varies. The suppressing all articles list option variable translates into I6 as "NOARTICLE_BIT".
        The using the definite article list option is a number that varies. The using the definite article list option variable translates into I6 as "DEFART_BIT".
        The capitalise first article list option is a number that varies. The capitalise first article list option variable translates into I6 as "CFIRSTART_BIT".
        
        With newlines list option is a number that varies. The with newlines list option variable translates into I6 as "NEWLINE_BIT".
        The indented list option is a number that varies. The indented list option variable translates into I6 as "INDENT_BIT".
        With extra indentation list option is a number that varies. The with extra indentation list option variable translates into I6 as "EXTRAINDENT_BIT".
        
        The giving brief inventory information list option is a number that varies. The giving brief inventory information list option variable translates into I6 as "PARTINV_BIT".
        The giving inventory information list option is a number that varies. The giving inventory information list option variable translates into I6 as "FULLINV_BIT".
        
        The including contents list option is a number that varies. The including contents list option variable translates into I6 as "RECURSE_BIT".
        The including all contents list option is a number that varies. The including all contents list option variable translates into I6 as "ALWAYS_BIT".
        
        The not listing concealed items list option is a number that varies. The not listing concealed items list option variable translates into I6 as "CONCEAL_BIT".
        The listing marked items only list option is a number that varies. The listing marked items only list option variable translates into I6 as "WORKFLAG_BIT".


    Finally is a technical trick that could free up enough space for a page or so of prose. This extension works much like Instead Of rules: it gets first chance at any message to be printed, and when it finds a situation to which it applies (i.e., the message to be printed is in the table of custom default messages,) it says its own message "instead". The original message still sits in memory, taking up space needlessly. But because all the original messages are contained within the same monolithic rule, we cannot de-list that rule. Unless, of course, our table has all messages in it anyway. Even if we have only half the number of messages re-written, copying the remaining ones unaltered to our table could be worth it just to de-list that rule. With this:

        Include (-
        [ LanguageLM;
        #ifdef DEBUG;
            print "{ ";
            if (lm_act == ##Miscellany or ##ListMiscellany) print "library message";
            else print (SayActionName) lm_act, " action";
            print " #", lm_n, " }";
        #endif;
        ]; -) instead of "Long Texts" in "Language.i6t".

    That gains us back about 10K of memory, which is about 2K words of prose, give or take. (We do leave in an error message in the debug build to flag anything we missed, just in case.)