home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / advcomp.zip / ADVCOMP.DOC < prev    next >
Text File  |  1986-03-29  |  32KB  |  801 lines

  1.  
  2. ADVENTURE COMPILER/INTERPRETER
  3. ----------------------------------------------
  4.  
  5. Basic Version
  6.  
  7.  
  8. Peter F. Levy
  9. 4209 Longmeadow Way
  10. Fort Worth, TX 76133
  11.  
  12. (817) 292-8731
  13.  
  14. INTRODUCTION to version 
  15.  
  16. This DOCUMENTATION file is for the trash-80 version.  As far as
  17. I know, the IBM-PC version on this BBS works, but there is no
  18. guarantee that this doc file will match.  This is a pretty serious
  19. little program, and I hope all these features work.
  20. --MIke Stone
  21.  
  22. Adventure game scenarios are created or edited using any text 
  23. editor.  ASCII data files are compiled by utility COMPILER.BAS in 
  24. order to prepare them for interpretation by DRIVER.BAS.  The 
  25. third program in this system, DISASSEM.BAS, (not for PC yet)
  26. is used to disassemble compiled adventures into an editable, 
  27. re-compilable source file.
  28.  
  29. For simplicity's sake, COMPILER.BAS will be referred to as 
  30. "the compiler", DRIVER.BAS as "the driver", and DISASSEM.BAS 
  31. as "the disassembler".
  32.  
  33. In order to allow this system to interpret very large 
  34. databases, the driver does not maintain an entire adventure in
  35. memory.  Instead, the parts of the database which require 
  36. frequent or immediate access are stored in memory, while the 
  37. remainder are kept on disk in an indexed reference file.  The 
  38. index permits almost instant access to random data.
  39.  
  40. There are consequently a total of four separate disk files 
  41. associated with each complete adventure.  For any one 
  42. adventure, each has the same file name (the name of the 
  43. adventure) but a different identifying suffix.  The name of 
  44. the adventure is defined by the filespec under which the 
  45. creator saves the ASCII source file.  These files are:
  46.  
  47.   (1) name/ADV, the ASCII source file
  48.   (2) name/DAT, the portion of the database which resides in
  49.       memory while the adventure is played
  50.   (3) name/REF, the reference file addressed by the driver on
  51.       an as-needed basis
  52.   (4) name/NDX, the index to the reference file.
  53.  
  54.  
  55. The source file is used only by the compiler and need not be èpresent to play a compiled adventure.  The other three files 
  56. (which are created by the compiler) must be present for the 
  57. adventure to be played.
  58.  
  59.  
  60. The remainder of these instructions will consist of sections 
  61. explaining the use of the compiler, driver, and disassembler; 
  62. followed by a detailed explanation of the source database 
  63. structure.
  64.  
  65.  
  66.  
  67. DEFINITION OF TERMS
  68.  
  69. VERB:    the first operative word of a player input, usually
  70.          specifying what is to be done.
  71. NOUN:    the second operative word of a player input, usually
  72.          specifying what the action is to be done to.
  73. OBJECT:  (a) the third operative word of a player input,
  74.              usually specifying the tool through which the
  75.              verb will be applied to the noun.
  76.          (b) an item in the game having the properties of
  77.              description, location, and weight
  78. ROOM:    a discrete location in the game play area
  79. MESSAGE: a predefined text displayable as a response to
  80.          player input
  81. IMPLICIT ACTION:  a series of tests and/or actions
  82.          carried out by the driver each iteration of play
  83.          without player interaction.  Each implicit action is
  84.          attempted each iteration of play.
  85. EXPLICIT ACTION:  a series of tests and/or actions to be
  86.          carried out by the driver in response to a specific
  87.          player input or command.  An explicit action is
  88.          attempted only in response to player input for which
  89.          it is defined.
  90. TOKEN:  a mnemonic word used to name a specific test or action
  91.  
  92.  
  93.  
  94. THE COMPILER
  95.  
  96. The compiler creates the files required to actually play the 
  97. adventure, based on the information contained in the ASCII 
  98. source file.  The LADS compiler is called COMPIL.BAS.  It 
  99. requires four file areas to run (they need not be declared V 
  100. filareas, though).
  101.  
  102. You will first be asked "Database name? ".  Reply with the 
  103. name of the adventure database to be compiled (excluding the 
  104.  
  105. Next you are asked, "Compilation drive? (1-3)".  Reply with 
  106. the number of the disk drive (1-3) which is to receive the 
  107. compiled adventure files.  The source file need not be 
  108. resident on that particular drive.
  109. èLast, you are asked "Hard copy of compilation messages? 
  110. (Y/N)".  Reply Y if the messages the compiler displayed during
  111. its run (including error warnings and diagnostics) are to be 
  112. sent to the system printer as well as screen.
  113.  
  114. The compiler runs to completion without user interaction.  As 
  115. the compilation progresses, messages will be displayed naming 
  116. the part of the database currently being processed and 
  117. describing any errors encountered; followed by "Compilation 
  118. complete" and a return to READY.  The adventure may be played 
  119. immediately after compilation has been completed.
  120.  
  121. Compilation error messages are detailed and, hopefully, 
  122. self-explanatory.
  123.  
  124.  
  125.  
  126. THE DISASSEMBLER
  127.  
  128. The disassembler can read a set of compiled adventure data 
  129. files and generate source listings.  The disassembler has the 
  130. ability to provide hard copy and a disk source file, which can
  131. be edited if desired and re-compiled by COMPILER.BAS.  All 
  132. three of an adventure's runtime files (name/DAT, name/REF, and
  133. name/NDX) must be present for the disassembler to work.
  134.  
  135. The disassembler requires four file areas to run.  They do not
  136. need to be V type.
  137.  
  138. When you run the disassembler, you are first asked "Database
  139. name?".  Reply with the name of the adventure to be 
  140. disassembled, excluding any extensions.
  141.  
  142. Next you are asked "Disassembly to line printer? (Y/N)".  
  143. Reply Y or N, depending on whether or not you want a hard copy
  144. of the disassembled source file.
  145.  
  146. Next you are asked "Create source file on disk? (Y/N)".  Reply
  147. Y or N, depending on whether or not you want to create an 
  148. ASCII source file on disk.  If you reply Y, you will be 
  149. further prompted "Destination file? (full filespec)".  Reply 
  150. with the full name (including any extensions and drive 
  151. specifications) of the file to receive the created source 
  152. text.
  153.  
  154. The disassembler runs to completion without user interaction.
  155.  
  156.  
  157.  
  158. THE INTERPRETER
  159.  
  160. The interpreter is the game executor and moderator.  It 
  161. supervises play of the game, updating the situation in 
  162. response to the player's typed commands and displaying the 
  163. game situation for the player.  The LADS driver is called èDRIVER.BAS.  It requires three file areas to run, which do not
  164. need to be V type.
  165.  
  166. The driver will ask, "Adventure name?".  Reply with the name 
  167. of the adventure to be played, excluding any extensions.
  168.  
  169. The driver will open the needed files and almost immediately 
  170. display an opening text, which will remain displayed while the
  171. reference and index files are opened and the data file is 
  172. transferred into memory.  When this setup phase is complete, 
  173. "(press space bar to begin play)" will appear at the bottom 
  174. center of the screen.  Play of the adventure will begin when 
  175. the space bar is depressed.
  176.  
  177. Play of adventures under this system consists of a fairly 
  178. simple loop of events:  (a) the driver displays the current 
  179. situation and a ">" prompt, (b) the player types his responses
  180. in any reasonable grammatical form, and (c) the driver 
  181. interprets the player's response and updates the game 
  182. situation accordingly.
  183.  
  184. NOTE:  The Basic version of LADS does not perform lower-upper 
  185. case conversion.  All input must be upper case.
  186.  
  187.  
  188. Although the command parser (which translates typed input into
  189. numbers understandable by the driver) does a good job of 
  190. extracting information from fairly complex input phrases, it 
  191. does assume that the content of the player's response conforms
  192. generally to a "verb-noun-object" structure, i.e., something 
  193. along the general lines of "verb the noun with the object".
  194.  
  195. The player may interrupt the game and return to READY 
  196. immediately by pressing BREAK at any time.  This exit will not
  197. close the data files, but this is harmless since the driver 
  198. never writes to disk.
  199.  
  200. This system has eight abbreviated single-letter commands:  N, 
  201. S, E, W, U, D, I, and L.  N, S, E, W, U, and D are exactly 
  202. equivalent to "GO NORTH", "GO SOUTH", etc.  I displays an 
  203. inventory of what the player is currently carrying.  L stands 
  204. for "look" and describes the player's current location, and 
  205. any objects present, in detail.
  206.  
  207. The driver uses the bottom lines of the screen for a situation
  208. summary, which is updated each time the player enters any 
  209. command.  The upper line of this summary shows the player's 
  210. current location; the lower line shows available exits, the 
  211. player's load (in percent of his carrying capacity), his 
  212. current score, and the number of game turns played so far.
  213.  
  214.  
  215. CREATING AN ADVENTURE -- SOURCE FILE STRUCTURE
  216.  
  217. An adventure source file in LADS is a straight ASCII text èfile.  Each source file contains nine SECTIONS, each of which 
  218. is segmented into RECORDS.  The end of each record is marked 
  219. by a carriage return and the end of each section by two 
  220. consecutive carriage returns.  The nine sections are (in the 
  221. order in which they must exist within the file):
  222.  
  223.  
  224.      1.  a header record
  225.      2.  a verb dictionary
  226.      3.  a noun dictionary
  227.      4.  an object list
  228.      5.  a room list
  229.      6.  a message list
  230.      7.  an implicit action table
  231.      8.  an explicit action table
  232.      9.  a remarks section, not read by the compiler.
  233.  
  234. NOTE:  In order to allow the adventure creator to display 
  235. several texts on one line, this system does NOT automatically 
  236. add a carriage return to the end of any text.  It is the 
  237. writer's responsibility to include a linefeed symbol ("/") at 
  238. the end of a text if desired.
  239.  
  240.  
  241.  
  242. HEADER
  243.  
  244. The first section is the HEADER, which is simply the 
  245. introductory or instructive text which the driver is to 
  246. display during setup.  Any slashes ("/") in this text will be 
  247. compiled as linefeeds; all other characters are displayed 
  248. exactly as entered.  Single carriage returns are also allowed 
  249. within the header record.  There is no limit to the length of 
  250. the header, but if it is longer than about 700 characters it 
  251. is likely to scroll the display.  The end of this header 
  252. section is marked by two consecutive carriage returns.
  253.  
  254.  
  255.  
  256. VERB SECTION
  257.  
  258. The second section is the verb dictionary.  This is a list of 
  259. all words which are to be used as verbs in the play of this 
  260. adventure.  Each record in this section consists of a verb 
  261. followed by a comma or a carriage return.  There should be no 
  262. spaces between words and separators, and all words should be 
  263. in upper case.  The section is ended with a double carriage 
  264. return.
  265.  
  266. You may specify up to 99 verbs.
  267.  
  268. The first three verbs must be "GET", "DROP", and "GO", in that
  269. order.
  270.  
  271. EXAMPLE:è
  272. GET<CR>
  273. DROP<CR>
  274. GO<CR>
  275. ATTACK<CR>
  276. WAIT<CR><CR>
  277.  
  278.  
  279.  
  280. NOUN SECTION
  281.  
  282. The third section is the noun dictionary.  This is structured
  283. similarly to the verb dictionary, with two differences.
  284.  
  285. First, there are seven required nouns:  the first through 
  286. seventh nouns must be "ANY", "NORTH", "SOUTH", "EAST", "WEST",
  287. "UP", and "DOWN" (in that order).
  288.  
  289. Second, following each noun is an "object link", which is a 
  290. number from 0 to 255.  This specifies the object, by number, 
  291. to which the noun refers.  If the noun will not be used to 
  292. refer to any specific object, its link should be 0.  A noun 
  293. must be linked to a (material) object in the object list for 
  294. it to function when used as a (grammatical) object in player 
  295. input during game play.
  296.  
  297. You may specify up to 99 nouns.
  298.  
  299. EXAMPLE:
  300.  
  301. ANY<CR>
  302. .
  303. .
  304. BOOK,2<CR>
  305. NEWSPAPER,6<CR>
  306. DISKETTE,0<CR><CR>
  307.  
  308.  
  309.  
  310. OBJECT SECTION
  311.  
  312. The fourth section is the object table.  The object table 
  313. contains up to 255 records, each of which describes one object
  314. in the game.  Each record has six items in it:
  315.  
  316. (a) An object number from 1 to 255, followed by a space.  
  317.     These numbers are the ones to which the noun links refer.
  318.     Object numbers must be assigned sequentially starting from
  319.     1.
  320.  
  321. (b) The object's name, which must be no longer than 50 
  322.     characters and is ended by a comma.  Both upper and lower
  323.     case characters are permitted, as well as digits, spaces,
  324.     and punctuation (except a comma, of course.)
  325.  
  326. (c) The object's start room, which is a number which describes
  327.     the object's location at the start of the game.  LADS usesè    rooms numbered from 0 to 255.  An object may be placed in
  328.     any room.  Room 0 is a storeroom of objects not in play
  329.     for now, room 255 is the location of objects carried by
  330.     the player.
  331.  
  332. (d) The object's weight, in percent of the player's carrying 
  333.     capacity.  A weight of 255 signifies an immovable object.
  334.  
  335. (e) The object's point value.  This is the number of points 
  336.     the player is awarded for carrying the object.
  337.  
  338. (f) The object's long description, which may be up to 255 
  339.     characters long and contain any characters.  Slashes will
  340.     be compiled as linefeeds. The long description (and the
  341.     record) are terminated by a carriage return.
  342.  
  343. The object's name is how it is referred to when the inventory 
  344. ("I") command is issued; its long description is the notice 
  345. printed by the driver to announce object's presence.
  346.  
  347. EXAMPLE:
  348.  
  349. 1 Book,1,5,0,There is an old leather-bound book here./<CR>
  350. 2 Brass lantern,0,15,20,You note a shiny brass lantern lying/
  351. nearby./<CR>
  352. 3 Statue,3,255,0,There is a six foot high statue of a/  
  353. parakeet in the room./<CR>
  354. 4 Stairs,7,255,0,A flight of narrow stairs leads up./<CR><CR>
  355.  
  356. Note that linefeed symbols ("/") are added to the end of each 
  357. text line.  If this is omitted, the next line of text the 
  358. driver displays will follow the previous line without any 
  359. linefeeds.
  360.  
  361.  
  362.  
  363. ROOM SECTION
  364.  
  365. The fifth section is the room table.  This section is very 
  366. similar to the object table.  It consists of a start room 
  367. number (1 to whatever) followed by up to up to 255 records, 
  368. each of which describes one room (or discrete location).  Each
  369. record has the following structure:
  370.  
  371. (a) A room number from 1 to 254, followed by a blank.  No two
  372.     rooms may have the same number.  Note that rooms 0 and 255
  373.     are predefined:  room 0 is a storeroom for objects not
  374.     currently in play; room 255 is the player (objects that
  375.     are carried are in room 255).  Rooms 0 and 255 MUST NOT be
  376.     defined in the room table.  Room  numbers must be assigned
  377.     sequentially starting from 1.
  378.  
  379. (b) A room name, up to 50 characters long, ended by a comma.
  380.     Any other characters are allowed.
  381. è(c) Six links, specifying (by number) the connecting rooms to
  382.     the north, south, east, west, up, and down; respectively.
  383.     Zero indicates no passage in a particular direction.
  384.  
  385. (d) A long description of the room, ended by a carriage
  386.     return.  The description may be any length.  Slashes in
  387.     this description are compiled as linefeeds.
  388.  
  389.  
  390. ROOM CONNECTION DETAILS.  The room connections specified by 
  391. the links in the room table are a room's "obvious exits", and 
  392. will be dislayed as available exits on the status dislay at 
  393. the bottom of the screen.  Any other room connections are not 
  394. "obvious" and won't be displayed; the player must be told of 
  395. them.
  396.  
  397.  
  398. EXAMPLE:  (the first line is the start room number, the number
  399. of the room the game starts with the player in)
  400.  
  401. 13
  402. 1 Cave,0,3,0,6,0,5,You are in a large cavern./<CR>
  403. 2 Computer room,1,5,0,0,0,0,You are in a computer room.  A /
  404. TRS-80 named Minerva awaits your bidding./<CR><CR>
  405.  
  406.  
  407.  
  408. MESSAGE SECTION
  409.  
  410. Each record in the message table defines one message available
  411. to the adventure driver, and contains two items:  a message 
  412. number from 1 to 255, followed by a space; and the message 
  413. text terminated with a carriage return.  The text may be up to
  414. 255 characters long and may contain any characters.  Slashes 
  415. are compiled as linefeeds.  Message  numbers must be assigned 
  416. sequentially starting from 1.
  417.  
  418.  
  419. EXAMPLE:
  420.  
  421. 1 The UFO's protective field won't let you approach./<CR>
  422. 2 Please don't shoot him, you'll only make him mad./<CR>
  423. 3 There was a passage hidden behind the drapes!/<CR><CR>
  424.  
  425.  
  426.  
  427. IMPLICIT ACTION TABLE
  428.  
  429. The seventh section describes the background activities to 
  430. take place during play of an adventure.  Implicit actions are 
  431. attempted automatically by the driver each turn of play, and 
  432. are used to move dragons around at random, check to see if 
  433. certain unsupervised (uncommanded, therefore implicit) actions
  434. are to take place, and so on.  Each activity consists of a 
  435. line naming tests and actions to be carried out by the driver èand is ended by a space-period-carriage return sequence.  The 
  436. exact structure of an action line, and the names and uses of 
  437. the different tests and actions available, are explained in a 
  438. later section.  The table is terminated witháaádouble carriage
  439. return.
  440.  
  441. Action entries may be divided over several lines.  If a line 
  442. ends with a space-comma-carriage return, the next line is 
  443. treated as a continuation of the same action line.
  444.  
  445.  
  446.  
  447. EXPLICIT ACTION TABLE
  448.  
  449. The eighth section is the explicit action table.  An explicit 
  450. action is carried out by the driver in response to a specific 
  451. command, in the form of a verb-noun pair.  This table contains
  452. one record for each verb-noun pair for which the adventure
  453. author wishes to define an action.  Each entry consists of the
  454. verb and noun to which the action is to be linked, and a line 
  455. naming the tests and actions to be performed by the driver if 
  456. the verb-noun command is given.
  457.  
  458. All letters used in nouns and verbs here must be upper case.  
  459. The verb, noun, and all test or action names must be separated
  460. by one or more spaces; and the record terminated by a 
  461. space-period-carriage return sequence.
  462.  
  463. Action entries may be divided over several lines.  If a line 
  464. ends with a space-comma-carriage return, the next line is 
  465. treated as a continuation of the same action line.
  466.  
  467.  
  468.  
  469. REMARKS SECTION
  470.  
  471. The ninth and last section is ignored entirely by the compiler
  472. and provides space for the author to place any remarks he 
  473. wishes to add to the database.
  474.  
  475.  
  476. ACTION ENTRIES
  477.  
  478. Action entries define tests to be performed and activity to 
  479. take place based upon the results of the tests, either as a 
  480. background activity (implicit action) or as a result of a 
  481. player instruction (an explicit action, invoked by a verb-noun
  482. pair).  These are what actually tell the driver program what 
  483. to do in response to situations or player input.  Each action 
  484. entry consists of one line of tests and actions to be carried 
  485. out.  Each test and action available has a four-character 
  486. mnemonic name (called a "token") and represents either a 
  487. specific test to be performed ("is the golden key in the 
  488. King's Chamber?") or action to be taken ("display message 2").
  489. èEach token has from zero to two data fields associated with 
  490. it which specify the parameters involved in the test or action
  491. (object numbers, locations, etc).  These follow the token name
  492. as decimal numbers.
  493.  
  494. There is no particular limit to the length of a typed action 
  495. entry, but the total number of tokens (and data fields 
  496. associated with them) in a single action entry must not exceed
  497. 255.
  498.  
  499. When the driver executes an action line, that line is 
  500. interpreted from left to right.  Tests and actions may be 
  501. mixed unconditionally within an action line.  If the token 
  502. involves a test, the truth of the tested condition is 
  503. evaluated and logically ANDed with a truth flag; if the token 
  504. is an action it is performed if the truth flag is currently 
  505. TRUE (that is, all the preceding tests returned a logical 
  506. TRUE).
  507.  
  508. Any test may be inverted by prefixing it with a "-" character.
  509. This will cause the opposite condition from that specified to 
  510. be tested.  For example, token "INRX" means "in room X", and 
  511. "INRX 4" returns a logical TRUE if the player is then in room 
  512. 4.  If the token is inverted, as "-INRX 4", it returns a 
  513. logical TRUE if the player is NOT in room 4.
  514.  
  515. Any action may also be inverted in the same way.  An action is
  516. normally performed if all the preceding tests returned logical
  517. TRUE; an inverted action is performed if one or more of the 
  518. preceding tests returned a logical FALSE.
  519.  
  520. Following is a list of the tokens available and their 
  521. functions.  Where used, "x" and "y" represent prototype values
  522. supplied after the token as data.
  523.  
  524.  
  525. Test tokens
  526.  
  527. TOKEN        RETURNS "TRUE" IF
  528. --------------------------------------------------------------
  529. HASX x       The player is carrying object x
  530. NCRX x       Object x is in the current room (the same room as
  531.                the player)
  532. AVLX x       Object x is available to the player (either in
  533.                the same room or carried)
  534. XINY x y     Object x is in room y
  535. NSRX x       Object x is in its start room
  536. NR0X x       Object x is in room zero (out of play)
  537. XW/Y x y     Object x is in the same room as object y
  538. HASL         The player is carrying the object linked to the
  539.                current noun (the "linked object")
  540. NCRL         The linked object is in the same room as the
  541.                player
  542. AVLL         The linked object is available to the player
  543. LINX x       The linked object is in room xèNSRL         The linked object is in its start room
  544. NR0L         The linked object is in room 0
  545. LW/X x       The linked object is in the same room as object x
  546. RAND x       x% chance of returning TRUE
  547. CEQN x y     Counter #x is equal to y
  548. CGEN x y     Counter #x is greater than or equal to y
  549. CEQC x y     Counter #x is equal to counter #y
  550. CGEC x y     Counter #x is greater than or equal to counter #y
  551. XSET x       Bit flag #x is set
  552. INRX x       Player is in room x
  553. LIGH         The current location is lighted
  554. LDGT x       The player's load is greater than x%
  555. OBJ= x       The command's (grammatical) object referred to
  556.                (material) object #x.  The (grammatical) object
  557.                in the command line must have been a noun which
  558.                is linked to a (material) object for this to
  559.                work.  OBJ= 0 will return TRUE if either the
  560.                input specified no object or the (grammatical)
  561.                object is not linked to a (material) object
  562.                in the noun dictionary.
  563.  
  564.  
  565.  
  566. ACTION TOKENS
  567.  
  568. TOKEN        Performance
  569. ------------------------------------------------------------
  570. X2RY x y     Object x is moved to room y
  571. X2OY x y     Object x is moved to object y
  572. X2CR x       Object x is moved to the current room
  573. X2SR x       Object x is moved to its start room
  574. X2R0 x       Object x is moved to room 0
  575. X<>Y x y     Objects x and y are exchanged
  576. L2RX x       Linked object is moved to room x
  577. L2OX x       Linked object is moved to object x
  578. L2CR         Linked object is moved to the current room
  579. L2SR         Linked object is moved to its start room
  580. L2R0         Linked object is moved to room 0
  581. L<>X x       Linked object is exchanged with object x
  582. DROP         All objects carried by player are dropped (moved
  583.                to current room)
  584. P2RX x       The player is moved to room x
  585. P2OX x       The player is moved to the room occupied by
  586.                object x
  587. SCO+ x       x is added to the player's score, x=-127 to 127
  588. HEAL x       x is added to the player's health, x=-100 to 100
  589. CTX+ x y     y is added to counter x, y=-127 to 127
  590. CTX= x y     Counter x is set equal to y, y=-127 to 127
  591. SETX x       Bit flag x is set
  592. CLRX x       Bit flag x is reset (cleared)
  593. MSGX x       Message x is displayed
  594. ENDG         The game is ended
  595. LMP1         Illumination is "on"
  596. LMP0         Illumination is "off" -- darkness
  597. DIAG         Display health stateèWAIT x       Game play pauses for about x/4 seconds.
  598. ECHO         The player's input is echoed in format "To <verb>
  599.                a <noun> with a <object> ", with a trailing
  600.                space but without a following carriage return
  601. RPTV         Repeat verb.  The last input verb is displayed
  602.                without leading or trailing blanks.
  603. RPTN         Repeat noun.  The last input noun is
  604.                displayed without leading or trailing blanks.
  605. RPTO         Repeat object.  The last input object is
  606.                displayed without leading or trailing blanks.
  607. ELSE         If TRUE when evaluated, action processing ends;
  608.                if FALSE, the truth state is reset to TRUE and
  609.                processing restarts with the next token
  610. SAVE         The current game situation is saved to a disk
  611.                file.
  612. LOAD         A saved game situation is read from a disk file
  613.                created by SAVE, and becomes the current
  614.                situation.
  615.  
  616. EXAMPLES:
  617.  
  618. (a) if at any time the player carries object 17 into room 4, 
  619. make object 8 appear and display message 7.  This is a 
  620. background-type activity and would go in the background 
  621. activity table.  In specific terms,
  622.  
  623. if player is in room 4, and                   INRX 4
  624.    player is carrying object 17, then         HASX 17
  625.    move object 8 to current room, and         X2CR 8
  626.    display message 7.                         MSGX 7
  627.  
  628. The action entry would be:  INRX 4 HASX 17 X2CR 8 MSGX 7 .<CR>
  629.  
  630.  
  631. (b) if the player specifies "RUB LANTERN", and is carrying 
  632. object 2 (the lantern), and object 4 (a magic preventer) is 
  633. not either carried or in the current room (hence not 
  634. available), then bring a genie into the room and display 
  635. message 10 ("POOF!"); otherwise display message 11 ("The 
  636. lantern gets shinier").
  637.  
  638. If player commands "RUB LANTERN",         RUB LANTERN
  639.  
  640. and has object 2                          HASX 2
  641. and object 4 isn't around                 -AVLX 4
  642. then bring in genie to current room       X2CR 7
  643. and display message 10                    MSGX 10
  644.  
  645. otherwise,                                ELSE
  646. display message 11                        MSGX 11
  647.  
  648. The action entry would be:
  649.  
  650. RUB LANTERN HASX 2 -AVLX 4 X2CR 7 MSGX 10 ELSE MSGX 11 .<CR>
  651. è
  652. (c) If the player attacks a demon with any object besides a 
  653. sword, display "To attack a demon with a <whatever> is not a 
  654. good idea."  The sword is object 4, and "is not a good idea./"
  655. is message 9.
  656.  
  657. If player specifies "ATTACK DEMON"         ATTACK DEMON
  658. and the object is not "SWORD"              -OBJ= 4
  659. echo user input                            ECHO
  660. and print message 9                        MSGX 9
  661.  
  662. The action entry would be:
  663.  
  664. ATTACK DEMON -OBJ= 4 ECHO MSGX 9 .
  665.  
  666.  
  667.  
  668. SEPCIFYING DEFAULT ROUTINES FOR EXPLICIT ACTIONS
  669.  
  670. LADS provides default action handlers which allow the 
  671. adventure creator to handle a variety of general situations 
  672. using only one explicit action entry.  A default action has 
  673. the same form as any other action line, but specifies ANY as a
  674. noun.  A verb's default action is invoked if there is no 
  675. action routine defined for the verb-noun pair the player has 
  676. issued or if the noun isn't in the game dictionary.
  677.  
  678. For example, most adventures would provide a general-purpose 
  679. response to the command to examine anything unimportant to the
  680. effect of "You find it perfectly ordinary."  Rather than 
  681. having tediously to define action entries for each possible 
  682. examination, you can specify a single entry as EXAMINE ANY.  
  683. This action would then be performed if the player typed 
  684. "EXAMINE something", and either there was no explicit action 
  685. entry defined for that verb-noun pair or the noun wasn't in 
  686. the dictionary.
  687.  
  688.  
  689. GET, DROP, and GO also have default action handlers, which are
  690. built into the driver.  If the player issues a GET noun, DROP 
  691. noun, or GO noun command the driver will (first) try to find a
  692. specific action entry for the command, then failing that will 
  693. (second) look for a GET ANY, DROP ANY, or GO ANY action 
  694. routine, then (failing even that) try to execute its own 
  695. internal GET, DROP, or GO handler.
  696.  
  697. For GET, the object will be picked up if all of the following
  698. conditions are met:  (a) the noun is linked to an object, (b) 
  699. the linked object is in the same room as the player, (c) it is
  700. not carried, (d) it is not immovable (weight is not 255), and 
  701. (e) the player's load will permit the acquisition.  If any of 
  702. these tests fails, an appropriate message will be displayed 
  703. (such as "You can't carry that much more weight."); if the 
  704. object is picked up the driver will announce "The (whatever) 
  705. taken."è
  706. For DROP, the object will be dropped if (a) the noun is linked
  707. to an object, and (b) the object is carried.  If either test 
  708. fails, an message will be printed (either "You can't do that" 
  709. if the noun has no linked object, or "You aren't carrying 
  710. it.")  If the tests succeed, the driver will display "The 
  711. (whatever) released."
  712.  
  713. For GO, the player will move if the noun was a legal direction
  714. and there is a link to a room in the specified direction.
  715.  
  716.  
  717.  
  718. TECHNICAL STUFF
  719.  
  720.  
  721. EXACT INTERPRETATION LOGIC
  722.  
  723. The general flow of action processing is:  display situation
  724. --> get user command --> carry out command --> conduct 
  725. background activity --> display new situation ...
  726.  
  727. Actions are interpreted as follows:
  728.  
  729. 1.  Parse command.  The verb, noun, and object are extracted
  730.     from the input line and each is looked up in a vocabulary
  731.     table.  If the verb doesn't exist, an error is declared
  732.     ("I don't know how to <verb>").  If the noun dosn't exist
  733.     or isn't specified, the driver assigns noun "ANY" to the
  734.     command.  The object number is looked up and stored.  If
  735.     no object is specified or the specified object isn't a
  736.     noun linked to an object, the object number is set to
  737.     zero.
  738.  
  739. 2.  If entire command is "I" or "L", control is transferred
  740.     immediately to the appropriate routine.  The index file is
  741.     not accessed in this case.
  742.  
  743. 3.  The index file is checked for the existence of an action
  744.     routine for the specified verb-noun pair.  If an action
  745.     routine exists, it is read from the reference file and
  746.     control is passed to the action executor.
  747.  
  748. 4.  If no action entry for the verb-noun pair exists, the
  749.     driver rechecks the index for an entry for "verb ANY".  If
  750.     one is found, it is read from the reference file disk and
  751.     control is passed to the action executor.
  752.  
  753. 5.  If no action entry for "verb ANY" exists and the verb is
  754.     GET or DROP; or the verb is GO and no action has yet been
  755.     taken (even if a GO ANY routine exists and has been
  756.     attempted), control is passed to an internal routine
  757.     dealing with GET or DROP or GO.  Note that action table
  758.     entries take precedence over these internal default
  759.     routines, and that the existance of GET ANY or DROP andè    action routines will lock out the driver's internal GET
  760.     and DROP routines.
  761.  
  762. 6.  If none of the above succeed, an error is declared and the
  763.     message "I don't know how to verb noun." is displayed.
  764.  
  765.  
  766. SPECIFICATIONS
  767.  
  768. Vocabulary:  99 verbs, 99 nouns
  769. Object table:  255 objects
  770. Room table:    254 playing rooms
  771.                  (room 0 is reserved as a store)
  772.                  (room 255 is the player)
  773. Message table:  255 message texts
  774. Action table:   unlimited auto (background) actions
  775.                 up to 9999 action entries
  776. Counters:       256 available, numbered 0-255, Basic integers
  777.                   counter 0 holds the move count
  778. Bit flags:      256 available, numbered 0-255
  779.  
  780.  
  781.  
  782. RESPONSIBILITIES OF THE ADVENTURE AUTHOR
  783.  
  784. This compiler will let you specify just about any action.  The
  785. only things it disallows are those it just can't fit into the
  786. system's database structure, like two rooms with the same 
  787. number.  It is the responsibility of the adventure author to 
  788. ensure that the actions he specifies are realistic.  The 
  789. compiler/driver system won't stop you from doing something 
  790. idiotic; if you want to put the player in room 0 or such, 
  791. it'll let you.
  792.  
  793.  
  794. TECHNICAL SUPPORT
  795.  
  796. Contact the author:  Pete Levy, 4209 Longmeadow Way, Fort 
  797. Worth, TX 76133; (817) 292-8731 nights.  Please don't call 
  798. collect, I'm just a poor but honest programmer and can't 
  799. afford it.
  800.  
  801.