home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 02a / pcgjan87.zip / ADVENT.PCG next >
Text File  |  1987-01-18  |  6KB  |  169 lines

  1.  Welcome back to the world of Adventure 
  2.  game  writing  and  the  eighth  in  a 
  3.  series  that  will end about the  same 
  4.  time  as all my other  projects  (when 
  5.  sunny  Southern California slides  off 
  6.  into the Pacific with a loud rumble).
  7.  
  8.  This  time  around  we need  to  start 
  9.  making  certain revisions in our  word 
  10.  list   and  produce   another   array.  
  11.  First,  the  revisions to the data  in 
  12.  the  file WORDS.TXT have to be made to 
  13.  accommodate the new words that we  are 
  14.  going to need for our game.  
  15.  
  16.  The  new words are going to cover  the 
  17.  objects  that aren't already listed in 
  18.  the word list.  The words and the data 
  19.  for them are as follows-
  20.  
  21.  HOOK,67,1            BLOCK,572,1
  22.  PAINTING,568,1       DRAWER,573,1
  23.  PICTURE,568,1        WORKBENCH,74,1
  24.  CLOTHES,569,1        BENCH,74,1
  25.  HANGERS,569,1        SAFE,75,1
  26.  CHAIR,570,1          WATCH,76,1
  27.  SEAT,570,1           FLASHLIGHT,577,1
  28.  PANEL,571,1          LIGHT,577,1
  29.  CONTROL,572,1
  30.  
  31.  Please  note that some of  the  object 
  32.  numbers  are  in the  500's.  That  is 
  33.  because  we  need  a way  to  set  the 
  34.  objects we can carry off from the ones 
  35.  that  we  can't.  (This isn't  a  game 
  36.  where  we can run in and carry off the 
  37.  FREEZER.)  
  38.  
  39.  Three  ways to show the computer which 
  40.  objects you can carry are:  1.  Set up 
  41.  an array, 2. mark the movable objects, 
  42.  or  3.  make all the  movable  objects 
  43.  occupy the lower part of the nouns.  I 
  44.  have   choosen  to  mark  the  movable 
  45.  objects  by  making  them  500  series 
  46.  object numbers.  Marking the immovable 
  47.  objects   would  involve   less   work 
  48.  changing  the existing data and really 
  49.  would  work the same.   Setting up  an 
  50.  new array would work.  However,  I  am 
  51.  letting the array I already have carry 
  52.  that load.  
  53.  
  54.  But,  why  not  put  all the carriable 
  55.  objects in the beginning of the  nouns 
  56.  and  tell the computer that any object 
  57.  between 1  and  76  is  carriable?  It 
  58.  would perhaps be the easiest way to do 
  59.  the  job.  However,  I  like  the idea 
  60.  that,  to add an object to  the  data, 
  61.  all  you  have  to do is put it at the 
  62.  end.   This  approach  does   have   a 
  63.  drawback,   however.   You  lose  some 
  64.  speed,  especially if you object is at 
  65.  the end of the list.  
  66.  
  67.  Notice  also  that I haven't  cut  the 
  68.  words off at 6 letters.  I am going to 
  69.  let this array also handle the load of 
  70.  giving  me the object names.   In  the 
  71.  games  Aaron and I used to write there 
  72.  was  an  string  with  all  the  words 
  73.  represented   by  their  first   three 
  74.  letters.  This was  what  we  compared 
  75.  against  using  the  location  in  the 
  76.  string to give us the object number.  
  77.  
  78.  It worked fine; unless you want to use 
  79.  two words  to  mean  the  same  thing.  
  80.  Then you have to have alot of-
  81.  
  82.       If O=45 then O=42
  83.  
  84.  This  had  to  be done for  the  verbs 
  85.  also.   But,  you  could  handle  that 
  86.  operation in the-
  87.  
  88.       On F GOTO 750,800,800,945, etc.
  89.  
  90.  However, this only gave you the object 
  91.  number. What if you walked into a room 
  92.  and looked around?   Telling you  that 
  93.  there  was a BOO or a TOO in the  room 
  94.  wouldn't help you very much. So we had 
  95.  to  have  an  array with  all  of  the 
  96.  object names in it.  
  97.  
  98.  So  far  we have modified the data  in 
  99.  the word list and set it up to let  us 
  100.  carry only certain objects.   Also  we 
  101.  have added some other objects that may 
  102.  prove to be useful in our game.
  103.  
  104.  Now we need to add an array that  will 
  105.  let us know where the object is in our 
  106.  world.   This  array will also let  us 
  107.  put  things in the room but have  them 
  108.  hidden   from  the  player  until   he 
  109.  'discovers'  them.   This  'discovery' 
  110.  can  be as simple as opening a drawer, 
  111.  or as complex as you like.
  112.  
  113.  The first thing we need to do is add a 
  114.  line  105 that will dimension our  new 
  115.  array  as OL(25,2) -  Where 25 is  the 
  116.  number  of  objects that  inhabit  our 
  117.  world.   Then  between  line 9350  and 
  118.  line  9358  we will  insert  our  data 
  119.  where it will be read at the same time 
  120.  as all the other arrays.   These lines 
  121.  will be as follows-
  122.  
  123.  9350 FOR X = 1 TO 25:FOR Y = 1 TO 2
  124.  9351 READ OL(X,Y)
  125.  9352 NEXT Y: NEXT X
  126.  9353 DATA 75,1,569,2,67,-2,571,3
  127.  9354 DATA 554,-3,60,3,528,4,546,4
  128.  9355 DATA 545,4,20,4,21,4,553,4
  129.  9356 DATA 570,6,547,-6,542,-6,538,-6
  130.  9357 DATA 559,6,22,6,73,-6,74,6,23,6
  131.  9358 DATA 577,-6,568,7,572,-8,567,0
  132.  
  133.  The  first number is the object number 
  134.  and the second is the location of that 
  135.  object.   To  see what objects are  in 
  136.  any of the rooms all we have to do  is 
  137.  to  have  a check done to see  if  the 
  138.  second  number  is equal to  the  room 
  139.  number.  
  140.  
  141.  The  negative numbers are the 'hidden' 
  142.  objects,  for instance, objects in the 
  143.  toolbox.  I also tend to 'hide' things 
  144.  like  drawers and other  objects  that 
  145.  are  in  plain  sight  but  that  most 
  146.  people   wouldn't  notice  at   first.  
  147.  Other  'hidden' objects would be under 
  148.  or  behind  other  objects.   This  is 
  149.  another  area  that  you  have  to  be 
  150.  somewhat realistic in.  Otherwise  you 
  151.  end  up with all the objects hidden so 
  152.  deeply that the player can't make  any 
  153.  headway.   The object that has a 0 for 
  154.  it's location is the watch,  and it is 
  155.  on  the  players wrist.   Zero is  the 
  156.  'room' that we check if we  are  doing 
  157.  an   inventory   of   objects  in  our 
  158.  possession.  
  159.  
  160.  Next month I hope to work all of these 
  161.  changes  and additions into the  basis 
  162.  of our game,  plus put out a  copy  of 
  163.  the  game  and  data files as they are 
  164.  now  (Unless  someone  brings in a new 
  165.  game  to  the  office...   then,   the 
  166.  article could be a month or two late).  
  167.  Have a HAPPY NEW YEAR!  
  168.  
  169.