home *** CD-ROM | disk | FTP | other *** search
/ Fatal Distractions! / fataldistractions.bin / appndxa / masters / mast-doc.pt2 < prev    next >
Text File  |  1993-06-13  |  154KB  |  4,005 lines

  1.  
  2.  
  3.  
  4.  
  5.    A TYPICAL GAME TURN
  6.  
  7.                     ┌──────────────────────────────────┐    
  8.          ┌─────────>│     Get Player's Input Command   │<─────────┐
  9.          │          └─────────────────┬────────────────┘          │
  10.          │                            │                           │
  11.          │                            V                           │
  12.          │          ┌──────────────────────────────────┐          │
  13.          │          │ Parse into Addressee's Name (if  │          │
  14.          │          │ any), then Noun, Verb, Prep, Obj │          │
  15.          │          └─────────────────┬────────────────┘          │
  16.          │                            │                           │
  17.          │                            V                           │
  18.          │                       ┌──────────┐             ┌───────┴──────┐
  19.          │                       │   Any    │  YES        │    Give      │
  20.          │                       │  Errors  ├────────────>│    Error     │
  21.          │                       │    ?     │             │   Message    │
  22.          │                       └────┬─────┘             └──────────────┘
  23.          │                            │  NO         
  24.          │                            V                 
  25.          │                       ┌──────────┐           
  26.          │                       │   ANY    │        
  27.          │                       │  Meta-   │ NO     
  28.          │                       │ Language ├───────────────┐
  29.          │                       │ Commands │               │
  30.          │                       │    ?     │               │
  31.          │                       └────┬─────┘               │
  32.          │                            │  YES                │
  33.          │                            V                     │
  34.          │          ┌──────────────────────────────────┐    │
  35.          │          │  Do meta-commands for ANY Words  │    │
  36.          │          └─────────────────┬────────────────┘    │
  37.          │                            │                     │
  38.          │                            V                     │
  39.          │                       ┌──────────┐               │
  40.          │                  YES  │   All    │               │
  41.          │<──────────────────────┤  Done    │               │
  42.          │                       │    ?     │               │
  43.          │                       └────┬─────┘               │
  44.          │                            │                     │
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                                        63
  59.  
  60.  
  61.  
  62.  
  63.          │                            │                     │
  64.          │                            │ NO                  │
  65.          │                            V                     │
  66.          │          ┌──────────────────────────────────┐    │
  67.          │          │ Do meta-commands for Input Words │    │
  68.          │          └─────────────────┬────────────────┘    │
  69.          │                            │                     │
  70.          │                            V                     │
  71.          │                       ┌──────────┐               │
  72.          │                  YES  │   All    │               │
  73.          │<──────────────────────┤  Done    │               │
  74.          │                       │    ?     │               │
  75.          │                       └────┬─────┘               │
  76.          │                            │ NO                  │
  77.          │                            V                     │
  78.          │          ┌──────────────────────────────────┐    │
  79.          │          │ Do Standard AGT routine for Verb │<───┘
  80.          │          └─────────────────┬────────────────┘
  81.          │                            │           
  82.          │                            V                 
  83.          │                       ┌──────────┐           
  84.          │                       │   AFTER  │        
  85.          │                       │  Meta-   │ NO     
  86.          │                       │ Language ├───────────────┐
  87.          │                       │ Commands │               │
  88.          │                       │    ?     │               │
  89.          │                       └────┬─────┘               │
  90.          │                            │  YES                │
  91.          │                            V                     │
  92.          │          ┌──────────────────────────────────┐    │
  93.          │          │ Do meta-commands for AFTER Words │    │
  94.          │          └─────────────────┬────────────────┘    │
  95.          │                            │                     │
  96.          │                            V                     │
  97.          └────────────────────────────┘<────────────────────┘
  98.  
  99.    The meta-command boxes shown above are for Professional Level AGT games
  100.    only.
  101.  
  102.  
  103.    "ANY" META-COMMANDS
  104.  
  105.    Now for a brief description of what these meta-command boxes do in an AGT
  106.    game.  The first meta box represents the process of testing for conditions
  107.    and performing various actions that do not depend on the player having
  108.    given a specific Addressee-Verb-Noun-Object combination, i.e., conditions
  109.    and actions for ANY words.  These kinds of situations are typically
  110.    "random" events, such as, (1) having a dwarf appear in the room and throw
  111.    an axe at the player, or (2) having a bear (that the player has befriended)
  112.    follow him into a new room, or (3) having a voice boom out an announcement
  113.    that "The Cave will close in 25 turns", or (4) having the player die
  114.    because of some random event (e.g., falling into a pit).  During each turn,
  115.    these ANY-words meta-commands are checked to see if the commands'
  116.    conditions are true and (if true) the meta-commands' designated actions are
  117.  
  118.  
  119.  
  120.  
  121.    taken.  This ANY-words process occurs before any specific
  122.    vocabulary-dependent meta-commands are executed.  Often, the results of
  123.    these ANY-words events will make subsequent actions unnecessary and/or
  124.    inappropriate.  For example, if a player dies a horrible death by a random
  125.    dwarf attack, finishing the player's specific command like GET GOLD or
  126.    EXAMINE BOOK is certainly inappropriate.
  127.  
  128.    Here are a few examples of typical ANY Meta-Commands:
  129.  
  130.         COMMAND ANY
  131.         Present [Blazing torch]
  132.         CounterGT 2 75 ; Torch has been lit for at least 75 turns
  133.         PrintMessage [Your torch is flickering and growing weaker]
  134.         CounterEquals 2 100 ; Torch has been lit for 100 turns
  135.         PrintMessage [The torch finally goes out!]
  136.         TurnCounterOFF [Torch counter]
  137.         SwapLocations [Blazing torch] [unlit torch]
  138.         END_COMMAND
  139.  
  140.         COMMAND ANY
  141.         NOT Present [Angry guard] ; is not in room (yet)
  142.         Chance 10 ; 10 % chance of guard appearing
  143.         PutInCurrentRoom [Angry guard] ; put guard in room
  144.         PrintMessage [An angry guard suddenly storms into the room!]
  145.         END_COMMAND
  146.  
  147.         COMMAND ANY
  148.         FlagON [Flag if player has befriended parrot]
  149.         PutInCurrentRoom [Parrot] ; Once befriended, parrot stays
  150.         VerbIsDirection ; Player is going to new room
  151.         PrintMessage [The parrot flies after you and lands nearby.]
  152.         END_COMMAND
  153.  
  154.         COMMAND ANY
  155.         InRoom [Parrot] ; The parrot is here
  156.         FlagOFF [Parrot is not thirsty]
  157.         Chance 5 ; 5 % chance of parrot talking
  158.         PrintMessage [The parrot squawks "Polly wants a beer!"]
  159.         END_COMMAND
  160.  
  161.         COMMAND ANY
  162.         InRoom [vampire bat]
  163.         Chance 5 ; 5 % chance of being bitten
  164.         PrintMessage [The vampire bat bites you on the neck!!]
  165.         KillPlayer ; Too bad, but vampire bat bites are fatal!
  166.         DoneWithTurn ; No further process for this turn
  167.         END_COMMAND 
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.                                        65
  175.  
  176.  
  177.  
  178.  
  179.    META-COMMANDS FOR SPECIFIC WORDS
  180.  
  181.    If the ANY-words meta-commands have not drastically changed the player's
  182.    status in the game, then specific Addressee-Verb-Noun-Object combination
  183.    meta-commands are tested and (if the conditions are true) the designated
  184.    actions are taken.  Using these meta-commands is the way that the game
  185.    designer can use unique verbs (that are not predefined in AGT).  For
  186.    example, the game designer could specify a meta-command for KISS PRINCESS
  187.    that would first check that the princess was in the room, and (if she was)
  188.    print a message like "The princess rudely pushes you away, straightens her
  189.    crown and loudly says, 'Stop the hanky-panky, buzzard breath!'"  The word
  190.    ANY may be substituted for the Verb, or the Noun, or the Object in a
  191.    meta-command.  For example, a meta-command for ATTACK ANY might be used to
  192.    specify a "default" response for the verb ATTACK, such as, printing a
  193.    message like "Don't be ridiculous, $verb$ing the $noun$ is really sick!" 
  194.    If the player entered the command ATTACK THE DOOR, the response would be
  195.    "Don't be ridiculous, attacking the door is really sick!"
  196.  
  197.    Meta-commands can also be used to supplement or replace standard verb
  198.    processing.  For example, a meta-command could be used for verbs like READ,
  199.    GET, EAST, etc.  This type of substitution of meta-commands for standard
  200.    verbs could be used to (1) cause a key to fall out of a book the first time
  201.    the player gave the command to GET BOOK, (2) cause a player to go into a
  202.    hallucinatory state (i.e., a new room) whenever he gives the command DRINK
  203.    THE STRANGE LIQUID, or (3) cause a player to fall to his death on the rocks
  204.    far below if he gives the command NORTH (where there is a cliff to the
  205.    north in the current room).
  206.  
  207.    If after doing both the ANY-words and the specific vocabulary meta-command
  208.    processing for a specific game turn, the player is still alive and further
  209.    AGT command processing is still appropriate, then the usual routine for the
  210.    player's verb is executed (if the input VERB is a standard AGT verb).  This
  211.    will be the way that the most of the player's inputs will be handled! 
  212.    Remember, most player commands in a typical adventure game deal with
  213.    manipulating items (GET, DROP, EXAMINE, READ, etc.) and traveling from room
  214.    to room (NORTH, SOUTH, UP, EXIT, etc).  Standard Level AGT handles these
  215.    types of commands quite nicely, and there will seldom be a need for
  216.    meta-commands for this type of typical player input.
  217.  
  218.  
  219.    "AFTER" META-COMMANDS
  220.  
  221.    Finally, AFTER all of the standard processing for the VERB, the Master's
  222.    Edition of AGT will do the meta-command processing for AFTER meta-commands. 
  223.    This is very similar to ANY meta-commands -- except it is done AFTER normal
  224.    VERB processing -- rather than before like the ANY commands.
  225.  
  226.    Here are a couple of examples:
  227.  
  228.  
  229.  
  230.  
  231.  
  232.                                        66
  233.  
  234.  
  235.  
  236.  
  237.         COMMAND AFTER
  238.         FirstVisitToRoom
  239.         AtLocation [Living Room]
  240.         PrintMessage
  241.         You suddenly get a strong desire to look under the cushions on the
  242.         couch.  However, other than a moldy quarter and two pennies, you don't
  243.         find anything of interest.
  244.         END_Message
  245.         GetIt [Quarter]
  246.         GetIt [Pennies]
  247.         BlankLine
  248.         END_COMMAND
  249.  
  250.         COMMAND AFTER
  251.         NOT FirstVisitToRoom
  252.         Present [Orc]
  253.         Chance 5
  254.         PrintMessage "The orc lunges at you and you are history."
  255.         KillPlayer
  256.         DoneWithTurn
  257.         END_COMMAND
  258.  
  259.  
  260.    INTRODUCTION TO META-COMMANDS
  261.  
  262.    Meta-commands are specified in the .AGT.  In the Master's Edition, you may
  263.    have up to 900 meta-commands in your game.  This capacity will enable the
  264.    game designer to develop some very sophisticated adventure games --
  265.    especially since the a majority of a player's input will not require any
  266.    meta-commands at all.
  267.  
  268.    THE FORMAT OF META-COMMANDS
  269.  
  270.    A typical meta-command in the .AGT file might look like this:
  271.  
  272.         COMMAND BREAK LOCK
  273.         InRoom [locked oak door]
  274.         NOT InRoom [Evil Wizard]
  275.         IsCarrying [Battle Axe]
  276.          OR
  277.         Present [Sword]
  278.         VariableGT [Strength] 90 ; Player has enough strength to swing sword
  279.         FlagON [Sword has been pulled free from stone]
  280.          OR
  281.         IsCarrying [Iron Mace]
  282.         VariableGT [Strength] 50 ; Player has enough strength to swing mace
  283.         SwapLocations [locked oak door] [open doorway]
  284.         PrintMessage [Your blows break the lock and door swings open]
  285.         ChangePassageway [north] [throne room] 
  286.         ; open passage to the North into the [throne room]
  287.         DoneWithTurn ; No further process for this turn
  288.         END_COMMAND
  289.  
  290.                                        67
  291.  
  292.  
  293.  
  294.  
  295.    Each meta-command begins on a separate line with the keyword COMMAND. 
  296.    Following this is the input phrase for which this meta-command applies. 
  297.    The input phrase will be parsed, so you can use extra words for clarity. 
  298.    After being parsed, AGT will only remember the ADDRESSEE (if there is one),
  299.    the VERB, the NOUN and the OBJECT of the COMMAND.  If one of these is
  300.    missing, there is an implied ANY for the missing item.  For example, the
  301.    "BREAK LOCK" above is missing an OBJECT (and a preposition), so an implied
  302.    OBJECT of ANY is recorded for this COMMAND.  Because of this implied object
  303.    of ANY, this meta-COMMAND would be considered for any of the following
  304.    player inputs:
  305.  
  306.         BREAK LOCK
  307.         BREAK THE LOCK WITH MACE
  308.         BREAK LOCK WITH THE LARGE SWORD
  309.         BREAK LOCK WITH ROCK (will not produced desired result)
  310.         BREAK LOCK WITH DWARF'S HEAD (will not produced desired result)
  311.  
  312.    If the COMMAND is an ANY meta-command, the word ANY will be the only word
  313.    follow the word COMMAND.  The end of the meta-command is signalled by
  314.    END_COMMAND on a separate line.
  315.  
  316.    Between COMMAND and END_COMMAND are a series of conditional tests and
  317.    actions to be performed.  Each condition or action appears on a separate
  318.    line.  The first word of the action or condition line is the "Token", or
  319.    abbreviation for the action or condition.  AGT allows 208 such tokens. 
  320.    These tokens are a short-hand description of what condition is being tested
  321.    or what action is to be performed.  The tokens are normally shown with each
  322.    of the separate words of the short-hand description capitalized, e.g. 
  323.    PrintMessage.  This is only for better readability.  Internally, AGT does
  324.    not distinguish between upper and lower case in tokens.
  325.  
  326.    There may be several parameters on the line following the token.  The
  327.    number of parameters varies from none to two depending upon the specific
  328.    token.  For example, the token "KillPlayer" has no numerical parameters;
  329.    the token "PrintMessage" requires one parameter (i.e., the label for the
  330.    message to be printed); the token "SwapLocations" requires two parameters
  331.    (i.e., the two item labels of the items to have their locations switched). 
  332.    Following the parameters (if any) on the line is space for comments.  It is
  333.    recommended that meta-commends be very well commented and that the comments
  334.    be written as the meta-commands are first written.  Don't try to document
  335.    them afterwards -- because you'll never get around to really doing it!  For
  336.    added clarity, comments should be set off by some type of delimiter, such
  337.    as, "(*", "*)" or "{", "}" or a preceding ";".
  338.  
  339.    If a conditional token is preceded on the line with the word "NOT", the
  340.    sense of the conditional test is reversed, i.e., NOT InRoom [Evil Wizard]
  341.    tests that creature [Evil Wizard] is NOT in the current room.
  342.  
  343.    The token OR may be used to connect two or more separate conditional tests
  344.    within a meta-command.  The overall test will be TRUE if any of the
  345.    individual OR conditions is TRUE.  In the above example, the sequence
  346.  
  347.  
  348.                                        68
  349.  
  350.  
  351.  
  352.  
  353.         IsCarrying [Battle Axe]
  354.          OR
  355.         Present [Sword]
  356.         VariableGT [Strength] 90 ; Player has enough strength to swing sword
  357.         FlagON [Sword has been pulled free from stone]
  358.          OR
  359.         IsCarrying [Iron Mace]
  360.         VariableGT [Strength] 50 ; Player has enough strength to swing mace
  361.  
  362.    tests if the player is carrying or has access to one (or more) of the heavy
  363.    weapons which is capable of breaking the lock on the door.
  364.  
  365.    If there isn't an OR token between two conditions, there is an implied AND
  366.    condition between successive conditions.  The end of the series of OR's is
  367.    determined when AGT encounters the first Action token following the first
  368.    OR.  For example, the above meta-command might be rewritten in
  369.    pseudo-PASCAL as:
  370.  
  371.         IF (Verb = 'BREAK') AND (Noun = 'LOCK') THEN  {"BREAK LOCK"}
  372.           IF InRoom([locked oak door]) THEN  {Locked oak door is here}
  373.             IF (NOT InRoom([Evil Wizard])) THEN  {Evil Wizard not here}
  374.               IF IsCarrying([Battle Axe])  {Player has means to break door}
  375.                  OR (Present([Sword]) AND (Variable[Strength] > 90)
  376.                      AND FlagON[Sword has been pulled free from stone]))
  377.                  OR (IsCarrying(Iron Mace) AND (Variable[[Strength]] > 50))
  378.                     THEN BEGIN
  379.                      SwapLocations([locked oak door],[open doorway]);
  380.                      PrintMessage([Your blows break the lock and door swings
  381.                                     open]);  {Print appropriate message}
  382.                      ChangePassageway([North],{throne room]); {Open way north}
  383.                      DoneWithTurn := TRUE;  {Nothing more for this turn}
  384.                    END;
  385.  
  386.    When processing a meta-command, AGT starts at the first action or condition
  387.    and continues to process each token until one of the conditions within the
  388.    meta-command is not met, i.e., it is FALSE, then AGT skips to the next
  389.    meta-command within the .AGT file.  For example, consider the following:
  390.  
  391.         COMMAND ANY
  392.         Present [Blazing torch]
  393.         CounterGT [Torch counter] 75 
  394.         ; Torch has been lit for at least 75 turns
  395.         PrintMessage [Your torch is flickering and growing weaker]
  396.         CounterEquals [Torch counter] 100 
  397.         ; Torch has been lit for 100 turns
  398.         PrintMessage [The torch finally goes out!]
  399.         TurnCounterOFF [torch counter] 
  400.         ; Torch has gone out, so turn torch counter OFF
  401.         SwapLocations [Blazing torch] [unlit torch]
  402.         END_COMMAND
  403.  
  404.  
  405.  
  406.                                        69
  407.  
  408.  
  409.  
  410.  
  411.    In this meta-command, Counter [Torch counter] is used to keep track of the
  412.    number of turns that the torch has been blazing.  If the blazing torch
  413.    isn't being carried by the player or in the current room, the very first
  414.    condition is FALSE and AGT would skip ahead to the next meta-command --
  415.    i.e., no further tokens in this meta-command would be considered.  However,
  416.    if the blazing torch was present in the room, AGT would consider the second
  417.    condition, specifically, if the torch has been blazing for more than 75
  418.    turns.  If it has, then the next token would cause message [Your torch is
  419.    flickering and growing weaker] to be printed.  Then the next token would
  420.    test if the torch has been blazing for exactly 100 turns.  If it hasn't,
  421.    then AGT skips ahead to the next meta-command in the .AGT file.  If the
  422.    torch has been blazing for exactly 100 turns, then the last three tokens
  423.    (all action tokens) are processed and the message [The torch finally goes
  424.    out!] is printed, the blazing torch counter is turned OFF, and an [unlit
  425.    torch] is swapped for the [blazing torch].  For example, the above
  426.    meta-command might be rewritten in pseudo-PASCAL:
  427.  
  428.         IF (Verb = 'ANY') THEN  {ANY and ALL commands}
  429.           IF Present([Blazing torch]) THEN  
  430.             IF (Counter[Torch counter] > 75) THEN  
  431.               {Burning for more than 75 turns}
  432.               BEGIN
  433.                 PrintMessage([The torch is growing weaker.]);  
  434.                 IF (Counter[Torch counter] = 100) 
  435.                    {Burning exactly 100 turns}
  436.                   THEN BEGIN
  437.                     PrintMessage([The torch finally goes out!]);
  438.                     TurnCounterOFF([Torch counter]); {Turn burn counter off}
  439.                     SwapLocations([Blazing Torch],[unlit torch]);
  440.                   END;
  441.               END;
  442.  
  443.  
  444.    PRINTING SHORT MESSAGES FROM META-COMMANDS
  445.  
  446.    MCOMPILE provides a short-cut for printing simple messages from within
  447.    meta- commands:  simply put the message in quotation marks following the
  448.    PrintMessage token; no label is necessary.  Consider this example:
  449.  
  450.         COMMAND FIRE PHASER
  451.         IsCarrying [phaser]
  452.         VariableEquals [phaser shots] 0
  453.         PrintMessage [phaser empty]
  454.         END_COMMAND
  455.  
  456.         MESSAGE [phaser empty]
  457.         The phaser is out of energy.
  458.         END_MESSAGE
  459.  
  460.    The message short-cut allows the game designer to abbreviate this command
  461.    as follows:
  462.  
  463.  
  464.                                        70
  465.  
  466.  
  467.  
  468.  
  469.         COMMAND FIRE PHASER
  470.         IsCarrying [phaser]
  471.         VariableEquals [phaser shots] 0
  472.         PrintMessage "The phaser is out of energy."
  473.         END_COMMAND
  474.  
  475.    MCOMPILE will translate the quoted text following the PrintMessage token
  476.    into a message number, and create a corresponding message definition in the
  477.    .AGT file.
  478.  
  479.    MCOMPILE searches for the quotation marks "from the outside in," so
  480.    messages that require quote marks as part of the text are possible:
  481.  
  482.         PrintMessage "This message has "quotation marks" in it."
  483.  
  484.         PrintMessage ""Aye, aye, sir.""
  485.  
  486.    The first and last quotes are removed from the message; all others are left
  487.    intact.  (If you find these "nested" quotes confusing or undesirable, you
  488.    can change the short-cut message delimiter characters.)
  489.  
  490.    If no closing quote is found, an error message will be generated by
  491.    MCOMPILE.
  492.  
  493.    Of course, if the message itself contains quote marks, then a closing
  494.    message delimiter must be supplied to mark the end of the message --
  495.    otherwise the last quote mark would signal the end of the text.  For
  496.    example:
  497.  
  498.         PrintMessage "This message has "embedded" quotes.
  499.  
  500.    Without a closing quote, this message would be printed as follows:
  501.  
  502.         This message has "embedded
  503.  
  504.    and MCOMPILE would assume the remaining text on the line was a comment.
  505.  
  506.    Naturally, the above short-cut message style is not appropriate for
  507.    messages which can be printed from more than one meta-command.  For short,
  508.    specialized messages, however, this style can eliminate a lot of typing and
  509.    reduce the size of the .AGT file.
  510.  
  511.  
  512.    MULTI-LINE SHORT-CUT MESSAGES
  513.  
  514.    Multi-line short-cut messages can be written by putting the PrintMessage
  515.    token on a line by itself and terminating the text with END_PrintMessage:
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.                                        71
  523.  
  524.  
  525.  
  526.  
  527.         COMMAND ANY
  528.         Present [adderzag]
  529.         Chance 35
  530.         PrintMessage
  531.         The adderzag hesitates for a fraction of an eyeblink, then lunges at
  532.         you.  You try to dodge the horrible mass of evil flying at your heart,
  533.         but you slip on the ice and lose your balance.  The 'zag crashes into
  534.         your chest and you both go sliding across the frozen ground.
  535.         END_PrintMessage
  536.           ...
  537.         END_COMMAND
  538.  
  539.    Notice that MCOMPILE tells the difference between single and multi-line
  540.    messages by the presence or absence of text following the PrintMessage
  541.    keyword; do not put anything on the same line as the keyword when using
  542.    this format.
  543.  
  544.    Multi-line short-cut messages may contain as many lines of text as
  545.    necessary, and may freely use quotation marks.
  546.  
  547.    Because a short-cut message can only be used by one meta-command, you will
  548.    still need to manually create MESSAGE definitions for messages used by
  549.    multiple meta-commands.
  550.  
  551.  
  552.    META-COMMANDS CONDITIONAL TESTS
  553.  
  554.    The are a total of 106 separate condition tokens in AGT.  Since each of
  555.    this conditions may be prefaced by a NOT condition, there are actually a
  556.    total of 212 conditional tests possible within a meta-command.  These
  557.    conditional tests divide into several logical groups:
  558.  
  559.          - Tests about the player's status and/or condition
  560.          - Tests about the status/condition of specific item(s)
  561.          - Tests about the status/condition of the current NOUN
  562.          - Other miscellaneous tests
  563.  
  564.    Let's consider each of these logical groups in order.  First, tests about
  565.    the player's status and/or Condition:
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.                                          72
  581.  
  582.  
  583.  
  584.  
  585.                             ┌────────────────────┐
  586.    ╔════════════════════════╡  PLAYER CONDITIONS ╞═══════════════════════════════╗
  587.    ║                        └────────────────────┘                               ║
  588.    ║                      NUMBER/TYPES                                           ║
  589.    ║ TOKEN NAME           OF PARAMETERS              EXPLANATION                 ║
  590.    ╠═════════════════════╤═╤═══════════╤═════════════════════════════════════════╣
  591.    ║ AtLocation          │1│Location   │ Player is located at room Location      ║
  592.    ║ AtLocationGT        │1│Location   │ Player is in room greater than Location ║
  593.    ║ AtLocationLT        │1│Location   │ Player is in room less than Location    ║
  594.    ║ FirstVisitToRoom    │0│None       │ First visit to current room             ║
  595.    ║ IsCarryingSomething │0│None       │ Player is carrying something            ║
  596.    ║ IsCarryingNothing   │0│None       │ Player is carrying nothing              ║
  597.    ║ IsCarryingTreasure  │1│Points#    │ Player is carrying at least one item    ║
  598.    ║                     │ │           │    that is worth at least Points#       ║
  599.    ║ IsWearingSomething  │0│None       │ Player is wearing something             ║
  600.    ║ IsWearingNothing    │0│None       │ Player is wearing nothing               ║
  601.    ║ LoadWeightEquals    │1│Number     │ Player's load weighs equals Number      ║
  602.    ║ LoadWeightGT        │1│Number     │ Player's load weighs more than Number   ║
  603.    ║ LoadWeightLT        │1│Number     │ Player's load weighs less than Number   ║
  604.    ║ NewLife             │0│None       │ Player has just been resurrected or     ║
  605.    ║                     │ │           │    start of game                        ║
  606.    ╚═════════════════════╧═╧═══════════╧═════════════════════════════════════════╝
  607.  
  608.    All these tokens test conditions about the player current status, i.e.,
  609.    where he is/isn't located, if he is/isn't wearing or carrying something,
  610.    and if his current load weighs a certain amount.  All these conditions
  611.    are obvious except for
  612.  
  613.         IsCarryingTreasure 10 ; Has something worth at least 10 points
  614.  
  615.    which might be used to test whether it is appropriate to have some type
  616.    of thief (randomly) rob the player of his valuables.
  617.  
  618.    The second group of conditions test the status of various items or
  619.    nouns:
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.                                          73
  639.  
  640.  
  641.  
  642.  
  643.                             ┌────────────────────┐
  644.    ╔════════════════════════╡ ITEM(S) CONDITIONS ╞═══════════════════════════════╗
  645.    ║                        └────────────────────┘                               ║
  646.    ║                      NUMBER/TYPES                                           ║
  647.    ║ TOKEN NAME           OF PARAMETERS              EXPLANATION                 ║
  648.    ╠═════════════════════╤═╤═══════════╤═════════════════════════════════════════╣
  649.    ║ Present             │1│Item#      │ Item# is in room, carried or worn       ║
  650.    ║ IsWearing           │1│Item#      │ Item# is being worn                     ║
  651.    ║ IsCarrying          │1│Item#      │ Item# is being carried                  ║
  652.    ║ IsNowhere           │1│Item#      │ Item# is located NOWHERE (in room 0)    ║
  653.    ║ IsSomewhere         │1│Item#      │ Item# is located somewhere (not in 0)   ║
  654.    ║ InRoom              │1│Item#      │ Item# is located in current room        ║
  655.    ║ IsLocated           │2│Item# Loc  │ Item# is located in room Location       ║
  656.    ║ Together            │2│Itm1# Itm2#│ Itm1# and Itm2# are in same place       ║
  657.    ║ IsON                │1│Item#      │ Item# is ON                             ║
  658.    ║ IsOFF               │1│Item#      │ Item# is OFF                            ║
  659.    ║ IsOpen              │1│Item#      │ Item# is Open                           ║
  660.    ║ IsClosed            │1│Item#      │ Item# is Closed                         ║
  661.    ║ IsLocked            │1│Item#      │ Item# is Locked                         ║
  662.    ║ IsUnLocked          │1│Item#      │ Item# is UnLocked                       ║
  663.    ║ IsEdible            │1│Item#      │ Item# is Edible                         ║
  664.    ║ IsDrinkable         │1│Item#      │ Item# is Drinkable                      ║
  665.    ║ IsPoisonous         │1│Item#      │ Item# is Poisonous                      ║
  666.    ║ IsMovable           │1│Item#      │ Item# is Movable                        ║
  667.    ║ IsGroupMember       │1│Item#      │ Item# is a member of the group          ║
  668.    ║ SomethingInside     │1│Item#      │ Item# has something inside it.  Item#   ║
  669.    ║                     │ │           │   can represent a ROOM, NOUN or CREATURE║
  670.    ╚═════════════════════╧═╧═══════════╧═════════════════════════════════════════╝
  671.  
  672.    All but two of the above tokens require one parameter: the number of the
  673.    item for which the conditional test is being considered.  Examples of
  674.    these two exceptions are:
  675.  
  676.         IsLocated [axe] [storeroom]
  677.         Together [right glove] [left glove]
  678.  
  679.    The next group of conditional tokens is similar to the above except that
  680.    they are tests for the current NOUN which has been input, not a specific
  681.    item:
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.                                       74
  697.  
  698.  
  699.  
  700.  
  701.                             ┌────────────────────┐
  702.    ╔════════════════════════╡   NOUN CONDITIONS  ╞═══════════════════════════════╗
  703.    ║                        └────────────────────┘                               ║
  704.    ║                      NUMBER/TYPES                                           ║
  705.    ║ TOKEN NAME           OF PARAMETERS              EXPLANATION                 ║
  706.    ╠═════════════════════╤═╤═══════════╤═════════════════════════════════════════╣
  707.    ║ NOUNPresent         │0│None       │ NOUN is in room, carried or worn        ║
  708.    ║ NOUNIsWearing       │0│None       │ NOUN is being worn                      ║
  709.    ║ NOUNIsCarrying      │0│None       │ NOUN is being carried                   ║
  710.    ║ NOUNIsNowhere       │0│None       │ NOUN is located NOWHERE (in room 0)     ║
  711.    ║ NOUNIsSomewhere     │0│None       │ NOUN is located somewhere (not room 0)  ║
  712.    ║ NOUNInRoom          │0│None       │ NOUN is located in current room         ║
  713.    ║ NOUNIsLocated       │1│Location   │ NOUN is located in room Location        ║
  714.    ║ NOUNIsON            │0│None       │ NOUN is ON                              ║
  715.    ║ NOUNIsOFF           │0│None       │ NOUN is OFF                             ║
  716.    ║ NOUNIsOpen          │0│None       │ NOUN is Open                            ║
  717.    ║ NOUNIsClosed        │0│None       │ NOUN is Closed                          ║
  718.    ║ NOUNIsLocked        │0│None       │ NOUN is Locked                          ║
  719.    ║ NOUNIsUnLocked      │0│None       │ NOUN is UnLocked                        ║
  720.    ║ NOUNIsEdible        │0│None       │ NOUN is Edible                          ║
  721.    ║ NOUNIsDrinkable     │0│None       │ NOUN is Drinkable                       ║
  722.    ║ NOUNIsPoisonous     │0│None       │ NOUN is Poisonous                       ║
  723.    ║ NOUNIsMovable       │0│None       │ NOUN is Movable                         ║
  724.    ║ NOUNpointsEquals    │1│Number     │ NOUN's points equal Number              ║
  725.    ║ NOUNpointsGT        │1│Number     │ NOUN's points are greater than Number   ║
  726.    ║ NOUNpointsLT        │1│Number     │ NOUN's points are less than Number      ║
  727.    ║ NOUNweightEquals    │1│Number     │ NOUN's weight equals Number             ║
  728.    ║ NOUNweightGT        │1│Number     │ NOUN's weight is greater than Number    ║
  729.    ║ NOUNweightLT        │1│Number     │ NOUN's weight is less than Number       ║
  730.    ║ NOUNIsCreature      │0│None       │ NOUN is a creature, rather than Noun    ║
  731.    ║ NOUNIsNumber        │1│Number     │ NOUN's num is Number, e.g., NOUN is     ║
  732.    ║                     │ │           │    number                               ║
  733.    ╚═════════════════════╧═╧═══════════╧═════════════════════════════════════════╝
  734.  
  735.    The above tokens are especially useful if the game designer wants to
  736.    create his own unique standard default responses to situations, rather
  737.    than relying on the normal AGT responses.  For example, below are new
  738.    default responses for the verb GET:
  739.  
  740.         COMMAND GET ANY
  741.         NOUNInRoom ; the NOUN is in current room
  742.         NOUNIsMovable ;  the NOUN can be moved
  743.         LoadWeightLT 90 ; player is carrying less than 90 pounds
  744.         NOUNweightLT 11 ;  the NOUN is less than 11 pounds
  745.         GetNOUN ; Add NOUN to items being carried
  746.         PrintMessage [You add the $noun$ to your load.]
  747.         DoneWithTurn ; Nothing more required for this turn
  748.         END_COMMAND
  749.  
  750.  
  751.  
  752.  
  753.  
  754.                                       75
  755.  
  756.  
  757.  
  758.  
  759.         COMMAND GET ANY
  760.         NOUNIsCarrying ; the NOUN is currently being carried
  761.         PrintMessage [You already have it, Stupid!]
  762.         DoneWithTurn ; Nothing more required for this turn
  763.         END_COMMAND
  764.  
  765.         COMMAND GET ANY
  766.         NOT NOUNPresent ;  the NOUN is NOT present
  767.         PrintMessage [The $noun$ isn't here, you oaf!]
  768.         DoneWithTurn ; Nothing more required for this turn
  769.         END_COMMAND
  770.  
  771.         COMMAND GET ANY
  772.         NOT NOUNIsMovable [NOUN cannot be moved]
  773.         PrintMessage [Sorry, but the $noun$ cannot be moved!]
  774.         DoneWithTurn ; Nothing more required for this turn
  775.         END_COMMAND
  776.  
  777.         COMMAND GET ANY
  778.         NOUNIsMovable ; the NOUN can be moved
  779.         LoadWeightGT 89 ; player is carrying 90 pounds or more already
  780.         PrintMessage [Your load is too heavy to carry the $noun$.]
  781.         DoneWithTurn ; Nothing more required for this turn
  782.         END_COMMAND
  783.  
  784.    A series of COMMANDS like these is processed sequentially by their order
  785.    of appearance in the .AGT file.  As a result, the COMMANDs order is very
  786.    important!  For example, if the player gave the input GET STATUE and the
  787.    statue was not in the room and was also not movable, the error message
  788.    "The statue isn't here, you oaf!" would be printed rather than "Sorry,
  789.    but the statue cannot be moved!" because of the order of their
  790.    respective COMMANDS above (or in the .AGT file).
  791.  
  792.    The last group of conditional tokens is a catch-all:
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.                                       76
  813.  
  814.  
  815.  
  816.  
  817.                         ┌────────────────────────────┐                         
  818.    ╔════════════════════╡  MISCELLANEOUS CONDITIONS  ╞═══════════════════════════╗
  819.    ║                    └────────────────────────────┘                           ║
  820.    ║                      NUMBER/TYPES                                           ║
  821.    ║ TOKEN NAME           OF PARAMETERS              EXPLANATION                 ║
  822.    ╠═════════════════════╤═╤═══════════╤═════════════════════════════════════════╣
  823.    ║ NamePresent         │0│None       │ Addressee is present in current room    ║
  824.    ║ NameIsNumber        │1│Number     │ Addressee is Creature or Noun number    ║
  825.    ║ ObjectPresent       │0│None       │ Object is present                       ║
  826.    ║ ObjectIsCreature    │0│None       │ Object is a Creature                    ║
  827.    ║ ObjectIsNumber      │1│Number     │ Object is Creature or Noun number       ║
  828.    ║ LightPresent        │0│None       │ Current room has necessary light        ║
  829.    ║ RoomNeedsLight      │0│None       │ Current room needs a light              ║
  830.    ║ FlagON              │1│Flag#      │ Flag# is ON                             ║
  831.    ║ FlagOFF             │1│Flag#      │ Flag# is OFF                            ║
  832.    ║ ScoreEquals         │1│Number     │ Current score is equal to Number        ║
  833.    ║ ScoreGT             │1│Number     │ Score is greater than Number            ║
  834.    ║ ScoreLT             │1│Number     │ Score is less than Number               ║
  835.    ║ NumberEquals        │1│Number     │ Number input is equal to Number         ║
  836.    ║ NumberGT            │1│Number     │ Number is greater than Number           ║
  837.    ║ NumberLT            │1│Number     │ Number is less than Number              ║
  838.    ║ AnswerIsCorrect     │0│None       │ Last answer was correct                 ║
  839.    ║ AnswerIsWrong       │0│None       │ Last answer was wrong                   ║
  840.    ║ TurnsEquals         │1│Number     │ Number of turns is equal to Number      ║
  841.    ║ TurnsGT             │1│Number     │ Number of turns is greater than Number  ║
  842.    ║ TurnsLT             │1│Number     │ Number of turns is less than Number     ║
  843.    ║ CounterEquals       │2│Ctr# Number│ Counter# is equal to Number             ║
  844.    ║ CounterGT           │2│Ctr# Number│ Counter# is greater than Number         ║
  845.    ║ CounterLT           │2│Ctr# Number│ Counter# is less than Number            ║
  846.    ║ VariableEquals      │2│Var# Number│ Variable# is equal to Number            ║
  847.    ║ VariableGT          │2│Var# Number│ Variable# is greater than Number        ║
  848.    ║ VariableLT          │2│Var# Number│ Variable# is less than Number           ║
  849.    ║ CompareVariables    │2│Var#1 Var#2│ Variable#1 is less than Variable#2      ║
  850.    ║ VariableChance      │2│Var# Number│ Variable# is less than a random number  ║
  851.    ║                     │ │           │    from 1 to Number                     ║
  852.    ║ Chance              │1│Percent    │ Odds percent, i.e., 10 % chance of TRUE ║
  853.    ║ PromptForYES        │0│None       │ Prompts for Y or N -- TRUE if Yes       ║
  854.    ║ PromptForNO         │0│None       │ Prompts for Y or N -- TRUE if No        ║
  855.    ║ VerbIsDirection     │0│None       │ Verb is movement or direction           ║
  856.    ╚═════════════════════╧═╧═══════════╧═════════════════════════════════════════╝
  857.  
  858.    Just a few words of explanation about a couple of these.  PromptForYES
  859.    and PromptForNO cause the player to be queried and to respond by
  860.    entering a YES (or Y) or NO (or N) on the keyboard.  These conditions
  861.    are then TRUE or FALSE depending upon the what is entered.  These tokens
  862.    are particular useful when you want to ask the player a question that
  863.    requires a YES or NO answer like whether he would like a hint. 
  864.    AnswerIsCorrect and AnswerIsWrong are similar tokens for asking
  865.    questions which do not have YES and NO answers like asking a riddle.  An
  866.    example of how to ask a trivia question will be given later in this
  867.    document.
  868.  
  869.  
  870.                                       77
  871.  
  872.  
  873.  
  874.  
  875.    The number referenced by the NumberEquals, NumberGT and NumberLT is a
  876.    number that the player inputs via the keyboard in response to a
  877.    GetNumberInput action token.  An example of this sequence of events will
  878.    be given later.
  879.  
  880.    The game designer has 255 Flags (1 to 255) which can be tested for being
  881.    ON or OFF respectively by the FlagON and FlagOFF tokens.  There are 50
  882.    Counters (1 to 50) and 50 Variables (1 to 50) which can also be tested
  883.    by various tokens described above.  How to "define" the labels for
  884.    flags, counters and variables will be described in the below.  How to
  885.    set these Flags, Counters and Variables will be described in the section
  886.    on ACTION tokens that follows.
  887.  
  888.    The master's Edition allows you to define these things using labels as
  889.    follows in your .AGT file:
  890.  
  891.         FLAG [label]
  892.         COUNTER [label]
  893.         VARIABLE [label]
  894.         QUESTION [label]
  895.  
  896.    Each of these keywords (i.e., FLAG, COUNTER, etc.) appears on its own
  897.    line, anywhere in the file.  They do not have any effect on the
  898.    structure of the game, but simply tell MCOMPILE what type of item the
  899.    label refers to.  For example:
  900.  
  901.         FLAG [flashlight lit]
  902.         VARIABLE [energy left]
  903.  
  904.           ...
  905.         COMMAND ANY
  906.         Present [flashlight]
  907.         FlagON [flashlight lit]
  908.         VariableLT [energy left] 20
  909.         END_COMMAND
  910.  
  911.         MESSAGE [batteries dying]
  912.         Your batteries will last only #VAR[energy left]# more turns.
  913.         END_MESSAGE
  914.  
  915.    These keywords cause the labels to be defined with the next available
  916.    number for the particular item.  For example, if there were already four
  917.    other variables defined, MCOMPILE would assign the value 5 to the label
  918.    [energy left] upon encountering the VARIABLE definition.
  919.  
  920.  
  921.    TEXT MACROS
  922.  
  923.    A text macro is a special kind of label that can be defined as almost
  924.    any text you choose.  The format of a single-line macro definition is:
  925.  
  926.         #DEFINE [label] label definition
  927.  
  928.                                       78
  929.  
  930.  
  931.  
  932.  
  933.    This causes the label to be defined as all text after the label to the
  934.    end of the line (not including the first character after the label,
  935.    which is normally a blank).  Macros are useful for constants used
  936.    throughout the game file:
  937.  
  938.         #COMMENT Macros for special "rooms"
  939.         #DEFINE [Nowhere]    0
  940.         #DEFINE [Carried]    1
  941.         #DEFINE [Worn]    1000
  942.  
  943.    It's sometimes handy to use a macro for something you may want to
  944.    change, so you don't have to track down every occurrence of the item
  945.    each time you change it.  For example: 
  946.  
  947.         VARIABLE [health]
  948.         #DEFINE [max health] 100
  949.         #DEFINE [rest delay] 5
  950.         #DEFINE [rest benefit] 20
  951.           ...
  952.  
  953.         COMMAND REST
  954.         TimePasses
  955.         Delay [rest delay]
  956.         PrintMessage "Having rested for a while, you now feel much better."
  957.         AddToVariable [health] [rest benefit]
  958.         VariableGT [health] [max health]
  959.         SetVariableTo [health] [max health]
  960.         END_COMMAND
  961.  
  962.         COMMAND REST
  963.         DoneWithTurn
  964.         END_COMMAND
  965.  
  966.    This allows you to quickly change, say, the maximum health the player
  967.    can have, no matter how many times that value is referred to in the
  968.    game.
  969.  
  970.    Macros are not limited to just numbers.  They can contains several
  971.    words, punctuation, etc.  Here's another example, adapted from the
  972.    Colossal Cave Adventure:
  973.  
  974.         #DEFINE [magic word] XYZZY
  975.           ...
  976.         Dummy_Verb17 [magic word]
  977.           ...
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.                                       79
  987.  
  988.  
  989.  
  990.  
  991.         ROOM_DESCR [debris room]
  992.         You are in a debris-filled room with stuff washed in from the
  993.         surface.  A low wide passage with cobbles becomes plugged with mud
  994.         and debris here,  but an awkward canyon leads upward and west.  A
  995.         note on the wall says:
  996.  
  997.              Magic Word "[magic word]"
  998.         END_ROOM_DESCR
  999.  
  1000.           ...
  1001.  
  1002.         COMMAND [magic word]
  1003.         FlagOFF [cave closed]
  1004.         AtLocation [debris room]
  1005.         PrintMessage [transported]
  1006.         GoToRoom [inside building]
  1007.         DoneWithTurn
  1008.         END_COMMAND
  1009.  
  1010.           ...
  1011.  
  1012.         COMMAND [magic word]
  1013.         FlagOFF [cave closed]
  1014.         AtLocation [inside building]
  1015.         PrintMessage [transported]
  1016.         GoToRoom [debris room]
  1017.         DoneWithTurn
  1018.         END_COMMAND
  1019.  
  1020.           ...
  1021.  
  1022.         COMMAND [magic word]
  1023.         PrintMessage "A voice booms out, "That word doesn't work here!""
  1024.         DoneWithTurn
  1025.         END_COMMAND
  1026.  
  1027.  
  1028.  
  1029.    MACRO NESTING AND RECURSION
  1030.  
  1031.    By default, macros are "nestable", meaning that they can include
  1032.    references to other labels.  When a macro is expanded, the resulting
  1033.    text is then scanned for additional macros and labels.  The following
  1034.    example makes use of macro nesting:
  1035.  
  1036.         NOUN [burning torch]
  1037.           ...
  1038.         NOUN [unlit torch]
  1039.           ...
  1040.         #DEFINE [extinguish] SwapLocations [burning torch] [unlit torch]
  1041.           ...
  1042.  
  1043.  
  1044.                                       80
  1045.  
  1046.  
  1047.  
  1048.  
  1049.         COMMAND ANY
  1050.         FlagON [wind blowing]
  1051.         Chance 10
  1052.         PrintMessage "The wind blows out your torch."
  1053.         [extinguish]
  1054.         END_COMMAND
  1055.  
  1056.    The danger with nestable labels is this: if a macro refers to itself,
  1057.    either directly or indirectly, then the macro's final value cannot be
  1058.    determined. MCOMPILE would spend eternity trying to expand the macro,
  1059.    forever ending up with another macro.  For example:
  1060.  
  1061.         #DEFINE [yoyo] xx [yoyo] xx
  1062.  
  1063.    MCOMPILE will define a macro called [yoyo] with the text "xx [yoyo] xx". 
  1064.    When the macro is expanded, a new macro (also called [yoyo]) is
  1065.    discovered which must itself expanded, ad infinitum.  Here's another
  1066.    example, using indirect recursion:
  1067.  
  1068.         #DEFINE [tweedle dee] [tweedle dum]
  1069.         #DEFINE [tweedle dum] [tweedle dee]
  1070.  
  1071.    Since macros are not expanded until the second phase of MCOMPILE's
  1072.    operation, they may not include any text which MCOMPILE requires during
  1073.    its first phase. Specifically, macros may not contain any of the
  1074.    following keywords:
  1075.  
  1076.         ROOM, ROOM_DESCR
  1077.         NOUN, NOUN_DESCR
  1078.         CREATURE, CREATURE_DESCR
  1079.         PUSH_DESCR, PULL_DESCR, TURN_DESCR, PLAY_DESCR
  1080.         TEXT, MESSAGE, QUESTION
  1081.         FLAG, COUNTER, VARIABLE
  1082.         STANDARD, VOCABULARY
  1083.         END_keyword
  1084.         #DEFINE, #INCLUDE, #OPTIONS, #COMMENT, #END_COMMENT
  1085.  
  1086.    unless, of course, such text is intended as game output rather than
  1087.    keywords. In other words, if you needed a word like ROOM or #INCLUDE at
  1088.    the beginning of a line in a text description, it would be allowable
  1089.    (and possibly necessary) to define such text as a macro.
  1090.  
  1091.    MCOMPILE allows up to 500 macros per adventure game, independent of the
  1092.    number of other labels in the file.
  1093.  
  1094.  
  1095.    MULTIPLE SOURCE FILES
  1096.  
  1097.    It is sometimes inconvenient (or impossible) to use a single source file
  1098.    for an adventure game.  For example, your game may grow until it is too
  1099.    large for your text editor to handle.  Or you may have a group of macros
  1100.    or meta-commands that you'd like to use in more than one adventure game.
  1101.  
  1102.                                       81
  1103.  
  1104.  
  1105.  
  1106.  
  1107.    For this purpose, MCOMPILE provides the #INCLUDE directive, which causes
  1108.    another source file to be read in and processed as if it was part of the
  1109.    main file. For example, if MYGAME.AGT contains these lines:
  1110.  
  1111.         ROOM_DESCR [throne room]
  1112.         #INCLUDE throne.agt
  1113.         END_DESCR
  1114.  
  1115.    and THRONE.AGT contains these lines:
  1116.  
  1117.         You are in a shambled throne room.  Rows of stone statues on either
  1118.         side of the great hall seem to hold a mute vigil, awaiting the
  1119.         return of their sovereign.
  1120.  
  1121.    then MCOMPILE will process MYGAME.AGT as if it looked like this:
  1122.  
  1123.         ROOM_DESCR [throne room]
  1124.         You are in a shambled throne room.  Rows of stone statues on either
  1125.         side of the great hall seem to hold a mute vigil, awaiting the
  1126.         return of their sovereign.
  1127.         END_DESCR
  1128.  
  1129.    For your convenience there is a standard definitions file called
  1130.    STDDEFS.AGT that contains some helpful macros.  If your source file
  1131.    contains the line
  1132.  
  1133.         #INCLUDE stddefs.agt
  1134.  
  1135.    then the following defined labels will be available for your use:
  1136.  
  1137.         #COMMENT Special "rooms"
  1138.         #DEFINE [Nowhere]    0
  1139.         #DEFINE [Carried]    1
  1140.         #DEFINE [Worn]    1000
  1141.  
  1142.         #COMMENT Special "nouns"
  1143.         #DEFINE [Nothing]    0
  1144.         #DEFINE [Any Light]  1
  1145.  
  1146.         #COMMENT Special "flags"
  1147.         #DEFINE [Debug]      0
  1148.  
  1149.         #COMMENT macros for the directions used with ChangePassageway
  1150.         #DEFINE [North] 1
  1151.         #DEFINE [South] 2
  1152.         #DEFINE [East] 3
  1153.         #DEFINE [West] 4
  1154.         #DEFINE [NorthEast] 5
  1155.         #DEFINE [NorthWest] 6
  1156.         #DEFINE [SouthEast] 7
  1157.         #DEFINE [SouthWest] 8
  1158.         #DEFINE [Up] 9
  1159.  
  1160.                                       82
  1161.  
  1162.  
  1163.  
  1164.  
  1165.         #DEFINE [Down] 10
  1166.         #DEFINE [Enter] 11
  1167.         #DEFINE [Exit] 12
  1168.  
  1169.    Be careful with the names of your include files.  It is wise to avoid
  1170.    giving these files names with extensions of .AGT, .TTL, etc.  For
  1171.    example, don't try anything like this:
  1172.  
  1173.         #COMMENT mygame.agt
  1174.  
  1175.         TITLE
  1176.         #INCLUDE mygame.ttl
  1177.         END_TITLE
  1178.  
  1179.    The presence of the TITLE keyword in the .AGT file would cause the .TTL
  1180.    file to be destroyed, since MCOMPILE would try to create the title file
  1181.    itself.
  1182.  
  1183.    Included files may include other files, up to a maximum of two levels
  1184.    deep.
  1185.  
  1186.  
  1187.    OTHER MCOMPILE KEYWORDS
  1188.  
  1189.    To identify the text for the game title, instructions and /or
  1190.    vocabulary, MCOMPILE provides some additional keywords:
  1191.  
  1192.         TITLE
  1193.         The game title goes here, in the .TTL file format.
  1194.         END_TITLE
  1195.  
  1196.         INSTRUCTIONS
  1197.         The game instructions go here, in the .INS file format.
  1198.         END_INSTRUCTIONS
  1199.  
  1200.         VOCABULARY
  1201.         The game vocabulary goes here, in the .VOC file format.
  1202.         END_VOCABULARY
  1203.  
  1204.    When one of these keywords is found, MCOMPILE creates the appropriate
  1205.    file and writes the information (without the keywords) to the file.  If
  1206.    any of these are omitted, MCOMPILE will ignore the corresponding file to
  1207.    allow you to maintain it manually.
  1208.  
  1209.  
  1210.    DELIMITER CHARACTERS
  1211.  
  1212.    The default delimiters for labels are the braces, i.e., [ and ], the
  1213.    delimiters for short-cut messages are the quote marks, i.e., " and ". 
  1214.    If you wish to change delimiters, you can use the #OPTIONS command
  1215.    within your source file as follows:
  1216.  
  1217.  
  1218.                                       83
  1219.  
  1220.  
  1221.  
  1222.  
  1223.         #OPTIONS Labels{} Messages() 
  1224.  
  1225.    For example, the above would change the default delimiters for labels to
  1226.    curly braces, i.e., { and }, the delimiters for short-cut messages to
  1227.    the opening and closing parentheses.
  1228.  
  1229.  
  1230.    META-COMMANDS ACTION TOKENS
  1231.  
  1232.    There are a total of 102 separate action tokens in AGT.  These actions
  1233.    divide into several logical groups:
  1234.  
  1235.         - Actions involving the player
  1236.         - Actions involving specific item(s), the NOUN or locations
  1237.         - Other miscellaneous actions
  1238.  
  1239.    Let's consider each of these logical groups in order.  First, actions
  1240.    involving the player:
  1241.  
  1242.                            ┌────────────────────────┐                          
  1243.    ╔═══════════════════════╡  PLAYER ACTION TOKENS  ╞════════════════════════════╗
  1244.    ║                       └────────────────────────┘                            ║
  1245.    ║                      NUMBER/TYPES                                           ║
  1246.    ║ TOKEN NAME           OF PARAMETERS              EXPLANATION                 ║
  1247.    ╠═════════════════════╤═╤═══════════╤═════════════════════════════════════════╣
  1248.    ║ GoToRoom            │1│Location#  │ Send player to Location#                ║
  1249.    ║ GoToRandomRoom      │2│Loc#1 Loc#2│ Randomly pick a room between Loc#1 and  ║
  1250.    ║                     │ │           │    Loc#2 and send player to it          ║
  1251.    ║ GetIt               │1│Item#      │ Item# is now being carried              ║
  1252.    ║ WearIt              │1│Item#      │ Item# is now being worn                 ║
  1253.    ║ DropIt              │1│Item#      │ Drop Item# into current room            ║
  1254.    ║ RemoveIt            │1│Item#      │ Remove Item# and drop into room         ║
  1255.    ║ GetNOUN             │0│None       │ NOUN is now being carried               ║
  1256.    ║ WearNOUN            │0│None       │ NOUN is now being worn                  ║
  1257.    ║ DropNOUN            │0│None       │ Drop NOUN into current room             ║
  1258.    ║ RemoveNOUN          │0│None       │ Remove NOUN and drop into room          ║
  1259.    ║ DropEverything      │0│None       │ Drop all items being carried            ║
  1260.    ║ RemoveEverything    │0│None       │ Remove all items being worn             ║
  1261.    ║ KillPlayer          │0│None       │ Make player dead at end of turn         ║
  1262.    ╚═════════════════════╧═╧═══════════╧═════════════════════════════════════════╝
  1263.  
  1264.    These actions are all straight-forward.
  1265.  
  1266.  
  1267.    A WORD OF WARNING:
  1268.  
  1269.    When AGT encounters and processes an action token, it is done without
  1270.    fanfare or logical checking.  For example, if the actions
  1271.  
  1272.         DropIt [Rubber Ducky] ; Put the Rubber Ducky in the room
  1273.         WearNOUN ; Put on or Wear NOUN
  1274.  
  1275.  
  1276.                                       84
  1277.  
  1278.  
  1279.  
  1280.  
  1281.    are encountered, they are done without checking whether the player is
  1282.    carrying the Rubber Ducky currently or if the NOUN is something that
  1283.    might be logically worn. The game designer is warned that this kind of
  1284.    logical checking before taking actions is his or her responsibility --
  1285.    not AGT's!
  1286.  
  1287.    The second group of actions involve items, nouns and locations:
  1288.  
  1289.                        ┌────────────────────────────────────┐
  1290.    ╔═══════════════════╡  ITEM/NOUN/LOCATION ACTION TOKENS  ╞════════════════════╗
  1291.    ║                   └────────────────────────────────────┘                    ║
  1292.    ║                      NUMBER/TYPES                                           ║
  1293.    ║ TOKEN NAME           OF PARAMETERS              EXPLANATION                 ║
  1294.    ╠═════════════════════╤═╤═══════════╤═════════════════════════════════════════╣
  1295.    ║ PutInCurrentRoom    │1│Item#      │ Put Item# in current room               ║
  1296.    ║ PutNOUNInCurrentRoom│0│None       │ Put NOUN in current room                ║
  1297.    ║ RelocateAll         │2│Loc1# Loc2#│ Relocate all items at Loc1# to Loc2#    ║
  1298.    ║ SendToRoom          │2│Item# Loc# │ Put Item# in Location Loc#              ║
  1299.    ║ SendNOUNToRoom      │1│Location#  │ Put NOUN in room Location#              ║
  1300.    ║ SendAllToRoom       │1│Location#  │ Send all carried items to Location#     ║
  1301.    ║ SendTreasuresToRoom │2│Loc# Point#│ Send all carried items whose            ║
  1302.    ║                     │ │           │    points > Point# to Loc#              ║
  1303.    ║ Destroy             │1│Item#      │ Item# is now NOWHERE (in room 0)        ║
  1304.    ║ DestroyNOUN         │0│None       │ NOUN is now NOWHERE (in room 0)         ║
  1305.    ║ SwapLocations       │2│Itm#1 Itm#2│ Swap locations of Item#1 & Item#2       ║
  1306.    ║ SendToItem          │2│Itm#1 Itm#2│ Put Itm#1 in location of Itm#2          ║
  1307.    ║ SendNOUNToItem      │1│Item#      │ Put NOUN in location of Item#           ║
  1308.    ║ OpenIt              │1│Item#      │ Item# is now open                       ║
  1309.    ║ CloseIt             │1│Item#      │ Item# is now closed                     ║
  1310.    ║ LockIt              │1│Item#      │ Item# is now locked                     ║
  1311.    ║ UnlockIt            │1│Item#      │ Item# is now unlocked                   ║
  1312.    ║ OpenNOUN            │0│None       │ NOUN is now open                        ║
  1313.    ║ CloseNOUN           │0│None       │ NOUN is now closed                      ║
  1314.    ║ LockNOUN            │0│None       │ NOUN is now locked                      ║
  1315.    ║ UnlockNOUN          │0│None       │ NOUN is now unlocked                    ║
  1316.    ║ AddToGroup          │1│Item#      │ Adds Item# to group                     ║
  1317.    ║ RemoveFromGroup     │1│Item#      │ Removes Item# from group                ║
  1318.    ║ MoveTheGroup        │1│Location#  │ Move group to Location#                 ║
  1319.    ╚═════════════════════╧═╧═══════════╧═════════════════════════════════════════╝
  1320.  
  1321.    Several of these deserve some explanation.  SendTreasureToRoom is useful
  1322.    when the game designer wishes to have the player's current treasures or
  1323.    valuables stolen or disappear.  For example:
  1324.  
  1325.         SendTreasureToRoom [Throne room] 9 ; send valuables to throne room
  1326.  
  1327.    would cause any items that were being currently carried and had point
  1328.    values of 10 or more to be sent to room [Throne room].  Items being
  1329.    carried with values of 9 or less would continue to be carried.  The
  1330.    conditional token IsCarryingTreasure can be used to test whether such a
  1331.    "theft" is appropriate.
  1332.  
  1333.  
  1334.                                       85
  1335.  
  1336.  
  1337.  
  1338.  
  1339.    The SwapLocations action token is very useful whenever the game designer
  1340.    wishes to change the status or condition of an item.  For example, this
  1341.    action can be used to replace a closed door with an open door, or to
  1342.    replace an egg with egg shell pieces (when the player gives the input
  1343.    BREAK EGG), or to replace a small plant with a larger plant (when the
  1344.    player inputs the command WATER PLANT), or to replace a frog with a
  1345.    handsome prince (when the player inputs KISS FROG).  A very useful and
  1346.    powerful token!
  1347.  
  1348.    The last group of actions do a variety of tasks:
  1349.  
  1350.                        ┌─────────────────────────────────┐
  1351.    ╔═══════════════════╡   MISCELLANEOUS ACTION TOKENS   ╞═══════════════════════╗
  1352.    ║                   └─────────────────────────────────┘                       ║
  1353.    ║                      NUMBER/TYPES                                           ║
  1354.    ║ TOKEN NAME           OF PARAMETERS              EXPLANATION                 ║
  1355.    ╠═════════════════════╤═╤═══════════╤═════════════════════════════════════════╣
  1356.    ║ ShowScore           │0│None       │ Show current SCORE                      ║
  1357.    ║ PlusScore           │1│Number     │ Add Number to current SCORE             ║
  1358.    ║ MinusScore          │1│Number     │ Subtract Number from current SCORE      ║
  1359.    ║ ShowInventory       │0│None       │ Show current INVENTORY                  ║
  1360.    ║ ShowContents        │1│Number     │ Show contents (if any) of entity Number ║
  1361.    ║ WaitForReturn       │0│None       │ Print 'Hit RETURN' message and wait     ║
  1362.    ║ TimePasses          │0│None       │ Show 'Time passes...' message           ║
  1363.    ║ Delay               │1│Number     │ Delay for Number seconds                ║
  1364.    ║ ClearScreen         │0│None       │ Clear screen                            ║
  1365.    ║ DescribeThing       │1│Number     │ Describe thing Number (whatever)        ║
  1366.    ║ LookAtRoom          │0│None       │ Cause a VERBOSE look at room            ║
  1367.    ║ Tone                │2│Hz Ms      │ Makes a tone on speaker of Hz Hertz (440║
  1368.    ║                     │ │           │  Hertz = A on piano) for Ms milliseconds║
  1369.    ║ PrintMessage        │1│Number     │ Print message Number in .AGT file       ║
  1370.    ║ RandomMessage       │2│Num1 Num2  │ Randomly picks a message from Num1 to   ║
  1371.    ║                     │ │           │   Num2 in .AGT file and prints it       ║
  1372.    ║ BlankLine           │0│None       │ Print a blank line                      ║
  1373.    ║ GetNumberInput      │2│Num1 Num2  │ Prompt for player to input a Number     ║
  1374.    ║                     │ │           │   where Num1 <= Number <= Num2.         ║
  1375.    ║                     │ │           │   If Num1=Num2, then no range will be   ║
  1376.    ║                     │ │           │   given in prompt.                      ║
  1377.    ║ AskQuestion         │1│Question#  │ Ask and get answer to question#         ║
  1378.    ╚═════════════════════╧═╧═══════════╧═════════════════════════════════════════╝
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.                                          86
  1393.  
  1394.  
  1395.  
  1396.  
  1397.                   ┌────────────────────────────────────────────┐
  1398.    ╔══════════════╡   MISCELLANEOUS ACTION TOKENS - CONTINUED  ╞═════════════════╗
  1399.    ║              └────────────────────────────────────────────┘                 ║
  1400.    ║                      NUMBER/TYPES                                           ║
  1401.    ║ TOKEN NAME           OF PARAMETERS              EXPLANATION                 ║
  1402.    ╠═════════════════════╤═╤═══════════╤═════════════════════════════════════════╣
  1403.    ║ ChangePassageway    │2│Dir# Loc#  │ Create or close a passageway            ║
  1404.    ║                     │ │           │   from current_room to Loc# via Dir#.   ║
  1405.    ║                     │ │           │   Dir# = 1 = north...Dir # = 12 = exit. ║
  1406.    ║                     │ │           │   If Loc# = 0 then closes passageway.   ║
  1407.    ║                     │ │           │   If Loc# <> 0 then opens passageway    ║
  1408.    ║                     │ │           │   to room Loc# via direction Dir#.      ║
  1409.    ║                     │ │           │   Passageways are opened or closed at   ║
  1410.    ║                     │ │           │   both ends simultaneously!             ║
  1411.    ║ TurnFlagON          │1│Flag#      │ Turn Flag# ON                           ║
  1412.    ║ TurnFlagOFF         │1│Flag#      │ Turn Flag# OFF                          ║
  1413.    ║ ToggleFlag          │1│Flag#      │ Toggle Flag#                            ║
  1414.    ║ TurnCounterON       │1│Counter#   │ Turn Counter# ON -- sets to 1           ║
  1415.    ║ TurnCounterOFF      │1│Counter#   │ Turn Counter# OFF -- sets to 0          ║
  1416.    ║ SetVariableTo       │2│Var# Number│ Set Variable Var# to Number             ║
  1417.    ║ AddToVariable       │2│Var# Number│ Add Number to Var#                      ║
  1418.    ║ SubtractFromVariable│2│Var# Number│ Subtract Number from Var#               ║
  1419.    ║ AddVariables        │2│Var#1 Var#2│ Add Var#2 and Var#1 and put answer      ║
  1420.    ║                     │ │           │   into Var#1                            ║
  1421.    ║ SubtractVariables   │2│Var#1 Var#2│ Subtract Var#2 from Var#1 and put answer║
  1422.    ║                     │ │           │   into Var#1                            ║
  1423.    ║ RandomVariable      │2│Var# Number│ Set Var# to a random value between 0 and║
  1424.    ║                     │ │           │   Number                                ║
  1425.    ║ MakeVarRoomNum      │1│Var#       │ Set Var# to current room number         ║
  1426.    ║ MakeVarNounNum      │1│Var#       │ Set Var# to number of current noun      ║
  1427.    ║ MakeVarObjectNum    │1│Var#       │ Set Var# to number of current object    ║
  1428.    ║ GoToVariableRoom    │1│Var#       │ Send player to room number in Var#      ║
  1429.    ║ SendToVariableRoom  │2│Num Var#   │ Send Noun number num to room number     ║
  1430.    ║                     │ │           │   in Var#                               ║
  1431.    ║ GetVariableIt       │1│Var#       │ Get noun number in Var#                 ║
  1432.    ║ PrintVariableMessage│1│Var#       │ Print message number in Var#            ║
  1433.    ║ NounToVariable      │1│Var#       │ Set Var# to literal value of noun       ║
  1434.    ║ ObjectToVariable    │1│Var#       │ Set Var# to literal value of object     ║
  1435.    ║ WinGame             │0│None       │ Player wins game at end of turn         ║
  1436.    ║ EndGame             │0│None       │ Game ends at end of turn                ║
  1437.    ║ QuitThisCMD         │0│None       │ Quit evaluating this CMD                ║
  1438.    ║ QuitAllCMDs         │0│None       │ Finished with all meta-commands         ║
  1439.    ║ DoneWithTurn        │0│None       │ All Done this turn -- get input next    ║
  1440.    ║ ReDirectTo          │0│None       │ See explanation in manual.              ║
  1441.    ╚═════════════════════╧═╧═══════════╧═════════════════════════════════════════╝
  1442.  
  1443.  
  1444.    SPECIAL META-COMMAND SITUATIONS
  1445.  
  1446.    There are some very powerful (and potentially confusing) actions above! 
  1447.    Some words of explanation and some examples are in order.  Specific
  1448.    topics to be covered below are: (1) Flags, (2) Counters, (3) Variables,
  1449.  
  1450.                                       87
  1451.  
  1452.  
  1453.  
  1454.  
  1455.    (4) Number Input, (5) Asking and Answering Questions, (6) Dealing with
  1456.    Multiple Nouns with the Same Name, (7) Handling the Contents of Various
  1457.    Things, (8) Opening and Closing Passageways Between Rooms, and (9) Meta-
  1458.    command Redirection.
  1459.  
  1460.  
  1461.    FLAGS
  1462.  
  1463.    The game designer has 255 Flags at his disposal.  They are turned on
  1464.    with the TurnFlagON token, turned off with the TurnFlagOFF token and
  1465.    toggled with the ToggleFlag token.  They are tested with the FlagON and
  1466.    FlagOFF condition tokens.  The game designer should take great care in
  1467.    selecting and documenting his use of Flags.  Always, explain what each
  1468.    Flag stands for and what the ON and OFF conditions mean in comments at
  1469.    the beginning of the .AGT file!  Whenever you change the condition of a
  1470.    Flag explain what this new condition stands for in the game!
  1471.  
  1472.    When the game starts, all Flags are OFF.  This fact can be used to test
  1473.    if certain initial actions should be taken, such as, making sure the
  1474.    flashlight's batteries are fresh.  When the game is SAVEd and RESTOREd
  1475.    the condition of the Flags, Counters and Variables is also SAVEd and
  1476.    RESTOREd.
  1477.  
  1478.  
  1479.    DEBUG FLAG
  1480.  
  1481.    There is a Flag number 0 which is used by AGT to toggle the debugging
  1482.    mode of meta-commands.  When Flag 0 is ON then each meta-command being
  1483.    considered will be output to the screen.  By giving the input command
  1484.    SCRIPT you can also route this information to the printer.  This
  1485.    capability can be invaluable when you are trying to fathom a complex
  1486.    meta-command "bug".  The best way to use this capability in your game is
  1487.    to define a custom verb like DEBUG in the verb synonym section of the
  1488.    .AGT file and then define a meta-command like:
  1489.  
  1490.         COMMAND DEBUG
  1491.         ToggleFlag 0 ; Toggles meta-command Debug mode
  1492.         DoneWithTurn ; Finished with this turn
  1493.         END_COMMAND
  1494.  
  1495.  
  1496.    COUNTERS
  1497.  
  1498.    There are 50 Counters (1 to 50) in AGT that can be turned ON with the
  1499.    TurnCounterON token and turned OFF with the TurnCounterOFF token.  When
  1500.    a counter is ON, it is automatically incremented at each turn of the
  1501.    game.  When a counter is OFF, it is set to zero and is not incremented. 
  1502.    The condition of these counters can be tested using the CounterEquals,
  1503.    CounterGT and CounterLT conditional tokens.  Using counters is very
  1504.    useful for such things as keeping track of the number of turns (1) a
  1505.    torch is lit, (2) a player has been underwater using an aqua-lung, or
  1506.    (3) a time-bomb has been ticking.  The value of a counter can be printed
  1507.  
  1508.                                       88
  1509.  
  1510.  
  1511.  
  1512.  
  1513.    in a message by using #CTR5# (to print counter number 5).  The game
  1514.    designer's use of Counters should be very carefully commented in the
  1515.    .AGT file!
  1516.  
  1517.  
  1518.    VARIABLES
  1519.  
  1520.    There are 50 Variables (1 to 50) in AGT that can be set to a specific
  1521.    value with the SetVariableTo token and added to with the AddToVariable
  1522.    token and subtract from with SubtractFromVariable token.  These
  1523.    variables can also be set to a random value with the RandomVariable
  1524.    token, and variables can be added together with the AddVariables, and
  1525.    subtracted from one another using the SubtractVariables token.  The
  1526.    condition of these variables can be tested using the VariableEquals,
  1527.    VariableGT and VariableLT and VariableChance conditional tokens.  Using
  1528.    variables is very useful for such things as keeping track of the number
  1529.    of times (1) a player has asked for HELP, (2) a player has crossed a
  1530.    certain rickety bridge, or (3) until a specific event happens (like the
  1531.    cave closes or the lamp's batteries go out).  Other excellent uses of
  1532.    variables are to keep track of various attributes the player may have
  1533.    such as Strength, Health, Charisma, etc.  The value of a variable can be
  1534.    printed in a message by using #VAR3# (to print variable number 3).
  1535.  
  1536.    As an example, the following meta-commands in the .AGT file will (1)
  1537.    initialize the flash batteries to last a total of 100 turns, (2)
  1538.    decrement a variable for every turn the light is ON, (3) issue warnings
  1539.    when the battery will last 20 turns or less, (4) "kill" the flashlight
  1540.    when the batteries finally go out, (5) turn the flashlight ON and OFF
  1541.    with the input commands LIGHT and EXTINGUISH.
  1542.  
  1543.    First, the basic FLAG and VARIABLE definitions:
  1544.  
  1545.         FLAG [game started]
  1546.         FLAG [flashlight lit]
  1547.  
  1548.         VARIABLE [batt life]   ; will count down the life of the battery
  1549.         #DEFINE [initial battery charge] 100
  1550.         #DEFINE [battery warning level] 20
  1551.  
  1552.    Next, the ANY commands associated with the flashlight:
  1553.  
  1554.         COMMAND ANY
  1555.         FlagOFF [game started] [First turn -- initialize Battery life]
  1556.         SetVariableTo [batt life] [initial battery charge]
  1557.         TurnFlagON [game started]
  1558.         END_COMMAND
  1559.  
  1560.         COMMAND ANY
  1561.         FlagON [flashlight lit]
  1562.         SubtractFromVariable [batt life] 1
  1563.         END_COMMAND
  1564.  
  1565.  
  1566.                                       89
  1567.  
  1568.  
  1569.  
  1570.  
  1571.         COMMAND ANY
  1572.         FlagON [flashlight lit]
  1573.         Present [on flashlight]
  1574.         VariableGT [batt life] 0
  1575.         NOT VariableGT [batt life] [battery warning level]
  1576.         PrintMessage 
  1577.         Flashlight will last only #VAR[batt life]# more turns!
  1578.         END_Message
  1579.         #COMMENT display the next message only once
  1580.         VariableEquals [batt life] [battery warning level]
  1581.         PrintMessage "You had better save your batteries!"
  1582.         END_COMMAND
  1583.  
  1584.         COMMAND ANY
  1585.         FlagON [flashlight lit]
  1586.         VariableEquals [batt life] 0
  1587.         TurnFlagOFF [flashlight lit] [Turn it off for the last time!]
  1588.         SwapLocations [on flashlight] [dead flashlight]
  1589.         Present [dead flashlight] [No message unless Flashlight here]
  1590.         PrintMessage "The flashlight's batteries are dead!!"
  1591.         END_COMMAND
  1592.  
  1593.    Last, the specific VERB-NOUN commands associated with the flashlight:
  1594.  
  1595.         COMMAND LIGHT FLASHLIGHT
  1596.         Present [off flashlight]
  1597.         TurnFlagON [flashlight lit]
  1598.         SwapLocations [off flashlight] [on flashlight]
  1599.         PrintMessage "The flashlight is ON and shining brightly!"
  1600.         DoneWithTurn
  1601.         END_COMMAND
  1602.  
  1603.         COMMAND LIGHT FLASHLIGHT
  1604.         Present [on flashlight]
  1605.         PrintMessage "The flashlight is already ON, dummy!"
  1606.         DoneWithTurn
  1607.         END_COMMAND
  1608.  
  1609.         COMMAND LIGHT FLASHLIGHT
  1610.         Present [dead flashlight]
  1611.         PrintMessage "Sorry, but the batteries are dead!"
  1612.         DoneWithTurn
  1613.         END_COMMAND
  1614.  
  1615.         COMMAND EXTINGUISH FLASHLIGHT
  1616.         Present [on flashlight]
  1617.         TurnFlagOFF [flashlight lit]
  1618.         SwapLocations [off flashlight] [on flashlight]
  1619.         PrintMessage "The flashlight is now off!"
  1620.         DoneWithTurn
  1621.         END_COMMAND
  1622.  
  1623.  
  1624.                                       90
  1625.  
  1626.  
  1627.  
  1628.  
  1629.         COMMAND EXTINGUISH FLASHLIGHT
  1630.         Present [off flashlight]
  1631.           OR
  1632.         Present [dead flashlight]
  1633.         PrintMessage "The flashlight is already OFF!"
  1634.         DoneWithTurn
  1635.         END_COMMAND
  1636.  
  1637.    Here is another example that shows how a VARIABLE might be used to cause
  1638.    different shots of a phaser firing to cause different events in a "Star
  1639.    Trek" adventure:
  1640.  
  1641.         #COMMENT
  1642.         AGT "Star Trek" game excerpt -- a simple example showing a few of
  1643.         the features of AGT
  1644.         #END_COMMENT
  1645.  
  1646.         FLAG [game started]
  1647.         VARIABLE [phaser shots] ; remaining phaser energy
  1648.  
  1649.         COMMAND ANY
  1650.         FlagOFF [game started]
  1651.         TurnFlagON [game started]
  1652.         SetVariableTo [phaser shots] 10
  1653.         END_COMMAND
  1654.  
  1655.         ROOM [bridge]
  1656.         Bridge
  1657.         SOUTH [turbolift]
  1658.         END_ROOM
  1659.  
  1660.         ROOM_DESCR [bridge]
  1661.         You are on the bridge of the Enterprise.
  1662.         END_ROOM_DESCR
  1663.  
  1664.         ROOM [turbolift]
  1665.         Turbolift
  1666.         NORTH [bridge]
  1667.         END_ROOM
  1668.  
  1669.         ROOM_DESCR [turbolift]
  1670.         You are in the turbolift.
  1671.         END_ROOM_DESCR
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.                                       91
  1683.  
  1684.  
  1685.  
  1686.  
  1687.         NOUN [phaser]
  1688.         Phaser
  1689.         Hand
  1690.         There is a hand phaser here.
  1691.         LOCATION [bridge]
  1692.         CAN_SHOOT
  1693.         NUM_SHOTS 10 ; not used; we control this with meta-commands
  1694.         SIZE 2
  1695.         END_NOUN
  1696.  
  1697.         NOUN_DESCR [phaser]
  1698.         This is a standard box-shaped Phaser I.  While not as powerful as
  1699.         the  pistol-shaped Phaser II, it is considerably more compact and
  1700.         thus easily  concealed.
  1701.         END_NOUN_DESCR
  1702.  
  1703.         COMMAND FIRE PHASER
  1704.         IsCarrying [phaser]
  1705.         VariableEquals [phaser shots] 0
  1706.         PrintMessage "The phaser is out of energy."
  1707.         DoneWithTurn
  1708.         END_COMMAND
  1709.  
  1710.         COMMAND FIRE PHASER
  1711.         AtLocation [bridge]
  1712.         IsCarrying [phaser]
  1713.         SubtractFromVariable [phaser shots] 1
  1714.         RandomMessage [fire phaser #1] [fire phaser #3]
  1715.         EndGame
  1716.         END_COMMAND
  1717.  
  1718.         MESSAGE [fire phaser #1]
  1719.         You level the phaser at the viewscreen and twist the dial to
  1720.         "KILL".
  1721.         Fortunately, Spock's telepathic powers sense the sudden insanity
  1722.         gnawing at your mind, and before you know what's happening you feel
  1723.         his familiar grip on your shoulder and you crumble to the floor. 
  1724.         You
  1725.         will be relieved of command until McCoy can straighten you out.
  1726.         END_MESSAGE
  1727.  
  1728.         MESSAGE [fire phaser #2]
  1729.         You press the trigger, but nothing happens.  For a moment you stare
  1730.         at the phaser, puzzling over the acute pain in your thumb.  Then
  1731.         you
  1732.         remember that this is a prototype Scotty has been working on,
  1733.         designed
  1734.         to foil an enemy who has stolen it.  It's been modified to inject a
  1735.         lethal dose of tricordrazine into the hand of the firer if it is
  1736.         used
  1737.         on the Enterprise.
  1738.         END_MESSAGE
  1739.  
  1740.                                       92
  1741.  
  1742.  
  1743.  
  1744.  
  1745.         MESSAGE [fire phaser #3]
  1746.         You fire the phaser.  The bridge wall is ruptured, and the area
  1747.         rapidly depressurizes.  You are killed, along with the rest of the
  1748.         bridge crew.
  1749.         END_MESSAGE
  1750.  
  1751.    Needless to say, the game designer's use of Variables should be very
  1752.    carefully commented in your .AGT file!
  1753.  
  1754.  
  1755.    NUMBER INPUT
  1756.  
  1757.    By using meta-commands it is possible to accept number input from the
  1758.    player during the course of the game and to test the number he has
  1759.    input.  An example of where such a capability might be appropriate is
  1760.    having the player open a combination safe.  An example of use,
  1761.    GetNumberInput 4 20 would cause the player to be prompted as follows:
  1762.  
  1763.         "What number (from 4 to 20) ? "
  1764.  
  1765.    This prompt would be repeated until the player entered a number in the
  1766.    correct range (i.e., an integer from 4 to 20).  If the game designer
  1767.    didn't want to limit the input number to a specific range, both
  1768.    parameters should be equal.  For example, GetNumberInput 0 0 would cause
  1769.    the prompt to be:
  1770.  
  1771.         "What number ? "
  1772.  
  1773.    Once input, the number can be tested by using the NumberEquals,
  1774.    NumberGT, and NumberLT conditional tokens.
  1775.  
  1776.    Another way that AGT will allow number input is as the Noun or Object
  1777.    within an input command.  For example, let's say the player is in an
  1778.    elevator and he needs to push a button corresponding to a floor. 
  1779.    Commands like "PUSH 3" will be accepted by the AGT parser.  The Noun "3"
  1780.    can then be assigned to a variable using the NounToVariable token,
  1781.    tested using the VariableEquals token, then the player would be sent to
  1782.    the appropriate floor.  For example, the following series of meta-
  1783.    commands will enable the player to go to any one of four floors by
  1784.    giving the correct command.
  1785.  
  1786.         VARIABLE [Floor Pushed]
  1787.  
  1788.         COMMAND PUSH ANY
  1789.         SetVariableTo [Floor Pushed] 0 ; Set to 0 to start
  1790.         AtLocation [In Elevator]
  1791.         NounToVariable [Floor Pushed] ; get floor number, if any
  1792.         VariableEquals [Floor Pushed] 1 ; Did player push 1?
  1793.         GoToRoom [1st floor]
  1794.         PrintMessage [The Elevator glides to #VAR2# and you exit.]
  1795.         DoneWithTurn ; Finished with this turn
  1796.         END_COMMAND
  1797.  
  1798.                                       93
  1799.  
  1800.  
  1801.  
  1802.  
  1803.         COMMAND PUSH ANY
  1804.         AtLocation [In Elevator]
  1805.         VariableEquals [Floor Pushed] 2 ; Did player push 2?
  1806.         GoToRoom [2nd floor]
  1807.         PrintMessage [The Elevator glides to #VAR2# and you exit.]
  1808.         DoneWithTurn ; Finished with this turn
  1809.         END_COMMAND
  1810.  
  1811.         COMMAND PUSH ANY
  1812.         AtLocation [In Elevator]
  1813.         VariableEquals [Floor Pushed] 3 ; Did player push 3?
  1814.         GoToRoom [3rd floor]
  1815.         PrintMessage [The Elevator glides to #VAR2# and you exit.]
  1816.         DoneWithTurn ; Finished with this turn
  1817.         END_COMMAND
  1818.  
  1819.         COMMAND PUSH ANY
  1820.         AtLocation [In Elevator]
  1821.         VariableEquals [Floor Pushed] 4 ; Did player push 4?
  1822.         GoToRoom [4th floor]
  1823.         PrintMessage [The Elevator glides to #VAR2# and you exit.]
  1824.         DoneWithTurn ; Finished with this turn
  1825.         END_COMMAND
  1826.  
  1827.         COMMAND PUSH ANY
  1828.         AtLocation [In Elevator]
  1829.         NOT VariableEquals [Floor Pushed] 0 ; Did player push a number?
  1830.         PrintMessage [This Elevator only has four floors.]
  1831.         DoneWithTurn ; Finished with this turn
  1832.         END_COMMAND
  1833.  
  1834.  
  1835.    ASKING AND ANSWERING QUESTIONS
  1836.  
  1837.    Asking and answering questions can be handled by using several
  1838.    meta-commands.  For example, let's assume we want to ask the trivia
  1839.    question "What is the largest human organ?" to which the correct answer
  1840.    is "skin".  We would specify the question and answer in the .AGT file as
  1841.    follows:
  1842.  
  1843.         #DEFINE [About largest organ]
  1844.         FLAG [Temporary Flag]
  1845.         QUESTION [About largest organ] WHAT IS THE LARGEST HUMAN ORGAN?
  1846.         ANSWER [About largest organ] SKIN
  1847.  
  1848.    Then the following meta-commands would ask the question and give an
  1849.    appropriate response based on whether the answer given was right or
  1850.    wrong:
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.                                       94
  1857.  
  1858.  
  1859.  
  1860.  
  1861.         COMMAND Verb Noun or ANY
  1862.         various conditions
  1863.         AskQuestion [About largest organ]
  1864.         TurnFlagON [Temporary Flag]
  1865.         AnswerIsCorrect ; tests if answer is correct
  1866.         TurnFlagOFF [Temporary Flag] ; off if answer right
  1867.         PrintMessage [Fantastic, you got it right!!]
  1868.         PlusScore 10 ; Give player 10 points for correct answer
  1869.         DoneWithTurn
  1870.         END_COMMAND
  1871.  
  1872.         COMMAND Same Verb Noun or ANY
  1873.         FlagON [Temporary Flag] ; not turned off in previous COMMAND
  1874.         TurnFlagOFF [Temporary Flag] ; so, turn temporary flag off now
  1875.         PrintMessage [Sorry, you got it wrong!!]
  1876.         DoneWithTurn
  1877.         END_COMMAND
  1878.  
  1879.    When a question is asked and a response is given, the correct answer is
  1880.    matched against the response by looking for the answer anywhere in the
  1881.    response.  This means that any of the following responses would be
  1882.    considered correct by AGT:
  1883.  
  1884.         SKIN
  1885.         I THINK THE ANSWER IS SKIN
  1886.         THE CORRECT RESPONSE IS "SKIN"
  1887.         ANYONE KNOWS IT IS SKIN, YOU TURKEY COMPUTER!
  1888.  
  1889.    The game designer can have up to 25 sets of questions and answers (1 to
  1890.    25) in the .AGT file.  They could form the basis for a series of riddles
  1891.    that must be answered during the course of the adventure in order to get
  1892.    all the points and win the game.
  1893.  
  1894.  
  1895.    DEALING WITH MULTIPLE NOUNS WITH THE SAME NAME
  1896.  
  1897.    Occasionally, the game designer will have to deal with the situation
  1898.    where there are multiple nouns in the current room with the same name. 
  1899.    There are several meta-command tokens that have been specifically
  1900.    developed to help deal with this situation.  The first two are:
  1901.  
  1902.         NOUNIsNumber [label]  -- will test whether the NOUN in the player's
  1903.         current input command is NOUN [label] and return a TRUE condition
  1904.         if the noun's number was num and a FALSE condition otherwise.
  1905.  
  1906.         ObjectIsNumber [label] -- will perform a similar test on the OBJECT
  1907.         in the player's current input command.
  1908.  
  1909.    These two meta-command tokens will be useful whenever the game has a
  1910.    variety of nouns and objects with the same name and the game designer
  1911.    only wants to allow certain actions to occur when specific nouns and/or
  1912.    objects are used in the player's input command.  For example, let's
  1913.  
  1914.                                       95
  1915.  
  1916.  
  1917.  
  1918.  
  1919.    consider a scenario where there are multiple "drawers" and multiple
  1920.    "keys" -- potentially all in the same room -- and we want the [brass
  1921.    key] to break whenever it is used to unlock the [middle drawer].  This
  1922.    could be done using these two tokens as follows:
  1923.  
  1924.         COMMAND UNLOCK DRAWER WITH KEY
  1925.         Present [Brass key]
  1926.         Present [Middle drawer]
  1927.         NOUNIsNumber [Middle Drawer] ; The middle drawer was specified
  1928.         ObjectIsNumber [Brass key] ; was also specified in input
  1929.         SwapLocations [Brass Key] [Broken key]
  1930.         PrintMessage [The key broke in the lock]
  1931.         UnLockIt [Middle drawer]
  1932.         DoneWithTurn
  1933.         END_COMMAND
  1934.  
  1935.  
  1936.    HANDLING THE CONTENTS OF VARIOUS THINGS
  1937.  
  1938.    AGT has two meta-command tokens that are extremely useful whenever you
  1939.    needed to deal with the contents of ROOMs, NOUNs or CREATUREs:
  1940.  
  1941.         SomethingInside [label] -- will test whether entity [label]
  1942.         something inside it.  [label] can be a number for a ROOM, a NOUN or
  1943.         a CREATURE.
  1944.  
  1945.         ShowContents [label] -- will display the contents of the entity
  1946.         [label] if that entity has something inside it.  If there is
  1947.         nothing inside the entity [label], this token will have no effect.
  1948.  
  1949.    As an example of how these tokens might be used, let's continue with the
  1950.    above scenario.  Specifically, let's develop some meta-commands for the
  1951.    situation where the player wishes to SEARCH THE MIDDLE DRAWER:
  1952.  
  1953.         COMMAND SEARCH THE DRAWER
  1954.         Present [Middle drawer]
  1955.         NOUNIsNumber [Middle drawer] ; was specified in input
  1956.         IsLocked [Middle drawer] ; is locked
  1957.         PrintMessage [The $adjective$ $noun$ is locked.]
  1958.         DoneWithTurn
  1959.         END_COMMAND
  1960.  
  1961.         COMMAND SEARCH THE DRAWER
  1962.         Present [Middle drawer]
  1963.         NOUNIsNumber [Middle drawer] ; was specified in input
  1964.         IsUnLocked [Middle drawer] ; is unlocked
  1965.         OpenIt [Middle drawer] ; Open the middle drawer -- first
  1966.         NOT SomethingInside [Middle drawer] ; it's empty
  1967.         PrintMessage [The $adjective$ $noun$ is empty.]
  1968.         DoneWithTurn
  1969.         END_COMMAND
  1970.  
  1971.  
  1972.                                       96
  1973.  
  1974.  
  1975.  
  1976.  
  1977.         COMMAND SEARCH THE DRAWER
  1978.         Present [Middle drawer]
  1979.         NOUNIsNumber [Middle drawer] ; was specified in input
  1980.         IsUnLocked [Middle drawer] ; is unlocked
  1981.         OpenIt [Middle drawer] ; Open the middle drawer -- first
  1982.         SomethingInside [Middle drawer] ; it's NOT empty
  1983.         PrintMessage [The $adjective$ $noun$ contains:]
  1984.         ShowContents [Middle drawer] ; Display contents of middle drawer
  1985.         DoneWithTurn
  1986.         END_COMMAND
  1987.  
  1988.  
  1989.    OPENING AND CLOSING PASSAGEWAYS BETWEEN ROOMS
  1990.  
  1991.    The ChangePassageway token can be used in a meta-command to open or
  1992.    close passageways between rooms during the game.  For example, to open a
  1993.    secret passage between room [Dungeon cell] and room [Harem] when the
  1994.    command SESAME is given could be done with the following:
  1995.  
  1996.         COMMAND SESAME
  1997.         AtLocation [Dungeon cell]
  1998.         InRoom [stone wall]
  1999.         ChangePassageway [South] [Harem] ; open passage South
  2000.         SwapLocations [stone wall] [wall with opening]
  2001.         SwapLocations [Harem stone wall] [Harem wall with opening]
  2002.         ; Swap for solid wall with wall with door in Harem also
  2003.         PrintMessage [A large doorway magically appears]
  2004.         DoneWithTurn
  2005.         END_COMMAND
  2006.  
  2007.    Once this meta-command has opened the passageway between these rooms,
  2008.    the player could go to room [Harem] from room [Dungeon Cell] by giving
  2009.    the SOUTH, or conversely go to room [Dungeon Cell] from room [Harem] by
  2010.    giving the command NORTH.  The passageway is opened in both rooms in
  2011.    opposite directions.
  2012.  
  2013.    The same token can be used to close a passageway as well.  For example,
  2014.    if the statue in the treasure room was "booby-trapped", a command of GET
  2015.    STATUE might cause an avalanche of rocks to close the west exit from the
  2016.    treasure room as follows:
  2017.  
  2018.         COMMAND GET STATUE
  2019.         AtLocation [Treasure room]
  2020.         InRoom [statue]
  2021.         FlagOFF [Booby trap]
  2022.         TurnFlagON [Bobby trap]
  2023.         ChangePassageway [West] [close] ; close passageway to the West
  2024.         SwapLocations [open doorway] [jumble of rocks]
  2025.         SwapLocations [other open doorway] [other jumble of rocks]
  2026.         ; Put jumble of rocks in other room also
  2027.         PrintMessage [Crash and rocks buries the doorway!!]
  2028.         GetIt [statue] ; You wanted it -- You got it!!
  2029.  
  2030.                                       97
  2031.  
  2032.  
  2033.  
  2034.  
  2035.         DoneWithTurn
  2036.         END_COMMAND
  2037.  
  2038.    The #DEFINEs needed for the numbers corresponding to the various
  2039.    directions are as follows:
  2040.  
  2041.         #COMMENT macros for the directions used with ChangePassageway
  2042.         #DEFINE [close] 0
  2043.         #DEFINE [North] 1
  2044.         #DEFINE [South] 2
  2045.         #DEFINE [East] 3
  2046.         #DEFINE [West] 4
  2047.         #DEFINE [NorthEast] 5
  2048.         #DEFINE [NorthWest] 6
  2049.         #DEFINE [SouthEast] 7
  2050.         #DEFINE [SouthWest] 8
  2051.         #DEFINE [Up] 9
  2052.         #DEFINE [Down] 10
  2053.         #DEFINE [Enter] 11
  2054.         #DEFINE [Exit] 12
  2055.  
  2056.  
  2057.    META-COMMAND REDIRECTION
  2058.  
  2059.    Meta-commands can be redirected to other meta-commands.  The principal
  2060.    use of this capability is when there are several player input commands
  2061.    which should be handled by the game in the same way.  For example, in
  2062.    the CAVE adventure, we want the same series of meta-commands to be used
  2063.    if the player enters "WATER THE PLANT" or "POUR WATER ON THE PLANT". 
  2064.    With meta-command redirection, the series of meta-commands we wish to
  2065.    use needs to be given only once in the .AGT file.  The second use can be
  2066.    simply redirected to the first.  For example, let's assume that all of
  2067.    the necessary meta-commands are given completely for POUR WATER ON
  2068.    PLANT, then the appropriate redirection for WATER PLANT could be
  2069.    accomplished by the following lines in the .AGT file:
  2070.  
  2071.         COMMAND WATER PLANT
  2072.         ReDirectTo POUR WATER ON PLANT
  2073.         END_COMMAND
  2074.  
  2075.    Notice in the above example that we redirected the meta-command for a
  2076.    fixed input command (WATER PLANT) to another fixed command (POUR WATER
  2077.    ON PLANT).  It is also possible to redirect meta-commands for ANY words. 
  2078.    For example, if we wished to redirect the meta-command WATER ANY we
  2079.    could do it with the following:
  2080.  
  2081.         COMMAND WATER ANY
  2082.         ReDirectTo POUR WATER ON $NOUN$
  2083.         END_COMMAND
  2084.  
  2085.    Notice that by using $NOUN$ in the "redirected" command, we can "map"
  2086.    the original command's noun (from WATER PLANT or WATER TREE, or WATER
  2087.  
  2088.                                       98
  2089.  
  2090.  
  2091.  
  2092.  
  2093.    whatever) to the new command's object.  This redirected command causes
  2094.    the game to convert a command to "WATER THING" to act as if the player
  2095.    had actually typed in "POUR WATER ON THING".  In addition to $NOUN$, it
  2096.    is also possible to use $VERB$, $NAME$ and $OBJECT$ whenever we wish to
  2097.    "map" these words into another use within a redirected command.  You
  2098.    should not use ANY in the redirected command, i.e., ReDirectTo POUR
  2099.    WATER ON ANY would make AGT think the player had actually typed in "POUR
  2100.    WATER ON ANY".
  2101.  
  2102.  
  2103.    META-COMMAND SUBROUTINES
  2104.  
  2105.    The Master's Edition allows the game designer to create and use
  2106.    Subroutines within his/her meta-commands.  This is done by specifying
  2107.    the Subroutines in a list in your game source file as follow:
  2108.  
  2109.         SUBROUTINES
  2110.         [Sub example 1]
  2111.         [Sub example 2]
  2112.         [Subroutine for Random Beep]
  2113.           ...
  2114.         [Subroutine for something else]
  2115.         END_SUBROUTINE
  2116.  
  2117.    There may be up to 15 Subroutines in your list.  If you try to define
  2118.    more than 15 Subroutines, you will get an error message when you compile
  2119.    your game.
  2120.  
  2121.    The Subroutines are just like other meta-commands; you may use any
  2122.    conditional tokens and/or any action tokens you desire.  You define your
  2123.    Subroutines by using the SUBROUTINE# as the "verb" in a normal COMMAND
  2124.    -- as follows:
  2125.  
  2126.         COMMAND SUBROUTINE[Sub example 1]
  2127.         PrintMessage "You are in Subroutine number [Sub example 1]."
  2128.         END_COMMAND
  2129.  
  2130.         COMMAND SUBROUTINE[Sub example 1]
  2131.         PrintMessage "You still are in Subroutine number [Sub example 1]."
  2132.         Return
  2133.         END_COMMAND
  2134.  
  2135.         COMMAND SUBROUTINE[Sub example 1]
  2136.         ! This part of Subroutine [Sub example 1] will never be executed
  2137.         ! because of the RETURN Token in the above COMMAND
  2138.         PrintMessage "Still in Subroutine number [Sub example 1] --
  2139.         really!"
  2140.         END_COMMAND
  2141.  
  2142.         COMMAND SUBROUTINE[Sub example 2]
  2143.         PrintMessage "You are in Subroutine number [Sub example 2]."
  2144.         END_COMMAND
  2145.  
  2146.                                       99
  2147.  
  2148.  
  2149.  
  2150.  
  2151.         COMMAND SUBROUTINE[Sub example 2]
  2152.         PrintMessage "You still are in Subroutine number [Sub example 2]."
  2153.         END_COMMAND
  2154.  
  2155.         COMMAND SUBROUTINE[Sub example 2]
  2156.         ! The next Token is an example of a "nested" subroutine, i.e.,     
  2157.         ! Subroutine [Sub example 2] calls Subroutine [Sub example 1]
  2158.         DoSubroutine [Sub example 1]
  2159.         PrintMessage "Still in Subroutine number [Sub example 2] --
  2160.         really!"
  2161.         Return
  2162.         END_COMMAND
  2163.  
  2164.    IMPORTANT NOTE:  There must NOT be a space after the word SUBROUTINE
  2165.    following the COMMAND or you will get an error indicating that the verb
  2166.    "SUBROUTINE" is not a valid verb.  If you have logic problems with your
  2167.    subroutines, be sure to check that every subroutine as one or more
  2168.    RETURNs!
  2169.  
  2170.    These Subroutines might be called in the body of your game by doing
  2171.    something like the following:
  2172.  
  2173.         COMMAND DRINK HANDCUFFS  <-- Dumb command, just an example!
  2174.           ...
  2175.         DoSubroutine [Sub example 1]
  2176.         PrintMessage "Back in DRINK HANDCUFFS meta-command!"
  2177.           ...
  2178.         DoneWithTurn
  2179.         END_COMMAND
  2180.  
  2181.         COMMAND EAT HANDCUFFS  <-- Dumb command, just an example!
  2182.           ...
  2183.         DoSubroutine [Sub example 2]
  2184.         PrintMessage "Back in EAT HANDCUFFS meta-command!"
  2185.           ...
  2186.         DoneWithTurn
  2187.         END_COMMAND
  2188.  
  2189.    If the player gave the input command DRINK HANDCUFFS, he/she would see
  2190.    the following on the screen:
  2191.  
  2192.         You are in Subroutine number 1.
  2193.         You still are in Subroutine number 1.
  2194.         Back in DRINK HANDCUFFS meta-command!
  2195.  
  2196.    If the player gave the input command EAT HANDCUFFS, he/she would see the
  2197.    following on the screen:
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.                                      100
  2205.  
  2206.  
  2207.  
  2208.  
  2209.         You are in Subroutine number 2.
  2210.         You still are in Subroutine number 2.
  2211.         You are in Subroutine number 1.
  2212.         You still are in Subroutine number 1.
  2213.         Still in Subroutine number 2 -- really!
  2214.         Back in EAT HANDCUFFS meta-command!
  2215.  
  2216.    Here is a little more meaningful example from the HURRY game.  First, we
  2217.    define three subroutines as follows:
  2218.  
  2219.         SUBROUTINES
  2220.         [Player Dies! Subroutine]
  2221.         [Player Wins! Subroutine]
  2222.         [Player Loses! Subroutine]
  2223.         [Game Ends! Subroutine]
  2224.         END_SUBROUTINES
  2225.  
  2226.         COMMAND SUBROUTINE[Player Dies! Subroutine]
  2227.         StopSong
  2228.         PlaySong [Funeral Dirge]
  2229.         BlankLine
  2230.         PrintMessage "Sorry, but you have died."
  2231.         Return
  2232.         END_COMMAND
  2233.  
  2234.         COMMAND SUBROUTINE[Player Wins! Subroutine]
  2235.         StopSong
  2236.         PlaySong [Winner's Fan Fare]
  2237.         BlankLine
  2238.         PrintMessage "Congratulations!  You have won the game."
  2239.         Return
  2240.         END_COMMAND
  2241.  
  2242.         COMMAND SUBROUTINE[Player Loses! Subroutine]
  2243.         StopSong
  2244.         PlaySong [Circus Music]
  2245.         BlankLine
  2246.         PrintMessage
  2247.         Sorry, Buzz, but you blew it!  You have just lost the game.
  2248.         END_Message
  2249.         Return
  2250.         END_COMMAND
  2251.  
  2252.         COMMAND SUBROUTINE[Game Ends! Subroutine]
  2253.         BlankLine
  2254.         PrintMessage "The game is now over and the final score is ...."
  2255.         BlankLine
  2256.         ShowScore
  2257.         BlankLine
  2258.         WaitForReturn
  2259.         ShowPicture [THE-END pic]
  2260.         EndGame
  2261.  
  2262.                                      101
  2263.  
  2264.  
  2265.  
  2266.  
  2267.         Return
  2268.         END_COMMAND
  2269.  
  2270.    Now let's show a couple of the ways that these subroutines are used in
  2271.    the HURRY game.  Specifically, the player will die and the game will end
  2272.    when the player does something extremely dangerous or stupid, such as
  2273.    (1) staying too long in the tiger's cage without any meat to feed it,
  2274.    (2) wearing the gorilla suit in the cage with a real gorilla, or (3)
  2275.    jumping to the ground when hanging on the high-wire.  These three
  2276.    situations are handled in the HURRY game via the following three
  2277.    meta-commands:
  2278.  
  2279.         COMMAND ANY
  2280.         Present [Straw]
  2281.         NOT InRoom [Meat]
  2282.         Chance 25
  2283.         PrintMessage 
  2284.         The tiger suddenly decides to have dinner and you are it!
  2285.         END_Message
  2286.         DoSubRoutine [Player Dies! Subroutine]
  2287.         DoSubRoutine [Game Ends! Subroutine]
  2288.         DoneWithTurn
  2289.         END_COMMAND
  2290.  
  2291.         COMMAND ANY
  2292.         Present [Straw - Gorilla]
  2293.         IsWearing [Gorilla Suit]
  2294.         Chance 50
  2295.         PrintMessage
  2296.         The gorilla suddenly figures out that you are a rival gorilla
  2297.         (because of your gorilla suit) and decides that it does not want
  2298.         any rivals.  It rushes you and grabs you with both of its huge
  2299.         hands.  The gorilla lifts you up above its head, shakes you in the
  2300.         air, and then throws you to the floor of the cage with a thunk!  It
  2301.         then jumps up and down on your body until you finally die.
  2302.         END_Message
  2303.         DoSubRoutine [Player Dies! Subroutine]
  2304.         DoSubRoutine [Game Ends! Subroutine]
  2305.         DoneWithTurn
  2306.         END_COMMAND
  2307.  
  2308.         COMMAND JUMP
  2309.         AtLocation [Hanging On Wire]
  2310.         PrintMessage [You let go of the wire and fall down...]
  2311.         DoSubRoutine [Player Dies! Subroutine]
  2312.         DoSubRoutine [Game Ends! Subroutine]
  2313.         DoneWithTurn
  2314.         END_COMMAND
  2315.  
  2316.    Below is a meta-command that causes the player to lose the game (but not
  2317.    die) when the villain of the game, the evil clown Boffo, escapes before
  2318.    the player can capture him:
  2319.  
  2320.                                      102
  2321.  
  2322.  
  2323.  
  2324.  
  2325.         COMMAND ANY
  2326.         Present [Boffo in Balloon overhead]
  2327.         VerbIsDirection
  2328.         PrintMessage "Boffo's balloon disappears over the horizon."
  2329.         Destroy [Boffo in Balloon overhead]
  2330.         TurnFlagOFF [Doing "End Game"]
  2331.         DoSubRoutine [Player Loses! Subroutine]
  2332.         DoSubRoutine [Game Ends! Subroutine]
  2333.         END_COMMAND
  2334.  
  2335.    Finally, below is a meta-command that causes the player to win the game
  2336.    when he captures the evil Boffo by slapping the handcuffs on him:
  2337.  
  2338.         COMMAND PUT CUFFS ON BOFFO
  2339.         Present [Handcuffs]
  2340.         Present [Sad Boffo]
  2341.         AtLocation [Field K]
  2342.           OR
  2343.         AtLocation [On Rocks]
  2344.           OR
  2345.         AtLocation [Tree Top K]
  2346.         PrintMessage
  2347.         As you slap the cuffs on Boffo, you can taste the sweet fruits of
  2348.         victory!
  2349.         END_Message
  2350.         PlusScore 70
  2351.         DoSubRoutine [Player Wins! Subroutine]
  2352.         DoSubRoutine [Game Ends! Subroutine]
  2353.         DoneWithTurn
  2354.         END_COMMAND
  2355.  
  2356.    Subroutines may be "nested" to any level (only limited by available
  2357.    memory of the player's computer).  You should exercise great care when
  2358.    "nesting" subroutines, however.  It is possible to create "endless
  2359.    loops" if you are not very careful.  If you seem to be having trouble
  2360.    following the logic and flow of your Subroutines (or other
  2361.    meta-commands) be sure to use the "debug" option by giving the command
  2362.    AGTDEBUG.
  2363.  
  2364.    Whenever you have logic problems with your subroutines, be sure to check
  2365.    that every subroutine as one or more RETURNs.
  2366.  
  2367.    As you can see from the above examples there are two new tokens used
  2368.    with Subroutines:
  2369.  
  2370.         DoSubroutine {num1}     --    This causes the meta-commands in
  2371.                                       Subroutine num1 to be executed
  2372.  
  2373.         Return                  --    This causes an immediate exit from
  2374.                                       the currently executing Subroutine
  2375.                                       (if any), i.e., normal command
  2376.                                       processing would resume immediately
  2377.  
  2378.                                      103
  2379.  
  2380.  
  2381.  
  2382.  
  2383.                                       after the DoSubroutine token that
  2384.                                       called the Subroutine in the first
  2385.                                       place. Each Subroutine must have at
  2386.                                       least one "Return"!
  2387.  
  2388.  
  2389.    ORGANIZATION OF META-COMMANDS IN THE .AGT FILE
  2390.  
  2391.    Meta-commands like those described above are processed sequentially by
  2392.    their order of appearance in the .AGT file.  As a result, the COMMANDs
  2393.    order is very important!!  For example, let's consider a series of
  2394.    meta-commands to define a new verb FILL.  We want to be able to fill a
  2395.    bottle with water or oil depending upon where we are.  We want to break
  2396.    a vase, whenever we try to fill the vase.  Finally, we want to print
  2397.    several default messages, such as "The bottle is already full.", or 
  2398.    "The $noun$ isn't here, so you can't $verb$ it!",  or "There is nothing
  2399.    here to put in the $noun$."  or  "You have to be kidding!  You can't
  2400.    $verb$ a $noun$!!"  This can be done with the following seven
  2401.    meta-commands for the verb FILL:
  2402.  
  2403.              FLAG [bottle is already full]
  2404.  
  2405.         (1)  COMMAND FILL ANY
  2406.              NOT NOUNPresent
  2407.              PrintMessage [The $noun$ isn't here, so you can't $verb$ it!]
  2408.              DoneWithTurn
  2409.              END_COMMAND
  2410.  
  2411.         (2)  COMMAND FILL BOTTLE
  2412.              FlagON [bottle is already full]
  2413.              PrintMessage [The bottle is already full.]
  2414.              DoneWithTurn
  2415.              END_COMMAND
  2416.  
  2417.         (3)  COMMAND FILL BOTTLE
  2418.              AtLocation [inside building]
  2419.               OR
  2420.              AtLocation [valley by stream]
  2421.               OR
  2422.              AtLocation [bottom of pit with stream]
  2423.               OR
  2424.              AtLocation [cavern with waterfall]
  2425.               OR
  2426.              AtLocation [reservoir]
  2427.               OR
  2428.              AtLocation [by building]
  2429.              PrintMessage [The bottle is now full of water.]
  2430.              SwapLocations [empty bottle] [water-filled bottle]
  2431.              TurnFlagON [bottle is now full]
  2432.              DoneWithTurn
  2433.              END_COMMAND
  2434.  
  2435.  
  2436.                                      104
  2437.  
  2438.  
  2439.  
  2440.  
  2441.         (4)  COMMAND FILL BOTTLE
  2442.              AtLocation [east pit of two-pit room]
  2443.              PrintMessage [The bottle is now full of oil.]
  2444.              SwapLocations [empty bottle] [oil-filled bottle]
  2445.              TurnFlagON [bottle is now full]
  2446.              DoneWithTurn
  2447.              END_COMMAND
  2448.  
  2449.         (5)  COMMAND FILL BOTTLE
  2450.              PrintMessage [There is nothing here to put in the $noun$.]
  2451.              DoneWithTurn
  2452.              END_COMMAND
  2453.  
  2454.         (6)  COMMAND FILL VASE
  2455.              Destroy [Ming vase]
  2456.              PutInCurrentRoom [broken vase pottery shards]
  2457.              PrintMessage [You clumsy oaf!  You broke the vase.]
  2458.              DoneWithTurn
  2459.              END_COMMAND
  2460.  
  2461.         (7)  COMMAND FILL ANY
  2462.              PrintMessage [You must be kidding! You can't $verb$ a $noun$!]
  2463.              DoneWithTurn
  2464.              END_COMMAND
  2465.  
  2466.    The numbers shown in front of each of the COMMANDs are just for ease of
  2467.    this discussion.  Numbers like these should NEVER actually be included
  2468.    in a .AGT file, because they would lead to serious bugs!
  2469.  
  2470.    If these COMMANDs were in the .AGT file in the order shown, when the
  2471.    player entered a command to "FILL something", AGT would first try
  2472.    COMMAND (1) which would test whether the "something" was present.  If it
  2473.    was not present, COMMAND (1) would print the default message "The
  2474.    something isn't here, so you can't fill it!" and the DoneWithTurn would
  2475.    cause all AGT process to cease for this turn.  Only if the something was
  2476.    present, would AGT try COMMANDS (2), (3), etc.
  2477.  
  2478.    COMMAND (2) to (5) will only be tried in the "something" was the BOTTLE. 
  2479.    COMMAND (2) would be tried first, and it would test if the bottle was
  2480.    already full and give an appropriate message if it was full.  COMMAND
  2481.    (3), which would only be tried if the bottle was empty, would test if
  2482.    the player was located in places where it was possible to get water, and
  2483.    fills the bottle with water if possible.  COMMAND (4), which would only
  2484.    be tried if there was no water at the current location, would test if
  2485.    the player was at location 24, where there is oil, and fill the bottle
  2486.    with oil, if possible.  COMMAND (5) would only be tired if the player
  2487.    was not located near a source of water or a source of oil and it would
  2488.    print a message that "There is nothing here to put in the bottle".
  2489.  
  2490.    COMMAND (6) only works if the player's input is FILL VASE.  Because AGT
  2491.    got past COMMAND (1), we know that the vase is present (otherwise
  2492.    COMMAND (1) would have caused an "error" message to be printed). 
  2493.  
  2494.                                      105
  2495.  
  2496.  
  2497.  
  2498.  
  2499.    COMMAND (6) causes the broken pottery shards to be switched with the
  2500.    vase and an appropriate message to be printed.
  2501.  
  2502.    COMMAND (7) is the "default" condition for the verb FILL.  It is
  2503.    activated only if the player gave the input "FILL something" and the
  2504.    "something" is present, but it is not the BOTTLE or the VASE.  For
  2505.    example, if the player entered FILL THE ROCK, COMMAND (7) would cause
  2506.    "You must be kidding! You can't fill a rock!" to be printed.
  2507.  
  2508.    The order of these COMMANDs is very important!  Specifically, COMMAND
  2509.    (1) must be first and COMMAND (7) must be last in order for AGT to give
  2510.    the "correct" and logical default responses to the verb FILL.  Further,
  2511.    COMMAND (2) must precede and COMMAND (5) must follow COMMANDs (3) and
  2512.    (4) in order for the input "FILL BOTTLE" to work logically.  It is
  2513.    important to understand why the above sequence is critical.  Study the
  2514.    sequence again, if necessary.
  2515.  
  2516.    Besides, the order of COMMANDs for a specific verb (like FILL), it is
  2517.    also important to arrange the verbs within the .AGT file in a reasonable
  2518.    manner.  Specifically, all the meta-commands for each verb should be
  2519.    grouped together in the .AGT file.  For example:
  2520.  
  2521.               ; ANY Commands
  2522.  
  2523.         (1)   COMMAND ANY
  2524.                .
  2525.                .
  2526.         (37)  COMMAND ANY
  2527.  
  2528.               ; READ Commands
  2529.  
  2530.         (38)  COMMAND READ BOOK
  2531.                .
  2532.                .
  2533.         (46)  COMMAND READ ANY
  2534.  
  2535.               ; SEARCH Commands
  2536.  
  2537.         (47)  COMMAND SEARCH CLOSET
  2538.                .
  2539.                .
  2540.         (54)  COMMAND SEARCH ANY
  2541.  
  2542.               ; CLIMB Commands
  2543.  
  2544.         (55)  COMMAND CLIMB ROPE
  2545.                .
  2546.                .
  2547.         (69)  COMMAND CLIMB ANY
  2548.  
  2549.               ; SQUEEZE Commands
  2550.  
  2551.  
  2552.                                      106
  2553.  
  2554.  
  2555.  
  2556.  
  2557.         (70)  COMMAND SQUEEZE LEMON
  2558.                .
  2559.                .
  2560.         (82)  COMMAND SQUEEZE ANY
  2561.                .
  2562.                .
  2563.  
  2564.               ; AFTER Commands
  2565.  
  2566.         (91)  COMMAND AFTER
  2567.                .
  2568.                .
  2569.  
  2570.         (112) COMMAND AFTER
  2571.  
  2572.               ; SUBROUTINE Commands
  2573.  
  2574.         (131)  COMMAND SUBROUTINE1
  2575.                .
  2576.                .
  2577.  
  2578.         (142) COMMAND SUBROUTINE2
  2579.                .
  2580.                .
  2581.  
  2582.         (146) COMMAND SUBROUTINE3
  2583.                .
  2584.                .
  2585.  
  2586.    All the ANY meta-commands are grouped together; all the READ meta-comma-
  2587.    nds are together, etc.  All the AFTER meta-commands are grouped
  2588.    together; all the SUBROUTINE meta-commands are together.  Not only is
  2589.    this easier to follow and debug, but it is faster for AGT to process. 
  2590.    This is because, AGT processes these meta-commands using a variation of
  2591.    a technique called "Indexed Sequential Access Method" (also called
  2592.    ISAM).  What this means is: AGT keeps track of the first and last
  2593.    meta-commands for each verb.  For example, if the verb was CLIMB, AGT
  2594.    would only consider meta-commands with indices from 55 to 69.  But
  2595.    within this group, AGT considers them sequentially.
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.                                      107
  2611.  
  2612.  
  2613.  
  2614.  
  2615.    PART 4:  SAMPLE AGT META-COMMAND SCENARIOS
  2616.  
  2617.  
  2618.    This Part of the manual presents a number of scenarios where meta-
  2619.    language  commands have been used to create typical game situations. 
  2620.    These scenarios are presented in detail by showing how ROOMs, NOUNs and
  2621.    CREATUREs data are used in the .AGT file, how messages are put in the
  2622.    .AGT file, and finally how the meta-commands are written to accomplish
  2623.    the desired effects in the .AGT file.  The specific scenarios to be
  2624.    presented include: (1) defining the actions for the new verb FIND, (2)
  2625.    random activities by a castle guard, and (3) interacting with other
  2626.    characters.
  2627.  
  2628.  
  2629.    SCENARIO 1: "FIND" VERB ACTIONS
  2630.  
  2631.    One final scenario from the COLOSSAL CAVE adventure.  In this scenario,
  2632.    we want to define several actions/responses to the player's input using
  2633.    the custom user-defined verb "FIND".  Pay particular attention to how
  2634.    the player is offered a hint (for 5 points) if he inputs "FIND CAVE".
  2635.  
  2636.    In the CAVE.AGT file we would define a custom verb as:
  2637.  
  2638.         VERB
  2639.         Dummy_Verb1 FIND
  2640.         END_VERB
  2641.  
  2642.    Several messages are needed in the CAVE.AGT file as follows:
  2643.  
  2644.         MESSAGE [You are already carrying the $noun$, dummy!]
  2645.         You are already carrying the $noun$, dummy!
  2646.         END_MESSAGE
  2647.  
  2648.         MESSAGE [I would try the stream.]
  2649.         I don't know where the cave is, but hereabouts no stream can run on
  2650.         the surface for very long.  I would try the stream.
  2651.         END_MESSAGE
  2652.  
  2653.         MESSAGE [I cannot tell you where remote things are.]
  2654.         I can only tell you what you see as you move about and manipulate
  2655.         things.  I cannot tell you where remote things are.
  2656.         END_MESSAGE
  2657.  
  2658.         MESSAGE [Okay, If you're so smart, do it yourself!]
  2659.         Okay, If you're so smart, do it yourself!
  2660.         END_MESSAGE
  2661.  
  2662.         MESSAGE [I believe it is right here with you.]
  2663.         I believe what you want is right here with you.
  2664.         END_MESSAGE
  2665.  
  2666.  
  2667.  
  2668.                                      108
  2669.  
  2670.  
  2671.  
  2672.  
  2673.         MESSAGE [The Dwarf's knife vanished]
  2674.         The Dwarf's knife vanished as it struck the wall of the cave.
  2675.         END_MESSAGE
  2676.  
  2677.         MESSAGE [It must be around here somewhere.]
  2678.         I daresay whatever you want is around here somewhere.
  2679.         END_MESSAGE
  2680.  
  2681.         MESSAGE [The hint will cost you 5 points.]
  2682.         The hint will cost you 5 points.
  2683.         END_MESSAGE
  2684.  
  2685.         MESSAGE [Do you want the hint?]
  2686.         Do you want the hint?
  2687.         END_MESSAGE
  2688.  
  2689.    The meta-commands for FIND in the CAVE.AGT file would be as follows: (Be
  2690.    sure and understand the importance of the order of these COMMANDs.)
  2691.  
  2692.         FLAG [cave is closed]
  2693.         FLAG [temp flag]
  2694.         FLAG [Dwarf is here]
  2695.         FLAG [Hint about cave has been offered]
  2696.  
  2697.         ; FIND meta-commands
  2698.  
  2699.         COMMAND FIND KNIFE
  2700.         PrintMessage [The Dwarf's knife vanished] ; as it hits wall
  2701.         DoneWithTurn
  2702.         END_COMMAND
  2703.  
  2704.         COMMAND FIND ANY
  2705.         NOUNIsCarrying
  2706.         PrintMessage [You are already carrying the $noun$, dummy!]
  2707.         DoneWithTurn
  2708.         END_COMMAND
  2709.  
  2710.         COMMAND FIND ANY
  2711.         FlagON [Cave is closed]
  2712.           OR
  2713.         NOUNPresent ; NOUN is here already
  2714.         PrintMessage [It must be around here somewhere.]
  2715.         DoneWithTurn
  2716.         END_COMMAND
  2717.  
  2718.         COMMAND FIND DWARF
  2719.         FlagON [Dwarf is here]
  2720.         PrintMessage [I believe it is right here with you.]
  2721.         DoneWithTurn
  2722.         END_COMMAND
  2723.  
  2724.  
  2725.  
  2726.                                      109
  2727.  
  2728.  
  2729.  
  2730.  
  2731.         COMMAND FIND CAVE
  2732.         FlagOFF [Hint about cave has been offered]
  2733.         TurnFlagON [Hint about cave has been offered]
  2734.         PrintMessage [Do you want the hint?]
  2735.         PromptForYes
  2736.         TurnFlagON [temp flag] ; hint has been rejected - so far
  2737.         PrintMessage [The hint will cost you 5 points.]
  2738.         PrintMessage 1 ;Is that OK?
  2739.         PromptForYes
  2740.         TurnFlagOFF [temp flag]  ; Offer of hint has been accepted
  2741.         PrintMessage [I would try the stream.] ; Follow the stream 
  2742.         MinusScore 5 ;hint costs 5 points
  2743.         DoneWithTurn
  2744.         END_COMMAND
  2745.  
  2746.         COMMAND FIND CAVE
  2747.         FlagON [temp flag] ; Offer of hint was rejected
  2748.         TurnFlagOFF [temp flag] ; Turn temporary Flag OFF now
  2749.         PrintMessage [Okay, If you're so smart, do it yourself!]
  2750.         DoneWithTurn
  2751.         END_COMMAND
  2752.  
  2753.         COMMAND FIND ANY
  2754.         PrintMessage [I cannot tell you where remote things are.]
  2755.         ; Default message for FIND
  2756.         DoneWithTurn
  2757.         END_COMMAND
  2758.  
  2759.  
  2760.    SCENARIO 2: RANDOM ACTIVITIES BY GUARD
  2761.  
  2762.    This is a modification of a scenario from CRUSADE adventure.  In this
  2763.    scenario we want to create a number of encounters with guards in various
  2764.    rooms of the Baron's castle.  We will use only one CREATURE (the Guard)
  2765.    and move him around from room to room randomly.  The player can fight
  2766.    the guard, and will be thrown into a dungeon cell if he loses, and will
  2767.    cause the guard to be replaced with an unconscious guard if he wins. 
  2768.    The player can wear a disguise by wearing the Baron's armor.  If the
  2769.    guard encounters the player wearing the armor, the guard will mistake
  2770.    the player for the Baron and leave the room.  If the player attempts to
  2771.    talk to the guard without giving the proper password, the guard will
  2772.    capture the player and throw him into the dungeon.  If the player angers
  2773.    the guard in Room [small room high up in cavern wall], the guard will
  2774.    throw the player down to the cavern floor far below where the player
  2775.    will lose consciousness and later awake with a broken leg.  The leg will
  2776.    take a random number of turns to heal.  Before it heals, the player will
  2777.    be unable to move around.
  2778.  
  2779.    To give as complete a picture as possible, the needed data for this
  2780.    scenario will be shown from all its "glory."  First, we will define the
  2781.    CREATURE, ROOMs and the various NOUNs needed as:
  2782.  
  2783.  
  2784.                                      110
  2785.  
  2786.  
  2787.  
  2788.  
  2789.         CREATURE [Baron's guard]
  2790.         guard
  2791.         Baron's
  2792.         You see one of the Baron's guards.  He looks very angry.
  2793.         LOCATION [small room high up in cavern wall]
  2794.         HOSTILE
  2795.         MAN
  2796.         END_CREATURE
  2797.  
  2798.         CREATURE_DESCR [Baron's guard]
  2799.         The guard is about 6 foot 8 inches tall, but he appears even bigger
  2800.         as he looms over you.  He looks mean and is rather ugly.
  2801.         END_CREATURE_DESCR
  2802.  
  2803.         ROOM [Large cavern]
  2804.         Large cavern
  2805.         EAST [small stone room]
  2806.         LIGHT [Blazing torch] 
  2807.         END_ROOM
  2808.  
  2809.         ROOM_DESCR [Large cavern]
  2810.         You are in a very large cavern with high sheer walls.  A passage
  2811.         leads off to the east.
  2812.         END_ROOM_DESCR
  2813.  
  2814.         NOUN [cavern walls]
  2815.         walls
  2816.         cavern
  2817.         The cavern walls are quite steep.  You can't see any way to climb
  2818.         them.
  2819.         LOCATION [Large cavern]
  2820.         UNMOVABLE
  2821.         NOUN_SYNONYMS WALL
  2822.         PLURAL
  2823.         END_NOUN
  2824.  
  2825.         NOUN_DESCR [cavern walls]
  2826.         The walls are very steep and quite smooth.  You can't see any hand
  2827.         or foot holds.
  2828.         END_NOUN_DESCR
  2829.  
  2830.         NOUN [small opening]
  2831.         opening
  2832.         small
  2833.         There is an opening in the wall -- high up near the roof of the
  2834.         cavern.
  2835.         LOCATION [Large cavern]
  2836.         UNMOVABLE
  2837.         END_NOUN
  2838.  
  2839.  
  2840.  
  2841.  
  2842.                                      111
  2843.  
  2844.  
  2845.  
  2846.  
  2847.         NOUN_DESCR [small opening]
  2848.         You see a dim light shining out of the opening, but it is too high
  2849.         and far to see more.  It looks impossible to get up to the opening
  2850.         from your location at the bottom of the cavern.
  2851.         END_NOUN_DESCR
  2852.  
  2853.         ROOM [small room high up in cavern wall]
  2854.         Small room
  2855.         SOUTH [stone passage]
  2856.         LIGHT [Blazing torch] 
  2857.         END_ROOM
  2858.  
  2859.         ROOM_DESCR [small room high up in cavern wall]
  2860.         You are in a small room carved into the sheer cavern wall.  The
  2861.         south part of the room is totally open and looks out on to the
  2862.         cavern floor far below.  Be careful not to go south!  There is a
  2863.         doorway to the north.
  2864.         END_ROOM_DESCR
  2865.  
  2866.         NOUN [broken leg]
  2867.         leg
  2868.         broken
  2869.         You have a broken leg and are unable to move.
  2870.         LOCATION [Nowhere]
  2871.         UNMOVABLE
  2872.         END_NOUN
  2873.  
  2874.         NOUN_DESCR [broken leg]
  2875.         Your leg hurts like the dickens!  You are quite discouraged because
  2876.         you will need two good legs to rescue the princess and solve this
  2877.         adventure!
  2878.         END_NOUN_DESCR
  2879.  
  2880.         NOUN [silver armor]
  2881.         armor
  2882.         silver
  2883.         The Baron's silver suit of armor stands nearby.
  2884.         LOCATION 24
  2885.         WEIGHT 25
  2886.         SIZE 25
  2887.         WEARABLE
  2888.         POINTS 10
  2889.         END_NOUN
  2890.  
  2891.         NOUN_DESCR [silver armor]
  2892.         The armor is quite fancy, but it still looks like it would be
  2893.         useful in a fight.  It would cover its occupant from head to foot.
  2894.         END_NOUN_DESCR
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.                                      112
  2901.  
  2902.  
  2903.  
  2904.  
  2905.         NOUN [unconscious guard]
  2906.         guard
  2907.         unconscious
  2908.         An unconscious guard lies at your feet.
  2909.         LOCATION 0
  2910.         WEIGHT 200
  2911.         END_NOUN
  2912.  
  2913.         NOUN_DESCR [unconscious guard]
  2914.         The guard's unconscious body lies in a heap at your feet.  You have
  2915.         to step over him as you move about the passageway.  He looks like
  2916.         he will be out of action for a long time.
  2917.         END_NOUN_DESCR
  2918.  
  2919.         ROOM [Guard's Quarters]
  2920.         Guard's quarters
  2921.         EAST [Portico]
  2922.         END_ROOM
  2923.  
  2924.         ROOM_DESCR [Guard's Quarters]
  2925.         You are in the guard's quarters.  It looks like a pig sty -- it is
  2926.         so messy.  The door is to the east.
  2927.         END_ROOM_DESCR
  2928.  
  2929.         HELP [Guard's Quarters]
  2930.         Leave quickly.  It is very dangerous to linger here!
  2931.         END_HELP
  2932.  
  2933.         ROOM [Dungeon Cell]
  2934.         Cell
  2935.         [No obvious exits]
  2936.         END_ROOM
  2937.  
  2938.         ROOM_DESCR [Dungeon Cell]
  2939.         You are in a dingy dungeon cell.  There is straw on the floor.  The
  2940.         cell is cold and damp.  You are very depressed by just being here.
  2941.         END_ROOM_DESCR
  2942.  
  2943.    In addition, we must define these needed messages:
  2944.  
  2945.         MESSAGE [The guard looks at you suspiciously]
  2946.         The guard looks at you suspiciously because you neglected to
  2947.         identify yourself by using the proper password.  He knows you
  2948.         shouldn't be here and decides that he should take you to the Baron
  2949.         for questioning.  He rushes toward you.
  2950.         END_MESSAGE
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.                                      113
  2959.  
  2960.  
  2961.  
  2962.  
  2963.         MESSAGE [Sorry, but you can't]
  2964.         What a great idea!  You must have played this game before, but
  2965.         unfortunately you can't do that now.  It is still a good idea and
  2966.         you may wish to try it some other time.  But now it is impossible 
  2967.  
  2968.         END_MESSAGE
  2969.  
  2970.         MESSAGE [The guard simply won't let you]
  2971.         because the guard simply won't let you $verb$ the $noun$.
  2972.         END_MESSAGE
  2973.  
  2974.         MESSAGE [An angry-looking guard suddenly enters]
  2975.         An angry-looking guard suddenly enters the room.  He eyes you
  2976.         suspiciously and begins to move quickly and carefully toward you. 
  2977.         He reaches for his sword, but pauses as if he is waiting for you to
  2978.         make the first move.
  2979.         END_MESSAGE
  2980.  
  2981.         MESSAGE [Guard throws you over the edge]
  2982.         The guard gets mad at you because he knows you aren't allowed here. 
  2983.         He picks you up and throws you over the edge to the cavern floor
  2984.         far below.  He stands at the edge looking down at you and
  2985.         laughingly cries, "Stay out!  If you know what is good for you. 
  2986.         Next time, I will get rough!"   He laughs again and that is the
  2987.         last thing you remember as you drift off into unconsciousness.
  2988.  
  2989.         When you awake, you find...
  2990.         END_MESSAGE
  2991.  
  2992.         MESSAGE [with a broken leg.]
  2993.         with a broken leg.
  2994.         END_MESSAGE
  2995.  
  2996.         MESSAGE [Your leg has finally healed.]
  2997.         Your leg has finally healed.  You are now free to resume your
  2998.         quest.
  2999.         END_MESSAGE
  3000.  
  3001.         MESSAGE [Guard thinks you are the Baron and leaves]
  3002.         The guard looks you over very carefully, but because you are
  3003.         wearing the Baron's armor, the guard mistakes you for the Baron. 
  3004.         "Sorry to disturb  you, my Lord!", he says as he quickly leaves the
  3005.         room.
  3006.         END_MESSAGE
  3007.  
  3008.         MESSAGE [It was a fierce fight]
  3009.         The guard grabs your throat with his big hands.  He squeezes until
  3010.         you can barely breathe.  You struggle and try to pull his hands
  3011.         away.
  3012.         END_MESSAGE
  3013.  
  3014.  
  3015.  
  3016.                                      114
  3017.  
  3018.  
  3019.  
  3020.  
  3021.         MESSAGE [but you lost.]
  3022.         Finally, you slip into unconsciousness.  When you awake you find
  3023.         yourself in a strange and ugly little room.
  3024.         END_MESSAGE
  3025.  
  3026.         MESSAGE [but you won!]
  3027.         At last, you pry his fingers off your wind pipe.  Now able to
  3028.         breathe, you get enough strength to slam your elbow into his gut. 
  3029.         He lets go of you and doubles over.  You kick him in a very
  3030.         vulnerable part of his anatomy and he crumples in a pile on the
  3031.         floor.
  3032.         END_MESSAGE
  3033.  
  3034.    Now, here are the various meta-commands:
  3035.  
  3036.         COMMAND ANY
  3037.         NOT InRoom [Baron's guard]  
  3038.         NOT InRoom [unconscious guard] 
  3039.         Destroy [Baron's guard] ;  disappears after player leaves room
  3040.         Destroy [unconscious guard] 
  3041.         END_COMMAND
  3042.  
  3043.         COMMAND ANY
  3044.         Chance 5 [5 % chance of guard appearing]
  3045.         AtLocationGT [Large cavern] 
  3046.         NOT InRoom [Baron's guard]  
  3047.         NOT InRoom [unconscious guard]  
  3048.         PutInCurrentRoom [Baron's guard]
  3049.         PrintMessage [An angry-looking guard suddenly enters]
  3050.         BlankLine
  3051.         END_COMMAND
  3052.  
  3053.         COMMAND ANY
  3054.         Chance 50  ; 50 % chance of guard appearing in his own quarters
  3055.         AtLocation [Guard's Quarters] 
  3056.         NOT InRoom [Baron's guard] 
  3057.         NOT InRoom [unconscious guard]
  3058.         PutInCurrentRoom [Baron's guard] 
  3059.         PrintMessage [An angry-looking guard suddenly enters]
  3060.         BlankLine
  3061.         END_COMMAND
  3062.  
  3063.         COMMAND ANY
  3064.         InRoom [Baron's guard] 
  3065.         IsWearing [silver armor] 
  3066.         PrintMessage [Guard thinks you are the Baron and leaves]
  3067.         Destroy [Baron's guard] ; Guard disappears
  3068.         END_COMMAND
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.                                      115
  3075.  
  3076.  
  3077.  
  3078.  
  3079.         COMMAND ANY
  3080.         Chance 25
  3081.         AtLocation [small room high up in cavern wall]
  3082.         InRoom [Baron's guard] 
  3083.         GetIt [broken leg] ; give broken leg to player
  3084.         GoToRoom [Large cavern] ; guard throws you down
  3085.         PrintMessage [Guard throws you over the edge]
  3086.         DoneWithTurn ; no further action -- get next input
  3087.         END_COMMAND
  3088.  
  3089.    Now the meta-commands dealing with the broken leg:
  3090.  
  3091.         COMMAND ANY
  3092.         IsCarrying [broken leg]
  3093.         VerbIsDirection [Trying to move]
  3094.         PrintMessage [Sorry, but you can't]
  3095.         PrintMessage [with a broken leg.]
  3096.         DoneWithTurn ; no further action -- get next input
  3097.         END_COMMAND
  3098.  
  3099.         COMMAND ANY
  3100.         Chance 20
  3101.         IsCarrying [broken leg] 
  3102.         PrintMessage [Your leg has finally healed.]
  3103.         BlankLine
  3104.         Destroy [broken leg]  ; get rid of broken leg
  3105.         END_COMMAND
  3106.  
  3107.    Now the meta-commands corresponding to specific input from the player:
  3108.  
  3109.         COMMAND GET ANY
  3110.         InRoom [Baron's guard] 
  3111.         PrintMessage [Sorry, but you can't]
  3112.         PrintMessage [The guard simply won't let you]
  3113.         DoneWithTurn ; no further action -- get next input
  3114.         END_COMMAND
  3115.  
  3116.         COMMAND GET ANY
  3117.         IsCarrying [broken leg] 
  3118.         PrintMessage [Sorry, but you can't]
  3119.         PrintMessage [with a broken leg.]
  3120.         DoneWithTurn ; no further action -- get next input
  3121.         END_COMMAND
  3122.  
  3123.         COMMAND OPEN ANY
  3124.         InRoom [Baron's guard] 
  3125.         PrintMessage [Sorry, but you can't]
  3126.         PrintMessage [The guard simply won't let you]
  3127.         DoneWithTurn ; no further action -- get next input
  3128.         END_COMMAND
  3129.  
  3130.  
  3131.  
  3132.                                      116
  3133.  
  3134.  
  3135.  
  3136.  
  3137.         COMMAND ATTACK GUARD
  3138.         InRoom [Baron's guard] 
  3139.         PrintMessage [It was a fierce fight]
  3140.         TurnFlagON [temp flag] ; Set Temporary Flag to ON
  3141.         Chance 25 [25 % chance of winning fight]
  3142.         PrintMessage [but you won!]
  3143.         TurnFlagOFF [temp flag] ; Turn Temporary Flag OFF now
  3144.         SwapLocations [unconscious guard] [Baron's guard] 
  3145.         DoneWithTurn ; no further action -- get next input
  3146.         END_COMMAND
  3147.  
  3148.         COMMAND ATTACK GUARD
  3149.         InRoom [Baron's guard] [angry guard]
  3150.         FlagON [temp flag] ; was not turned OFF in last COMMAND
  3151.         TurnFlagOFF [temp flag] ; Turn Flag OFF now
  3152.         PrintMessage [but you lost.]
  3153.         SendAllToRoom [Guard's Quarters] 
  3154.         GoToRoom [Dungeon Cell] ; Guard puts you in dungeon cell
  3155.         SendToRoom [Torch] [Dungeon Cell]
  3156.         DoneWithTurn ; no further action -- get next input
  3157.         END_COMMAND
  3158.  
  3159.         COMMAND TALK TO GUARD
  3160.         PrintMessage [The guard looks at you suspiciously]
  3161.         PrintMessage [It was a fierce fight]
  3162.         PrintMessage [but you lost.]
  3163.         SendAllToRoom [Guard's Quarters] 
  3164.         GoToRoom [Dungeon Cell] ; Guard puts you in dungeon cell
  3165.         SendToRoom [Torch] [Dungeon Cell] ; Put torch in dungeon with you
  3166.         DoneWithTurn ; no further action -- get next input
  3167.         END_COMMAND
  3168.  
  3169.         COMMAND ASK GUARD ABOUT ANY
  3170.         ReDirectTo TALK TO GUARD
  3171.         END_COMMAND
  3172.  
  3173.  
  3174.    SCENARIO 3: INTERACTION WITH OTHER CHARACTERS
  3175.  
  3176.    Let's develop an example of communicating with other characters in an
  3177.    adventure game.  Specifically, let's consider a situation in a Star Trek
  3178.    adventure game were we wish to be able to experience the following
  3179.    interchange between several of the standard Star Trek characters and the
  3180.    player, who is playing the role of Captain James T. Kirk:
  3181.  
  3182.         You are on the Bridge, the circular room at the top of the Enterprise's
  3183.         disk.  The walls are decked with crew members seated or standing at their
  3184.         posts. In the center of the room is your command chair.  Along one side
  3185.         of the room is a large viewscreen.  The only exit, via turbolift, is aft.
  3186.           The viewscreen shows the emptiness and vastness of space.
  3187.           Spock stands alert but relaxed, with his arms folded behind his back.
  3188.           Chekov sits behind the weapons control console.
  3189.  
  3190.                                          117
  3191.  
  3192.  
  3193.  
  3194.  
  3195.           Lieutenant Uhura listens intently to her earphones.
  3196.           At the navigator's station, Sulu sits behind a console of controls.
  3197.  
  3198.         What now? AFT
  3199.  
  3200.         You are in the TurboLift, a small closet-like room.  The Bridge is to
  3201.         your west.
  3202.           Spock stands alert but relaxed, with his arms folded behind his back.
  3203.  
  3204.         What now? WARP 10
  3205.  
  3206.         Spock: Jim, surely you realize that you are not on the Enterprise's
  3207.         Bridge.  The command "warp 10" is quite inappropriate here.
  3208.  
  3209.         What now? WEST
  3210.  
  3211.         You are on the Bridge, the circular room at the top of the Enterprise's
  3212.         disk.  The walls are decked with crew members seated or standing at their
  3213.         posts. In the center of the room is your command chair.  Along one side
  3214.         of the room is a large viewscreen.  The only exit, via turbolift, is aft.
  3215.           The viewscreen shows the emptiness and vastness of space.
  3216.           Spock stands alert but relaxed, with his arms folded behind his back.
  3217.           Chekov sits behind the weapons control console.
  3218.           Lieutenant Uhura listens intently to her earphones.
  3219.           At the navigator's station, Sulu sits behind a console of controls.
  3220.  
  3221.         What now? SCOTTY, WARP 10
  3222.  
  3223.         Spock: Captain, should you have Doctor McCoy check your eye sight?
  3224.         Surely, you can see that Scotty isn't here.
  3225.  
  3226.         What now? CHEKOV, WARP 10
  3227.  
  3228.         Spock: Your extensive command experience should have convinced you that
  3229.         better results can be obtained when the appropriate member of the crew
  3230.         performs this operation.  Permit me to redirection your command to the
  3231.         proper crew member.
  3232.  
  3233.         Spock: Sulu, warp 10
  3234.  
  3235.         Sulu: What course should I plot first, Captain?
  3236.  
  3237.         What now? PLOT A COURSE FOR QWERTY
  3238.  
  3239.         Sulu: Plotting a course for the planet Qwerty, Captain.
  3240.  
  3241.         What now? WARP 16
  3242.  
  3243.         Spock: Captain, surely you realize that the Enterprise is only capable
  3244.         of Warp 1 through Warp 12, plus Impulse power, of course.
  3245.  
  3246.  
  3247.  
  3248.                                          118
  3249.  
  3250.  
  3251.  
  3252.  
  3253.         What now? WARP 10
  3254.  
  3255.         Sulu: Going to warp factor 10.
  3256.  
  3257.    To see how this scene is achieved, first let's examine the relevant
  3258.    entries in the .AGT file.  There are only two Rooms in the scene, the
  3259.    Bridge and the TurboLift; their descriptions are as follows:
  3260.  
  3261.         ROOM [Bridge]
  3262.         Bridge
  3263.         EAST [Turbolift: Deck 1]
  3264.         ENTER [Turbolift: Deck 1]
  3265.         EXIT [Turbolift: Deck 1]
  3266.         END_ROOM
  3267.  
  3268.         ROOM_DESCR [Bridge]
  3269.         You are on the Bridge, the circular room at the top of the
  3270.         Enterprise's disk.  The walls are decked with crew members seated
  3271.         or standing at their posts. In the center of the room is your
  3272.         command chair.  Along one side of the room is a large viewscreen. 
  3273.         The only exit, via turbolift, is aft.
  3274.         END_ROOM_DESCR
  3275.  
  3276.         ROOM [Turbolift: Deck 1]
  3277.         Turbolift: Deck 1
  3278.         WEST [Bridge]
  3279.         ENTER [Bridge]
  3280.         EXIT [Bridge]
  3281.         END_ROOM
  3282.  
  3283.         ROOM_DESCR [Turbolift: Deck 1]
  3284.         You are in the TurboLift, a small closet-like room.  The Bridge is
  3285.         to your west.
  3286.         END_ROOM_DESCR
  3287.  
  3288.    Next, let's see how the Nouns are described in the .AGT file:
  3289.  
  3290.         NOUN [ship's course]
  3291.         course
  3292.         ship's
  3293.         You see the course plotted on the navigator's console.
  3294.         LOCATION [Nowhere]
  3295.         NOUN_SYNONYMS CONSOLE
  3296.         END_NOUN
  3297.  
  3298.         NOUN_DESCR [ship's course]
  3299.         The navigator's console shows the ship's course plotted in light
  3300.         blue.  The Enterprise (shown as a red circle) is on course.
  3301.         END_NOUN_DESCR
  3302.  
  3303.  
  3304.  
  3305.  
  3306.                                      119
  3307.  
  3308.  
  3309.  
  3310.  
  3311.         NOUN [Viewscreen]
  3312.         Viewscreen
  3313.         Big
  3314.         The viewscreen shows the emptiness and vastness of space.
  3315.         LOCATION [Bridge]
  3316.         UNMOVABLE
  3317.         NOUN_SYNONYMS SCREEN
  3318.         END_NOUN
  3319.  
  3320.         NOUN [Planet Qwerty]
  3321.         Qwerty
  3322.         Planet
  3323.         You notice on the viewscreen:  The planet Qwerty below.
  3324.         LOCATION [Nowhere]
  3325.         UNMOVABLE
  3326.         NOUN_SYNONYMS PLANET
  3327.         END_NOUN
  3328.  
  3329.    Notice that only the Viewscreen, Noun [Viewscreen], is in the Bridge at
  3330.    the beginning of the scene.  The other Nouns are initially "nowhere",
  3331.    and will be put in the Bridge, when appropriate.  Specifically, The
  3332.    Ship's Course, Noun [ship's course], will be put in the Bridge as soon
  3333.    as a command is given to plot a course.  Similarly, the Noun [Planet
  3334.    Qwerty] -- shown in the Viewscreen, will replace the empty Viewscreen
  3335.    when the Enterprise gets close to the planet and assumes orbit.
  3336.  
  3337.    There are a number of Creatures in the scene.  Their descriptions would
  3338.    be given in the .AGT file as follows:
  3339.  
  3340.         CREATURE [Spock]
  3341.         Spock
  3342.         Commander
  3343.         Spock stands alert but relaxed, with his arms folded behind his
  3344.         back.
  3345.         LOCATION [Bridge]
  3346.         GROUPMEMBER [Have Spock automatically follow player]
  3347.         END_CREATURE
  3348.  
  3349.         CREATURE_DESCR [Spock]
  3350.         Spock is the only Vulcan member of your crew.  He wears a blue
  3351.         shirt with a gold Star Fleet insignia.
  3352.         END_CREATURE_DESCR
  3353.  
  3354.         CREATURE [Chekov]
  3355.         Chekov
  3356.         Lieutenant
  3357.         Chekov sits behind the weapons control console.
  3358.         LOCATION [Bridge]
  3359.         END_CREATURE
  3360.  
  3361.  
  3362.  
  3363.  
  3364.                                      120
  3365.  
  3366.  
  3367.  
  3368.  
  3369.         CREATURE_DESCR [Chekov]
  3370.         Chekov is sitting at his assigned station pressing keys on the
  3371.         weapons control Panel and monitoring the screen in front of him.
  3372.         END_CREATURE_DESCR
  3373.  
  3374.         CREATURE [Uhura]
  3375.         Uhura
  3376.         Lieutenant
  3377.         Lieutenant Uhura listens intently to her earphones.
  3378.         LOCATION [Bridge]
  3379.         UNMOVABLE
  3380.         END_CREATURE
  3381.  
  3382.         CREATURE_DESCR [Uhura]
  3383.         Uhura is sitting in her communications station listening to her
  3384.         earphones and monitoring all of the known hailing frequencies.
  3385.         END_CREATURE_DESCR
  3386.  
  3387.         CREATURE [Sulu]
  3388.         Sulu
  3389.         Commander
  3390.         At the navigator's station, Sulu sits behind a console of controls.
  3391.         LOCATION [Bridge]
  3392.         UNMOVABLE
  3393.         END_CREATURE
  3394.  
  3395.         CREATURE_DESCR [Sulu]
  3396.         Sulu is sitting next to Chekov, monitoring the lit navigation
  3397.         console.
  3398.         END_CREATURE_DESCR
  3399.  
  3400.         CREATURE [Scotty]
  3401.         Scott
  3402.         Commander
  3403.         Commander Scott sits at his console, monitoring the ship's engines.
  3404.         LOCATION 52 [Engine Room]
  3405.         UNMOVABLE
  3406.         CREATURE_SYNONYMS SCOTTY
  3407.         END_CREATURE
  3408.  
  3409.         CREATURE_DESCR [Scotty]
  3410.         Scott is the best Engineering Officer in the Federation.
  3411.         END_CREATURE_DESCR
  3412.  
  3413.    All of these Creatures are initially in the Bridge except for Commander
  3414.    Scott, who is in the Engine Room, naturally.
  3415.  
  3416.    Only one other entry from the .AGT file needs to be specified in order
  3417.    for the scene to work as show, and that is the definition of verbs:
  3418.  
  3419.  
  3420.  
  3421.  
  3422.                                      121
  3423.  
  3424.  
  3425.  
  3426.  
  3427.         VERB
  3428.         EAST AFT
  3429.         Dummy_Verb1 WARP
  3430.         Dummy_Verb2 PLOT SET CHART
  3431.         END_VERB
  3432.  
  3433.    Notice that AFT is defined as a synonym for EAST.  WARP is defined as a
  3434.    "custom" verb so that commands like WARP 9 will be understood by the
  3435.    parser and the rest of the AGT driver program (MRUN.EXE).  Integer
  3436.    numbers like 9, 12, etc., are always acceptable "Nouns" to the parser;
  3437.    however, you must use meta-commands to deal with numbers as Nouns
  3438.    properly.  PLOT, SET and CHART are all synonyms so that the player can
  3439.    enter PLOT A COURSE, or SET A COURSE or CHART A COURSE and they will all
  3440.    be treated the same by AGT.
  3441.  
  3442.    The messages needed for the scene are contained in the .AGT file and are
  3443.    shown below:
  3444.  
  3445.         MESSAGE [Sorry, but $Name$ doesn't seem to be here.]
  3446.         Spock: Captain, should you have Doctor McCoy check your eye sight? 
  3447.         Surely, you can see that $Name$ isn't here.
  3448.         END_MESSAGE
  3449.  
  3450.         MESSAGE [Spock: You should address appropriate person.]
  3451.         Spock: Your extensive command experience should have convinced you
  3452.         that better results can be obtained when the appropriate member of
  3453.         the crew performs this operation.  Permit me to redirection your
  3454.         command to the proper crew member.
  3455.         END_MESSAGE
  3456.  
  3457.         MESSAGE [Spock redirects command to Sulu for you.]
  3458.         Spock: Sulu, $verb$ $noun$.
  3459.         END_MESSAGE
  3460.  
  3461.         MESSAGE [Spock: "$VERB$ $NOUN$" is inappropriate here.]
  3462.         Spock: Jim, surely you realize that you are not on the Enterprise's
  3463.         Bridge.  The command "$VERB$ $NOUN$" is quite inappropriate here.
  3464.         END_MESSAGE
  3465.  
  3466.         MESSAGE [The Enterprise can only travel at warp 1 to 12.]
  3467.         Spock: Captain, surely you realize that the Enterprise is only
  3468.         capable of Warp 1 through Warp 12, plus Impulse power, of course.
  3469.         END_MESSAGE
  3470.  
  3471.         MESSAGE [Sulu: What course to plot first, Captain?]
  3472.         Sulu: What course should I plot first, Captain?
  3473.         END_MESSAGE
  3474.  
  3475.         MESSAGE [Sulu: Going to warp factor $noun$.]
  3476.         Sulu: Going to warp factor $noun$.
  3477.         END_MESSAGE
  3478.  
  3479.  
  3480.                                      122
  3481.  
  3482.  
  3483.  
  3484.  
  3485.         MESSAGE [Sulu: Plotting course for $Object$.]
  3486.         Sulu: Plotting a course for the planet $Object$, Captain.
  3487.         END_MESSAGE
  3488.  
  3489.    Now for the heart of the scene's interaction, the .AGT file meta-
  3490.    commands.  First, any input command that the player addresses to a valid
  3491.    Creature in the game will first be tried against a group of meta-
  3492.    commands that are addressed to ANYBODY.  This will happen automatically. 
  3493.    For example, consider the following ANYBODY meta-commands:
  3494.  
  3495.         COMMAND ANYBODY, ANY
  3496.         NOT NamePresent [Addressee isn't here.]
  3497.         PrintMessage [Sorry, but $Name$ doesn't seem to be here.]
  3498.         DoneWithTurn
  3499.         END_COMMAND
  3500.  
  3501.         COMMAND ANYBODY, WARP ANY
  3502.         AtLocation [Bridge]
  3503.         NOT NameIsNumber [Sulu] ; Command isn't being addressed to Sulu
  3504.         PrintMessage [Spock: You should address appropriate person.]
  3505.         PrintMessage [Spock redirects command to Sulu for you.]
  3506.         RedirectTo WARP $NOUN$
  3507.         END_COMMAND
  3508.  
  3509.         COMMAND ANYBODY, WARP ANY
  3510.         RedirectTo WARP $NOUN$
  3511.         END_COMMAND
  3512.  
  3513.    The first of the above will be tried for any player command that has
  3514.    been addressed to a Creature, no matter what the command is.  For
  3515.    example, this command will be tried if the player enters SPOCK, FOLLOW
  3516.    ME or SULU, WARP 12.  However, it would not be tried if the player did
  3517.    not direct his command to anyone, i.e., it would not be tried if the
  3518.    player simply inputs WARP 12 without addressing it to a specific
  3519.    creature.  This first meta-command simply tests that the Creature being
  3520.    addressed in the command is at the current location and prints a "error"
  3521.    message if the creature isn't there.
  3522.  
  3523.    The second and third meta-commands above are tried whenever a player
  3524.    addresses his command to a Creature (any Creature, however) and the
  3525.    command is to WARP something.  The second meta-command checks if the
  3526.    creature being addressed is Sulu, and if it isn't -- gives an "error"
  3527.    message and redirects the command to Sulu.  The third meta-command would
  3528.    only be tried if the player input SULU, WARP Something.  This meta-
  3529.    command simply redirects the command to WARP Something, as if the
  3530.    command had not been addressed to anyone specifically.
  3531.  
  3532.    These WARP Something meta-commands would be defined in the .AGT file as
  3533.    follows:
  3534.  
  3535.         FLAG [Course plotted]
  3536.         VARIABLE [Warp Number]
  3537.  
  3538.                                      123
  3539.  
  3540.  
  3541.  
  3542.  
  3543.         COMMAND WARP ANY
  3544.         NOT AtLocation [Bridge]
  3545.         PrintMessage [Spock: "$VERB$ $NOUN$" is inappropriate here.]
  3546.         DoneWithTurn
  3547.         END_COMMAND
  3548.  
  3549.         COMMAND WARP ANY
  3550.         NounToVariable [Warp Number] ; Convert Noun to [Warp Number]
  3551.         VariableGT [Warp Number] 12
  3552.           OR
  3553.         VariableLT [Warp Number] 1
  3554.         PrintMessage [The Enterprise can only travel at warp 1 to 12.]
  3555.         DoneWithTurn
  3556.         END_COMMAND
  3557.  
  3558.         COMMAND WARP ANY
  3559.         FlagOFF [Course plotted] ; Course has not been plotted yet
  3560.         PrintMessage [Sulu: What course to plot first, Captain?]
  3561.         DoneWithTurn
  3562.         END_COMMAND
  3563.  
  3564.         COMMAND WARP ANY
  3565.         FlagON [Course plotted] ; Course has been plotted already
  3566.         PrintMessage [Sulu: Going to warp factor $noun$.]
  3567.         DoneWithTurn
  3568.         END_COMMAND
  3569.  
  3570.    The first three of the above meta-commands check for various "error"
  3571.    conditions and give "error" messages if appropriate.  Specifically, the
  3572.    first meta-command tests if the player is not on the Bridge; the second
  3573.    tests if the warp speed is outside the acceptable range; and the third
  3574.    tests that a course has already been plotted.  Only if none of these
  3575.    "error" conditions are met, would the fourth meta-command tell that
  3576.    player that the Enterprise was going to the indicated warp speed.
  3577.  
  3578.    There are only two more meta-commands required in order for the scene to
  3579.    work as shown at the start of this section.  These meta-commands are
  3580.    both for the situation where the player enters a command to PLOT A
  3581.    COURSE TO Somewhere:
  3582.  
  3583.         COMMAND PLOT COURSE FOR ANY
  3584.         NOT AtLocation [Bridge]
  3585.         PrintMessage [Spock: "$VERB$ $NOUN$" is inappropriate here.]
  3586.         DoneWithTurn
  3587.         END_COMMAND
  3588.  
  3589.         COMMAND PLOT COURSE FOR ANY
  3590.         TurnFlagON [Course plotted] ; Course has now been plotted
  3591.         DropIt [ship's course] ; Put plotted course on Navigator's console
  3592.         PrintMessage [Sulu: Plotting course for $Object$.]
  3593.         DoneWithTurn
  3594.         END_COMMAND
  3595.  
  3596.                                      124
  3597.  
  3598.  
  3599.  
  3600.  
  3601.    PART 5:  "DEBUGGING" YOUR ADVENTURE
  3602.  
  3603.  
  3604.    Once the "first draft" of your adventure is completed, you will want to
  3605.    begin a process known as "play testing" or "debugging."  This process is
  3606.    where you (and perhaps a few friends) test your game to see that it
  3607.    behaves the way you intended -- not the way you actually programmed it.
  3608.  
  3609.    This process is both very rewarding and very frustrating.  You can be
  3610.    guaranteed that you will discover "bugs" in your game.  You can also be
  3611.    guaranteed that while debugging your game, you will come up with a whole
  3612.    host of improvements -- your descriptions will become brighter, your
  3613.    puzzles will become cleverer, and you will think of entirely new and
  3614.    absolutely brilliant game scenes to "spice" up the game.
  3615.  
  3616.    The Master's Edition of AGT's MRUN program has a built-in "magic" word
  3617.    that can make debugging much easier.  This magic word is AGTDEBUG
  3618.    (clever -- don't you think?)  When you give the command AGTDEBUG, you
  3619.    will be given a menu of options that include:
  3620.  
  3621.         1.   MOVING THE PLAYER by being transported instantly to another
  3622.              room.
  3623.  
  3624.         2.   TOGGLING META-COMMANDS debugging ON and OFF, i.e., it toggles
  3625.              FLAG 0.
  3626.  
  3627.         3.   GETTING A NOUN -- which enables you to immediately get a
  3628.              particular noun -- no matter where it is located.
  3629.  
  3630.         4.   MOVING A NOUN -- which enables you to move a noun from its
  3631.              current location to any other location in the game.
  3632.  
  3633.         5.   MOVING A CREATURE -- which enables you to relocate a creature
  3634.              from its current location to any other location in the game.
  3635.  
  3636.         6.   LISTING THE ROOMS -- which gives you a complete list of the
  3637.              numbers and short descriptions for all of the rooms in the
  3638.              game.  This is particularly helpful, when you know you want to
  3639.              be in the "Dank Dungeon", but you can't remember its room
  3640.              number.
  3641.  
  3642.         7.   LISTING THE NOUNS -- which gives you a complete list of the
  3643.              numbers, names and current locations for all of the nouns in
  3644.              the game. This is particularly helpful, when you know you want
  3645.              to find the "Iron Maiden", but you can't remember where you
  3646.              left it.
  3647.  
  3648.         8.   LISTING THE CREATURES -- which gives you a complete list of
  3649.              the numbers, names and current locations for all of the
  3650.              creatures in the game. This is particularly helpful, when you
  3651.              know you want to see if the magic word "QWERTY" really does
  3652.              make the Ogre run away and hide, but you can't remember where
  3653.  
  3654.                                      125
  3655.  
  3656.  
  3657.  
  3658.  
  3659.              the Ogre is to begin with.
  3660.  
  3661.    Remember, you can use the SCRIPT command to get a hard-copy of any of
  3662.    these lists.
  3663.  
  3664.    IMPORTANT NOTE:  When you create the final version of your game that you
  3665.    release to the public, you will want to turn the AGTDEBUG option off. 
  3666.    You can do this by putting the word NO_DEBUG (on a separate line)
  3667.    somewhere in your final game source file and use MCOMPILE to create a
  3668.    version of the compiled data files that can not be debugged.
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.  
  3712.                                      126
  3713.  
  3714.  
  3715.  
  3716.  
  3717.    PART 6:  OPTIONAL GRAPHIC ILLUSTRATIONS
  3718.  
  3719.  
  3720.    The Master's Edition has the option of having a graphic illustration (or
  3721.    animated picture) for each ROOM, NOUN, CREATURE and "special event" -
  3722.    such as a title, or winning the game.  These illustrations/animations
  3723.    can be seen by using the command VIEW (i.e., VIEW TREE, VIEW WIZARD,
  3724.    etc.) or by using the new picture-related meta-commands.  The
  3725.    illustration or animation will be displayed until a key is pressed and
  3726.    then the display will return to the normal AGT text-based screen --
  3727.    ready for the next command.
  3728.  
  3729.    The Master's Edition will support the display of graphic illustrations
  3730.    contained in the various standard .PCX graphics file formats.  PCX is
  3731.    (by far) the most popular of the graphics formats currently available,
  3732.    and there are many, many disks filed with PCX "clip art" available from
  3733.    BBSs and various Shareware disk vendors.  PCX pictures can be created by
  3734.    a number of popular "Paint" and/or "Draw" programs including PC
  3735.    Paintbrush, Microsoft Paint, Deluxe Paint, Desktop Paint (Shareware),
  3736.    Finger Paint (Shareware), and Turbo Paint (Shareware) -- to name the
  3737.    most popular.
  3738.  
  3739.    Note from Dave: I use Deluxe Paint II (from Electronic Arts).  It is a
  3740.    wonderful product!!
  3741.  
  3742.  
  3743.    GRAPHIC CONVERSION UTILITIES
  3744.  
  3745.    If you have a paint or draw program that does not use PCX format, you
  3746.    will want to check out a number of graphics conversion programs that can
  3747.    convert from a number of different picture formats to PCX format.  These
  3748.    conversion utilities also have other features that you will find quite
  3749.    helpful, such as the ability to resize pictures, change the number of
  3750.    colors, etc.  Several of the best of such utilities are: HiJack (both
  3751.    DOS and Windows available), Graphics Workshop (Shareware -- both DOS and
  3752.    Windows available), and Paint Shop Pro (Shareware -- both DOS and
  3753.    Windows available).  These products are described in more detail in the
  3754.    section entitled RECOMMENDED SHAREWARE UTILITIES.
  3755.  
  3756.  
  3757.    SCREEN DISPLAY AND FILE EXTENSION OPTIONS
  3758.  
  3759.    The Master's Edition can display pictures with 2, 4, 16 or 256 colors on
  3760.    CGA, EGA, MCGA or VGA screen adapters.  Obviously, it will not display a
  3761.    256 (VGA) color picture on a screen adaptor that is limited to 4 colors
  3762.    (i.e., a CGA monitor).  If it is impossible to display a picture, AGT
  3763.    will generate an error "beep" instead.
  3764.  
  3765.    The specific types of pictures that AGT will display are given in the
  3766.    following table:
  3767.  
  3768.  
  3769.  
  3770.                                      127
  3771.  
  3772.  
  3773.  
  3774.  
  3775.         "Type"      "Mode"      Graphics Card       Resolution    Colors
  3776.         ~~~~~~      ~~~~~~      ~~~~~~~~~~~~~       ~~~~~~~~~~    ~~~~~~
  3777.         CGA04        $04         CGA                320 x 200         4
  3778.         CGA06        $06         CGA                640 x 200         2
  3779.         EGA0D        $0D         EGA                320 x 200        16
  3780.         EGA0E        $0E         EGA                640 x 200        16
  3781.         EGA10        $10         EGA                640 x 350        16
  3782.         VGA12        $12         VGA                640 x 480        16
  3783.         VGA13        $13         VGA                320 x 200       256
  3784.  
  3785.    AGT will display either full-screen pictures (which often take a great
  3786.    deal of disk space and require more time to "paint" the picture on to
  3787.    the screen) or smaller pictures which will automatically be centered on
  3788.    the screen.  You are encouraged to make your pictures smaller than the
  3789.    total screen size because the disk space required to store a large
  3790.    number of PCX files can be humongous.
  3791.  
  3792.    The normal file extension for a PCX picture is .PCX (this should not be
  3793.    a major surprise).
  3794.  
  3795.    However, AGT requires that you tell it what kind of PCX picture you wish
  3796.    to display and what kind of screen display card the picture needs.  The
  3797.    way that you communicate this information is via the file extension you
  3798.    use for your PCX file.  You indicate the proper video display option by
  3799.    changing the file extension as given below:
  3800.  
  3801.         AGT File Extension          "Normal" Full Screen Size and Display
  3802.         ~~~~~~~~~~~~~~~~~~          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3803.              .P06                         640 x 200 x  2  CGA
  3804.              .P13                         320 x 200 x 16  EGA
  3805.              .P14                         640 x 200 x 16  EGA
  3806.              .P16                         640 x 350 x 16  EGA
  3807.              .P18                         640 x 480 x 16  VGA
  3808.              .P19                         320 x 200 x 256 VGA
  3809.              .P40                         320 x 200 x 4   CGA - Palette 0
  3810.              .P41                         320 x 200 x 4   CGA - Palette 1
  3811.              .P42                         320 x 200 x 4   CGA - Palette 2
  3812.              .P43                         320 x 200 x 4   CGA - Palette 3
  3813.  
  3814.    For example, if you are using your Paint program and it is set to work
  3815.    in "640x350x16 EGA" mode -- but you "clip" your picture to save space
  3816.    (e.g., I recommend you actually use only about 1/4 of the full screen
  3817.    for the picture), you should use a .P16 file extension in order for AGT
  3818.    to center and display the picture correctly.
  3819.  
  3820.  
  3821.    ANIMATION DISPLAYS
  3822.  
  3823.    Version 1.5 of the Master's Edition adds the capability to display FLI
  3824.    animation files in addition to "still" PCX pictures.  The FLI format is
  3825.    the most widely used animation scheme and are produced by such animation
  3826.    packages as Autodesk Animator, Animator Pro, 3D-Studio, PC-Animate,
  3827.  
  3828.                                      128
  3829.  
  3830.  
  3831.  
  3832.  
  3833.    StrataVision 3D and others.  There is a great deal of FLI animation
  3834.    "clip-art" available.
  3835.  
  3836.    NOTE: FLI animation files can only be displayed on VGA (or better)
  3837.    monitors.  If you try to display a FLI file on a "less powerful"
  3838.    monitor, you will get an error beep and nothing will be displayed.
  3839.  
  3840.  
  3841.    UTILITY VIEWER
  3842.  
  3843.    Included as part of the Master's Edition package is a utility viewer
  3844.    called AGT_VIEW.EXE.  Run this program to see how AGT will display your
  3845.    various pictures or animations.  Also included are some sample PCX
  3846.    picture files in different formats and a couple of FLI animation files
  3847.    for you to try out.  Remember, that you must have a VGA monitor to view
  3848.    the FLI animation files.  You exit the AGT_VIEW program by hitting the
  3849.    ESC key.
  3850.  
  3851.    The picture and animation files are indicated in your AGT game source
  3852.    files by something like the following:
  3853.  
  3854.         PICTURES
  3855.         [Intro Picture] INTRO
  3856.         [First Jungle Scene] JUNGLE1
  3857.         [Second Jungle Scene] JUNGLE2
  3858.         [Cave Entrance Scene] CAVE-ENT
  3859.         [Picture of Small Building] BUILDING
  3860.         [Picture of Little Dwarf] DWARF1
  3861.         [Ghost Picture] GHOST
  3862.         [Goblin Picture] GOBLIN
  3863.         [Picture of OFF Lantern] LAMP-OFF
  3864.         [Picture of ON Lantern] LAMP-ON
  3865.           . . .
  3866.         [Victory Picture] VICTORY
  3867.         END_PICTURES
  3868.  
  3869.    These files would actually be the names of various PCX format picture or
  3870.    FLI files on the disk -- but without the file extensions.  For example,
  3871.    the "Picture of the Little Dwarf" would actually be contained in the
  3872.    file named DWARF1.P42 or DWARF1.P16 or DWARF1.P41, or DWARF1.FLI etc. 
  3873.    See the above discussion about file extensions.
  3874.  
  3875.    There can be up to 250 picture or animation files in each AGT game.  You
  3876.    can "re-use" the same picture for many ROOMs, NOUNs, etc.  For example,
  3877.    you might illustrate an entire maze of many rooms in a cave with just a
  3878.    few individual pictures.
  3879.  
  3880.  
  3881.    ROOM, NOUN AND CREATURE PICTURES OR ANIMATIONS
  3882.  
  3883.    The game designer can specify a picture or animation for a ROOM, NOUN
  3884.    and/or CREATURE as follows:
  3885.  
  3886.                                      129
  3887.  
  3888.  
  3889.  
  3890.  
  3891.         ROOM [end of road]
  3892.         End of road
  3893.         NORTH [forest (near road)]
  3894.         EAST [inside building]
  3895.         SOUTH [valley]
  3896.         WEST [hill by road]
  3897.         ENTER [inside building]
  3898.         FLAGS [Water] [Building] [Tree] [Road] [Stream]
  3899.         #COMMENT -- There is water here!
  3900.         PICTURE [Picture of Small Building]
  3901.         END_ROOM
  3902.  
  3903.         ROOM_DESCR [end of road]
  3904.         You are standing at the end of a road before a small brick
  3905.         building.  Around you is a forest.  A small stream flows out of the
  3906.         building and down a gully to the south.
  3907.         END_ROOM_DESCR
  3908.  
  3909.         NOUN [ON lamp]
  3910.         lantern
  3911.         shining
  3912.         There is a lamp shining nearby.
  3913.         NOUN_SYNONYMS lamp light
  3914.         WEIGHT [noun weight]
  3915.         IS_LIGHT
  3916.         ON
  3917.         PICTURE [Picture of ON Lantern]
  3918.         END_NOUN
  3919.  
  3920.         NOUN_DESCR [ON lamp]
  3921.         The lamp runs on batteries and is currently turned on.  It is
  3922.         shining  brightly.
  3923.         END_NOUN_DESCR
  3924.  
  3925.         CREATURE [little dwarf]
  3926.         dwarf
  3927.         little
  3928.         A little dwarf with a big knife blocks your way.
  3929.         LOCATION [NoWhere]
  3930.         HOSTILE
  3931.         THRESHOLD 1000
  3932.         TIME_THRES 1000
  3933.         GENDER THING
  3934.         PICTURE [Picture of Little Dwarf]
  3935.         END_CREATURE
  3936.  
  3937.         CREATURE_DESCR [little dwarf]
  3938.         The dwarf is about 3 feet tall, dressed in green with red hair and
  3939.         a bushy handle-bar moustache.  He is quite excited and seems
  3940.         determined not to let you get away.  His knife is almost as big as
  3941.         he is -- and it looks like it could cause grave bodily harm.
  3942.         END_CREATURE_DESCR
  3943.  
  3944.                                      130
  3945.  
  3946.  
  3947.  
  3948.  
  3949.    The default condition/value for a ROOM, NOUN and/or CREATURE PICTURE is
  3950.    [Nowhere] (i.e., zero), i.e., there is no associated picture or
  3951.    animation.
  3952.  
  3953.    When you first move to a new location, if there are pictures or
  3954.    animations associated with either the location or nouns and/or creatures
  3955.    at the location, AGT will display a message listing the things that can
  3956.    be viewed.  The player may then give a command like VIEW DWARF to see
  3957.    the appropriate illustration.  The "menu-driven" parser option may also
  3958.    be used to VIEW things by allowing the player to select from a menu of
  3959.    viewable items.
  3960.  
  3961.  
  3962.    MULTIPLE ROOM PICTURES AND ANIMATIONS
  3963.  
  3964.    There will be times in your game when you wish to have the same picture
  3965.    (or animation) in many rooms and you don't want to have to have multiple
  3966.    NOUNs or CREATUREs.  This is handled by defining ROOM_PIX as follows:
  3967.  
  3968.         ROOM_PIX
  3969.         [Ground pix] DIRT Ground
  3970.         [Sky pix] BLUESKY Sky
  3971.         [Tree pix] BIGTREE3 tree
  3972.         [Water pix] WATERPIC water
  3973.         END_ROOM_PIX
  3974.  
  3975.    The format is the macro definition (i.e., the [] definition such as [Sky
  3976.    pix]) followed by the file name for the picture (without the extension,
  3977.    e.g. DIRT) followed by the name to be used as the "noun" to refer to
  3978.    this picture or thing (i.e., the DIRT picture will be displayed when you
  3979.    give the command to VIEW GROUND.  The name will also be displayed when
  3980.    you are using the menu option and will be treated by the game as a valid
  3981.    noun.
  3982.  
  3983.    You may have a total of 30 possible room PIX definitions.  Attempting to
  3984.    use more that 30 will generate an error message in the MCOMPILE program. 
  3985.    These 30 are in addition to the 250 possible PICTURE definitions you may
  3986.    have in your game.
  3987.  
  3988.    As an example of how to use these multiple location pictures, let's add
  3989.    pictures for the SKY and TREE to our previous [end of road] room as
  3990.    follows:
  3991.  
  3992.         ROOM [end of road]
  3993.         End of road
  3994.         NORTH [forest (near road)]
  3995.         EAST [inside building]
  3996.         SOUTH [valley]
  3997.         WEST [hill by road]
  3998.         ENTER [inside building]
  3999.         FLAGS [Water] [Building] [Tree] [Road] [Stream]
  4000.         #COMMENT -- There is water here!
  4001.  
  4002.                                      131
  4003.  
  4004.  
  4005.