home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
02a
/
pcgjan87.zip
/
ADVENT.PCG
next >
Wrap
Text File
|
1987-01-18
|
6KB
|
169 lines
Welcome back to the world of Adventure
game writing and the eighth in a
series that will end about the same
time as all my other projects (when
sunny Southern California slides off
into the Pacific with a loud rumble).
This time around we need to start
making certain revisions in our word
list and produce another array.
First, the revisions to the data in
the file WORDS.TXT have to be made to
accommodate the new words that we are
going to need for our game.
The new words are going to cover the
objects that aren't already listed in
the word list. The words and the data
for them are as follows-
HOOK,67,1 BLOCK,572,1
PAINTING,568,1 DRAWER,573,1
PICTURE,568,1 WORKBENCH,74,1
CLOTHES,569,1 BENCH,74,1
HANGERS,569,1 SAFE,75,1
CHAIR,570,1 WATCH,76,1
SEAT,570,1 FLASHLIGHT,577,1
PANEL,571,1 LIGHT,577,1
CONTROL,572,1
Please note that some of the object
numbers are in the 500's. That is
because we need a way to set the
objects we can carry off from the ones
that we can't. (This isn't a game
where we can run in and carry off the
FREEZER.)
Three ways to show the computer which
objects you can carry are: 1. Set up
an array, 2. mark the movable objects,
or 3. make all the movable objects
occupy the lower part of the nouns. I
have choosen to mark the movable
objects by making them 500 series
object numbers. Marking the immovable
objects would involve less work
changing the existing data and really
would work the same. Setting up an
new array would work. However, I am
letting the array I already have carry
that load.
But, why not put all the carriable
objects in the beginning of the nouns
and tell the computer that any object
between 1 and 76 is carriable? It
would perhaps be the easiest way to do
the job. However, I like the idea
that, to add an object to the data,
all you have to do is put it at the
end. This approach does have a
drawback, however. You lose some
speed, especially if you object is at
the end of the list.
Notice also that I haven't cut the
words off at 6 letters. I am going to
let this array also handle the load of
giving me the object names. In the
games Aaron and I used to write there
was an string with all the words
represented by their first three
letters. This was what we compared
against using the location in the
string to give us the object number.
It worked fine; unless you want to use
two words to mean the same thing.
Then you have to have alot of-
If O=45 then O=42
This had to be done for the verbs
also. But, you could handle that
operation in the-
On F GOTO 750,800,800,945, etc.
However, this only gave you the object
number. What if you walked into a room
and looked around? Telling you that
there was a BOO or a TOO in the room
wouldn't help you very much. So we had
to have an array with all of the
object names in it.
So far we have modified the data in
the word list and set it up to let us
carry only certain objects. Also we
have added some other objects that may
prove to be useful in our game.
Now we need to add an array that will
let us know where the object is in our
world. This array will also let us
put things in the room but have them
hidden from the player until he
'discovers' them. This 'discovery'
can be as simple as opening a drawer,
or as complex as you like.
The first thing we need to do is add a
line 105 that will dimension our new
array as OL(25,2) - Where 25 is the
number of objects that inhabit our
world. Then between line 9350 and
line 9358 we will insert our data
where it will be read at the same time
as all the other arrays. These lines
will be as follows-
9350 FOR X = 1 TO 25:FOR Y = 1 TO 2
9351 READ OL(X,Y)
9352 NEXT Y: NEXT X
9353 DATA 75,1,569,2,67,-2,571,3
9354 DATA 554,-3,60,3,528,4,546,4
9355 DATA 545,4,20,4,21,4,553,4
9356 DATA 570,6,547,-6,542,-6,538,-6
9357 DATA 559,6,22,6,73,-6,74,6,23,6
9358 DATA 577,-6,568,7,572,-8,567,0
The first number is the object number
and the second is the location of that
object. To see what objects are in
any of the rooms all we have to do is
to have a check done to see if the
second number is equal to the room
number.
The negative numbers are the 'hidden'
objects, for instance, objects in the
toolbox. I also tend to 'hide' things
like drawers and other objects that
are in plain sight but that most
people wouldn't notice at first.
Other 'hidden' objects would be under
or behind other objects. This is
another area that you have to be
somewhat realistic in. Otherwise you
end up with all the objects hidden so
deeply that the player can't make any
headway. The object that has a 0 for
it's location is the watch, and it is
on the players wrist. Zero is the
'room' that we check if we are doing
an inventory of objects in our
possession.
Next month I hope to work all of these
changes and additions into the basis
of our game, plus put out a copy of
the game and data files as they are
now (Unless someone brings in a new
game to the office... then, the
article could be a month or two late).
Have a HAPPY NEW YEAR!