Re: Tricky inform problem


11 Jul 1995 12:27:29 GMT

Jason Dyer <jdyer@indirect.com> wrote:
> I'm trying to be able to get the NAME something like in Beyond Zork,
> so that you can refer to it and it will be described by that name
> thereafter.

Look at the example game "Balances", in which you can give names to the
featureless white cubes. The relevant portion of the code is at lines
59--127. Essentially, each cube has an array of characters associated
with it (in Balances, limited to 8 characters, because version 3 of the
Z-machine limits property data to 4 words). When the player names a
cube, the letters are copied from the input word into the array. The
cube's `parse_name' routine compares input text with its array,
character by character. The cube's `short_name' routine prints out the
name one character at a time.

> And as a much easier challenge, I've been trying to get the room name
> alone centered on top like in Trinity.

The width of the screen may be fetched from the game header (use
`0->33'). The height of the screen is at `0->32'. See the
specification of the Z-machine for details, and see the definition of
`DrawStatusLine' in Parser.h for a use.

Having said that, as a player I prefer score and turns on the status
line to a nicely centred room name.

--
Gareth Rees