Re: Liquids


4 Mar 1995 18:22:56 GMT

> I've started writing a library for TADS with Worldclass that will handle
> liquids sensibly, to the level of detail we expect from WorldClass.
> I fully intend to make this public, so I'm looking for suggestions.
> Some of the pricipal additions I have in mind are:

> * New verbs 'fill' (fill with) and 'pour' (pour on, pour into)
> * Divisibility of liquids, using TADS 2.2 dynamic object creation
> (so it isn't nearly the headache it used to be)

There is an implementation of liquids in GC that you should probably look at
(though it is not as clean as it might be). I deliberately chose not to go
with dynamic object creation, and doubt that creating multiple liquid objects
is the right way to go.

Each liquid in my world is one object. A liquidcontainer may contain a liquid,
or may not, but it may contain at most 1 liquid. A liquid is visible iff some
visible container holds that liquid, and whenever someone tries to manipulate a
liquid ("drink water") the liquid tries to find an accessible container that
contains water, and passes the message on to it.

Although slightly less intuitive than some other approaches, this setup
ensures that a lot of potential inconsistencies never occur, such as a
liquid existing outside of a container.

GC allows containers to pour into one another, etc, and has a special object
(a way cool object, Zeno's Bottle) that (almost) never empties, so it can
fill up many other containers.

Carl