home *** CD-ROM | disk | FTP | other *** search
/ APDL Soft Rock Games / APDL_SOFTROCK.iso / trellis / docs / part02 < prev    next >
Encoding:
Text File  |  1999-04-02  |  11.9 KB  |  268 lines

  1.  
  2.                         TRELLIS - The Adventure Interpreter
  3.                       (c) copyright 1991-9 Soft Rock Software
  4.  
  5.                             Putting It On The Computer
  6.                             --------------------------
  7.  
  8. With the map and initial notes drawn up, you can now start thinking about
  9. transferring the information onto the computer. Trellis needs this data in the
  10. form of 5 text files, each of which contains a different part of the data:-
  11.  
  12.     Rooms   - contains information about each location
  13.     Words   - contains lists of words the player can enter as commands
  14.     Objects - contains information about each object
  15.     Script  - contains the main controlling program
  16.     Title   - contains the application name for the game - eg !Castle
  17.  
  18. These files can be created in !Edit or your favourite word processor  (provided
  19. it can save !Edit format files).
  20.  
  21. Before describing the format of these files, it is necessary to explain how to
  22. set Trellis up to use them. Create a new dirstory for all these file. As
  23. you create the five files mentioned above, each must be saved in the
  24. NewGame directory.
  25.  
  26. If you are going to include graphics in your game, make a subdirectory in
  27. 'NewGame' called 'Graphics' this contains the graphics files that your game
  28. will display when being played. These are dealt with later.
  29.  
  30. If you are running from floppy disk, you are advised to not use graphics, or if
  31. you must, use as few as possible. If you want to write a text only game, do not
  32. create the graphics subdirectory. Trellis will recognise that it isn't there,
  33. and the game will run quite happily in text only mode.
  34.  
  35. You should also create a file called !Sprites with suitably named sprites (eg
  36. !Wanderer and sm!Wanderer). This should also be saved in the NewGame directory.
  37. (See your computers manuals for details about 'Application' sprites.)
  38.  
  39. Now we can look at the files named above:-
  40.  
  41. In the main, the format of each of these files differs from the others.
  42. However, there are certain similarities which can be explained as a whole
  43. instead of repeating it with the description of each file.
  44.  
  45. First of all, what is meant by a line should be clarified: a line is all
  46. the text/data entered until the return key is pressed - which can be more
  47. than what you might see as a line on the screen. In practice, a line can
  48. be up to approximately 240 characters long. In an 80 column mode, such as
  49. modes 12 or  15, this is three 'screen' lines using the system font. So,
  50. wherever you see the word 'line' in  these instructions, you should
  51. remember that it can be anything up to roughly  240 characters or three
  52. screen lines.
  53.  
  54. If you are using a screen that is wider than 80 characters, using !Edit
  55. you can set the 'display width' to 80. The lines you type in must then be
  56. less than three lines in the edit window. Use the !Edit->Display->Work
  57. Area menu.
  58.  
  59. Another thing that should be explained is what is meant by a 'blank line'.
  60. This is a line on which you press the return key at the very start of the
  61. line without typing in anything else - not even spaces.
  62.  
  63. All of the Trellis files start off in the same way. You may type in a
  64. number of lines of text that will be ignored. These initial 'comment'
  65. lines can be  used to put a title and copyright message at the start of
  66. the files, or  whatever information you choose. The end of these comments
  67. is marked by a  blank line. After the blank line comes the data that is
  68. needed by Trellis.
  69.  
  70. Note: if you prefer not to put any comments at the start of your data
  71. files, you must still include the blank line as Trellis seeks this out as
  72. a marker for the start of the data.
  73.  
  74. --The Words File--
  75.  
  76. This file contains lists of words & alternatives that the player can use
  77. when playing your game. After the initial comment lines and blank line
  78. (mentioned  above) you must put a number; the number of lines of words
  79. that follow. After this come the actual word lists.
  80.  
  81. Each line in the file consists of a series of words, separated by commas,
  82. that mean the same thing and is called a word list. Note: The last word on
  83. the line must have a comma following it as well. For example:-
  84.  
  85. FIGHT,ATTACK,KILL,
  86.  
  87. The first word in each list (the first word on each line) is called a
  88. keyword - 'FIGHT' in the above example. This is the word you must use in your
  89. TScript program whenever you  want to refer to that list - eg to see if the
  90. player has entered a word. If the word list represents an object, for example:-
  91.  
  92. SWORD,WEAPON,
  93.  
  94. then the keyword must also be used in the objects file as part of the
  95. definition for that object. This will be explained as part of the Object
  96. file  instructions.
  97.  
  98. Additionally, there are a number of words and alternatives already defined
  99. within Trellis that, therefore, DO NOT have to be included in your Words
  100. file.  These are:-
  101.  
  102. NORTH,
  103. EAST,
  104. SOUTH,
  105. WEST,
  106. UP,
  107. DOWN,
  108. GET,TAKE,GRAB,LIFT,PICK,STEAL,PINCH,
  109. DROP,LEAVE,ABANDON,
  110. INV,
  111. EXAMINE,STUDY,CHECK,DESCRIBE,
  112. LOOK,SEARCH,
  113. QUIT,END,FINISH,TERMINATE,STOP,
  114. HELP,SUPPORT,AID,
  115.  
  116. Although these words are not part of the Words file, you may treat them as
  117. if they are. In other words, the first word on each of the above lines is
  118. a keyword which can be used by you in your TScript files.
  119.  
  120. --The Objects File--
  121.  
  122. This file is used to tell the software what objects there are in the game,
  123. and other information it needs to know about them. After the initial
  124. comment lines and blank lines the definitions start. The first line after
  125. the blank  line must be a number, this tells Trellis how many objects
  126. there are.
  127.  
  128. Following this are the definitions for each object. For each object there
  129. will be 6 lines, as follows:-
  130.  
  131. Line 1 - ignored. This can be a comment, or can be left blank, or
  132. whatever. My own preference is to use a line of asterisks (*), broken up
  133. in the center by the number of the object. Eg:-
  134.  
  135. ******************************* 1 *********************************
  136.  
  137. Note: this number is not used, as such, by the software and is not part of
  138. the definition. I use it only for my own reference.
  139.  
  140. Line 2 - the keyword. This is a word that is used to refer to this object
  141. in the script file, in respect of the player's commands. It is also used,
  142. if there are alternatives that the player can type in, as the first word
  143. on a line in the words file. For example, if the object is a sword this
  144. would appear in the objects file:-
  145.  
  146. SWORD
  147.  
  148. (and the line in the words file, therefore, might be SWORD,WEAPON,)
  149.  
  150. Line 3 - the definition. This is a short description of the object,
  151. usually  two words. For example:-
  152.  
  153. a sword
  154.  
  155. When the software tells the player what he/she can see, it is this
  156. description that is displayed on screen.
  157.  
  158. Line 4 - the room number. This is a number that tells Trellis what room
  159. the object is in at the start of the game. If you don't want the object to
  160. start off in a room (perhaps the object may magically appear at the
  161. appropriate time) you can set this to -1.
  162.  
  163. Note: if an object is in room 0 it is being carried by the player.
  164.  
  165. Line 5 - the weight. This tells Trellis how heavy the object is. The
  166. player can be given a weight limit, and the total weights of all the
  167. objects he/she carries can't exceed this. If you don't want to use a
  168. weight limit simply set all the object weights to zero. If there is
  169. something in the game that, although the player can't pick up, may be
  170. usefully treated as an object for the purposes of examining it, etc., then
  171. give it a weight higher than the weight limit. This technique has been
  172. employed in the game !Pyramid, wherein a statue and a pedestal are objects
  173. that the player can't carry.
  174.  
  175. Line 6 - the description. This line will be displayed by Trellis whenever
  176. the player wants to examine the object. It enables a more detailed
  177. description of the object than the one on line 2, and may include clues
  178. about what the object may be used for. It could even include an
  179. advertisement for another game!
  180.  
  181. --The Rooms File--
  182.  
  183. The rooms file contains descriptions of each location in the game and
  184. information that tells Trellis how the player can move between them. As
  185. with the other files, it starts off with the comments and blank line.
  186. After this comes a number (the number of rooms), then the actual data.
  187. Each room's definition has four lines:-
  188.  
  189. Line 1 - ignored. This line can be used for comments, left blank, or
  190. whatever. Similarly to the objects file, my own preference is to use it
  191. for  numbering the rooms via a line of asterisks and a number. For
  192. example:-
  193.  
  194. *************************** 1 *****************************
  195.  
  196. Line 2 - description. This line contains the text that is displayed for
  197. the location. For example:-
  198.  
  199. You are on a high cliff-side path. It is cold here, and the strong wind
  200. makes it difficult to maintain your balance.
  201.  
  202. You may find, if you are making your descriptions very detailed, that the
  203. line limit of 240 characters is not enough. It is possible, however, to add
  204. more to the description via the script file. This will be explained at the
  205. appropriate point in these instructions.
  206.  
  207. Line 3 - the name of the graphics file to be displayed for this room. The
  208. graphics files are described in more detail later on. If you have elected
  209. to make your game text only, by excluding the graphics subdirectory, this
  210. line must still be present, even if there is nothing on it.
  211.  
  212. Line 4 - Light Flag & Exits. This line tells Trellis if the room is light
  213. or dark, and what (automatic) exits there are. All the different items on
  214. this line should be separated by commas.
  215.  
  216. If the room is light the first character on this line must be L. If it is
  217. dark the L can be left out. What this actually tells Trellis is the
  218. conditions under which the location's description can be shown on screen.
  219. If the L is present (ie. the room is light) the description will always be
  220. shown. However, if no L is present (the room is dark) the description will
  221. only be  shown if the player is carrying a light source (such as a torch),
  222. otherwise the software will show the message 'It is too dark to see.'
  223.  
  224. In order to tell Trellis that the player is carrying a light source the
  225. contents of a store must be set accordingly. This will be detailed in the
  226. section on stores.
  227.  
  228. The exits are detailed by including the first letter of the direction
  229. followed by the number of the room the direction leads to. This may seem a
  230. little unclear, so to use an example:-
  231.  
  232. L,N14,S15,W16
  233.  
  234. If this is part of the definition for room 13, it says that the room is
  235. light (L), moving North leads to room 14 (N14), moving South leads to room
  236. 15 (S15) and moving West to room 16 (W16). There is no E, U, or D so the
  237. player can't go East, Up or Down - unless you allow him/her to do so via a
  238. section of the script file. This is dealt with later in the section on
  239. puzzles.
  240.  
  241. --The Script File--
  242.  
  243. This file contains a program (or script) that Trellis must follow in order
  244. to run your adventure game. Depending on what is needed for your game, the
  245. script file can be as simple or as complicated as you like.
  246.  
  247. The basic format of the file starts off as with the others, with the
  248. comments and blank line. After the blank line are the commands. Each
  249. command should be on a separate line. Leading spaces are ignored, so you
  250. can easily indent sections of the script. Blank lines are also ignored.
  251.  
  252. The language that Trellis recognises is called TScript, and is currently
  253. in version 2 (though this version number can be ignored if you ensure your
  254. script follows the instructions for this version of Trellis, since Trellis puts
  255. an interpreter in the game. Part 4 of these instructions describes the commands
  256. available with TScript. Before that, however, the subject of stores in Trellis
  257. needs to be explained. This is dealt with in the next part.
  258.  
  259. --The Title File--
  260.  
  261. This line simply contains the name of the game that will appear in filer
  262. windows - ie the application name. Simply type in a name, such as !Castle,
  263. and press <Return>. If no Title file is present then !Trellis will use
  264. the same name as the name of the source directory with a '!' character
  265. added at the start. For example, if the source files had all been in a
  266. directory named 'Wanderer' and there was no Title file then Trellis
  267. would call the completed adventure !Wanderer.
  268.