Re: Inform: Implementing a semi-realistic car


Sat, 19 Aug 1995 09:17:21 +0100

Jeffrey Taylor (elric@wheel.ucdavis.edu) wrote:

> I think you need to look at locked attribute too. The car needs
> locked lockable container transparent and open attributes. You
> are trying to do with open attribute what should be done with locked
> attribut. Oh, and it should have the enterable attribute. Wtih
> transparent attribute the contents of the car can be seen from outside.

This is where I ran into problems. Some of these attributes cause problems
when you try to use them in conjunction with others. The simplest example is
if you want to lock a lockable object it must also have ~open, whereas to
enter an enterable object it must be open. Therefore, if I have an object
which has lockable enterable, but don't want to explicitly use `OPEN/CLOSE
<OBJECT>' I need a before routine in the object definition, something like:

before [;
Open, Close:
"[There's no need. This is done automatically by the game as \
necessary.]";
Lock, Unlock:
give self ~open;
rfalse;
Enter:
give self open;
],

I know this looks reasonably simple, but believe me it causes further
problems! Anyway, I wont' try to re-explain the situation. If anyone
doesn't believe me just try writing your own car which does everything I've
implied previously. It's damn difficult (prepares to eat his words). I
think that the library, while continually improving and making it far easier
to do things `by the book', as it gets more specific, is becoming more of a
hindrance than a help when trying to code something out of the ordinary. Or
maybe it's just me...

-- 
Julian Arnold                                         jools@arnod.demon.co.uk