home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / games2 / trellis / Instructs / Part3 < prev    next >
Encoding:
Text File  |  1994-09-12  |  6.9 KB  |  159 lines

  1.  
  2.                         TRELLIS - The Adventure Interpreter
  3.                       (c) copyright 1991-4 Soft Rock Software
  4.  
  5.                                    Storing Data
  6.                                    ------------
  7.  
  8. In any computer program that performs any useful task there will be a need
  9. to store and access data. You provide a lot of data for Trellis in the files
  10. described in the previous section of these instructions. Most of this data
  11. is put into special variables that you can access from your TScript program.
  12. In addition to these variables there is a set of variables for you to store
  13. numbers in, which can represent whatever you want them to.
  14.  
  15. The complete range of variables you have available are as follows:-
  16.  
  17. Store%(n)
  18. ---------
  19.  
  20. This is the set of variables for storing numbers in. There are 101 of these,
  21. numbered from 0 to 100, so the n in the brackets can be anything in that
  22. range. It can also be a formula that results in a number in that range. The
  23. first 21 of these are set aside for special purposes, but the remaining 80
  24. (numbers 21 to 100) can be used for whatever you want.
  25.  
  26. Store%(0) is used to tell Trellis if the player can see in the dark or not.
  27. If a room (see the description of the Rooms file) is not set up as being a
  28. light room (if it doesn't have an L as part of its third line) Trellis will
  29. look at this store to decide what to do. If it contains -1 (which is often
  30. called TRUE) that means the player is able to see. You could set this to -1,
  31. for example, if the player picks up a torch and switches it on. If it
  32. contains 0 (or FALSE) that means the player can't see if the room is dark.
  33.  
  34. Store%(1) is used to tell Trellis how much weight the player can carry.
  35. Each object in the game has a weight, and the total weight of the objects
  36. carried can't be higher than the number in Store%(1). You can give an object
  37. a weight higher than this limit if you don't want the player to be able to
  38. pick it up at all. You put the weight limit into this store near the start
  39. of the game.
  40.  
  41. Store%(2) is related to Store%(1) because it contains the total weights of
  42. all the objects carried. You can find out what is in this store, but I would
  43. advise against changing it directly until you are a more experienced Trellis
  44. user because it can have confusing results.
  45.  
  46. Store%(3) contains the number of the location the player is in. Under normal
  47. circumstances you would not need to change this, but there are times when
  48. you might want to - perhaps your game is based around Star Trek and the
  49. player can use the transporter to change locations, or it starts off with a
  50. ship wreck and the player is washed up on a section of beach which is chosen
  51. at random.
  52.  
  53. Store%(4) to Store%(20) do not yet have specific uses as yet, but they might
  54. be used in future versions of Trellis. In theory you can use these, because
  55. once you have a game up and running there will be no need to alter it to
  56. work in new versions of Trellis - you can carry on supplying it in the
  57. version it was written - so any use Soft Rock Software puts these stores to
  58. in future versions won't affect your game. However, habits are easily
  59. formed: if you start using them you might forget to stop using them when the
  60. software is updated.
  61.  
  62. Store%(21) to Store%(100) are yours to use freely.
  63.  
  64. The Store%(n) variable is an integer variable. That means it can contain
  65. whole numbers only. The smallest number you can put in one of these
  66. variables is -2147483648 and the biggest is 2147483647.
  67.  
  68. Object Variables
  69. ----------------
  70.  
  71. The variables Object$, List$, Location%, Weight% and Examine$ are all to do
  72. with objects. They are each described below. In each case, the n in the
  73. brackets can be in the range 1 to whatever value you put at the start of
  74. your object definitions (ie. the number of objects). Again, the brackets can
  75. contain a formula that results in a number in this range.
  76.  
  77. Those with a % in the name are integer variables, which can hold a number in
  78. the range given above for stores, though you should be sensible about what
  79. numbers you put in them. Those with a $ in the name are called string
  80. variables, and can hold words and so on.
  81.  
  82. Object$(n)
  83. ----------
  84.  
  85. This is a variable that holds the names of the objects you have defined in
  86. the Objects file. The object name should always be one word, in capitals,
  87. that must be a keyword in the words file (this is explained in the previous
  88. section).
  89.  
  90. List$(n)
  91. --------
  92.  
  93. This variable holds the short descriptions of objects you have defined - the
  94. text that appears when Trellis says 'You can see....' or 'You have....' This
  95. would normally be a two or three word description, such as 'a sword' or 'an
  96. enchanted sword'
  97.  
  98. Examine$(n)
  99. -----------
  100.  
  101. This variable holds a longer description of the object - the text that
  102. appears when the player types EXAMINE .....
  103.  
  104. Location%(n)
  105. ------------
  106.  
  107. This variable tells Trellis where the object is to be found in the game. As
  108. a general rule, it should hold a number from -1 to the number of rooms. -1
  109. is used to 'hide' the object, so that it is not in play. The player can't
  110. find it, or use it, or whatever. If the player is carrying the object, the
  111. Location%(n) variable should contain the value 0.
  112.  
  113. Weight%(n)
  114. ----------
  115.  
  116. This variable holds the weight of the object. This is used in conjunction
  117. with Store%(1) and Store%(2) to see if the player can carry it.
  118.  
  119. Room Variables
  120. --------------
  121.  
  122. The variables Room$, Light%, North%, East%, South%, West%, Up% and Down% are
  123. all to do with descriptions of locations and are described below. In each
  124. case the n in brackets can be from 1 to the number of rooms (and can be a
  125. formula). Again % means integer and $ means string.
  126.  
  127. Room$(n)
  128. --------
  129.  
  130. This contains the description of the location. It is usually displayed on
  131. the screen when the player enters the room, or types LOOK while in that
  132. room - subject to whether or not the room is light and, if not, whether or not
  133. the player can see in the dark.
  134.  
  135. Light%(n)
  136. ---------
  137.  
  138. This is the variable that tells Trellis if a room is light or dark. If it is
  139. light the variable should contain -1, and if it is dark the variable should
  140. contain 0. Trellis will not stop you from using a number outside this range,
  141. but doing so may stop your game from working correctly.
  142.  
  143. You might change this variable to -1 if, for example, the player switches on
  144. the lights and back to 0 if the lights are switched off again.
  145.  
  146. North%(n), East%(n), South%(n), West%(n) Up%(n) and Down%(n)
  147. ------------------------------------------------------------
  148.  
  149. Each of these variables contains the number of the room the player can get
  150. to by moving in the direction given by the name. In other words if
  151. North%(14) contains 52 that means the player can move North from room 14 to
  152. room 52. The variable South%(52) should therefore contain 14 (except in
  153. special circumstances - such as a room being a trap; the player can get in
  154. but not out.)
  155.  
  156. If one of these direction variables contains 0, that means that there isn't
  157. an exit in that direction. You can use this to help include doors in your
  158. game.
  159.