Funny Bug in Inform Library

2 views
Skip to first unread message

Daryl McCullough

unread,
Feb 5, 1997, 3:00:00 AM2/5/97
to

I was playing an Inform game recently (never mind which) and my
player had a jar full of water. I encounter a creature that
I think might be thirsty, so I try:

Give water to creature.

Inform's response was this:

(the quantity of water to the crested animal)
(first taking the quantity of water)
The quantity of water is already in the jar.

Hmmm. (I'm guessing that the problem is with the Inform
library rather than with the specific game.)

Daryl McCullough
CoGenTex, Inc.
Ithaca, NY

Andrew Plotkin

unread,
Feb 5, 1997, 3:00:00 AM2/5/97
to

Daryl McCullough (da...@cogentex.com) wrote:
> I was playing an Inform game recently (never mind which)

Quick! Everybody guess!

> and my
> player had a jar full of water. I encounter a creature that
> I think might be thirsty, so I try:

> Give water to creature.

> Inform's response was this:

> (the quantity of water to the crested animal)
> (first taking the quantity of water)
> The quantity of water is already in the jar.

> Hmmm. (I'm guessing that the problem is with the Inform
> library rather than with the specific game.)

The message is coming from the library, but it's actually a game bug.
(Unless you regard the fact that the library doesn't handle liquids as a
library bug -- which I don't.)

If you know the library, it's pretty obvious what's going on. The "give
X to Y" verb, correctly, tries to "take X" if X is not actually in your
hands. And the "take water" command is rigged to perform "put water in
jar", since that's the only way you can carry water.

A more accurate error message for "take water" might be "You can't carry
water in your bare hands!" (I mean, an error message for the case where
your jar is already full of water.) But that doesn't actually improve the
case under discussion.

Unfortunately, there is no really easy fix. There is no way to override
the auto-take action of "held" verb tokens. (It happens before "before"
clauses.) That *is* a bug, or at least a lack of important feature.
(Request! Request!) The only way to deal with it is to change the grammar
line from
* held "to" creature -> Give
to
* noun "to" creature -> Give
and hope nobody complains about the sudden lack of auto-take for that verb.

--Z

--

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the
borogoves..."

Magnus Olsson

unread,
Feb 5, 1997, 3:00:00 AM2/5/97
to

In article <erkyrathE...@netcom.com>,

Andrew Plotkin <erky...@netcom.com> wrote:
>Unfortunately, there is no really easy fix. There is no way to override
>the auto-take action of "held" verb tokens. (It happens before "before"
>clauses.) That *is* a bug, or at least a lack of important feature.
>(Request! Request!)


Yes, please! Me too! Me too! :-)

Actually, I find the auto-take feature to be pretty irritating at times,
especially when the thing the parser tries to take is manifestly untakable.
For example, I recently tried the command "eat me" when playing a game where it
seemed appropriate (don't ask!), and got the reply

> eat me
(First taking yourself)
You are always self-possessed!

which wasn't quit the answer I had expected.

Perhaps grammar lines containing "held" should work the following way:
If the object is held, OK. If not and it is ~= player and not static or
scenery, then take it. Else do something smart - but what? Perhaps "held"
should be viewed as a suggestion rather than an absolute requirement, so
that it could match even non-held objects (equivalent to adding an
extra grammar line with "held" replaced by "noun")? In the latter case,
all action routines would of course have to check if the object really
was held. But this would make the game behave more naturally in cases
such as this:

| Freezer
| You are inside a gigantic freezer with ice-covered walls.
| You can see an ice cream cone here.
|
| > Eat cone
| (First taking the ice cream cone)
| Yum!
|
| > Eat ice
| You lick at the ice-covered wall. Your tongue immediately sticks to it.

which IMHO is much preferable to being told that I can't take the wall.


>The only way to deal with it is to change the grammar
>line from
> * held "to" creature -> Give
>to
> * noun "to" creature -> Give
>and hope nobody complains about the sudden lack of auto-take for that verb.

Personally, I can live without auto-take. I know there are people who
regard it as an essential convenience, though.


--
Magnus Olsson (m...@df.lth.se, zeb...@pobox.com)

Andrew Plotkin

unread,
Feb 5, 1997, 3:00:00 AM2/5/97
to

Magnus Olsson (m...@bartlet.df.lth.se) wrote:
> In article <erkyrathE...@netcom.com>,
> Andrew Plotkin <erky...@netcom.com> wrote:
> >Unfortunately, there is no really easy fix. There is no way to override
> >the auto-take action of "held" verb tokens. (It happens before "before"
> >clauses.) That *is* a bug, or at least a lack of important feature.
> >(Request! Request!)

> Yes, please! Me too! Me too! :-)

> Actually, I find the auto-take feature to be pretty irritating at times,
> especially when the thing the parser tries to take is manifestly untakable.
> For example, I recently tried the command "eat me" when playing a game where it
> seemed appropriate (don't ask!), and got the reply

> > eat me
> (First taking yourself)
> You are always self-possessed!

> which wasn't quit the answer I had expected.

> Perhaps grammar lines containing "held" should work the following way:
> If the object is held, OK. If not and it is ~= player and not static or
> scenery, then take it. Else do something smart - but what?

I'd rather be able to control it myself, rather than having any automatic
rule. (Or rather, if there is any automatic rule, I must be able to
override both "yes, auto-take" decisions and "no, don't auto-take"
decisions.)

Now that there's no property limit, I guess just another property is the
best answer. The current system is nearly always right; it's only for
particular objects that I want to override it, so allowing some kind of
"autotake" property on objects seems to be the right approach.

It would return three different possible values:
* yes, try to take the object, and proceed with the action if that succeeds
* no, don't try to take the object, but proceed with the action anyway
* print a message and fail.

And of course the property could have action cases. (As before, after,
and life do.)

This is, remember, only done for "held" verb tokens. And if there is no
autotake property, it assumes "yes", which is the current behavior.

> Perhaps "held"
> should be viewed as a suggestion rather than an absolute requirement, so
> that it could match even non-held objects (equivalent to adding an
> extra grammar line with "held" replaced by "noun")? In the latter case,
> all action routines would of course have to check if the object really
> was held. But this would make the game behave more naturally in cases
> such as this:

> | Freezer
> | You are inside a gigantic freezer with ice-covered walls.
> | You can see an ice cream cone here.
> |
> | > Eat cone
> | (First taking the ice cream cone)
> | Yum!
> |
> | > Eat ice
> | You lick at the ice-covered wall. Your tongue immediately sticks to it.

> which IMHO is much preferable to being told that I can't take the wall.

I would then handle this with
Object icewall
with autotake [;
Eat: return 2; ! value for "no, don't auto-take"
],
before [;
Eat: "You lick at the ice-covered wall.";
];

Of course in this case you could put the "You lick..." message directly
in autotake, but extra flexibility never hurt anyone.

There. A complete proposal. Backwards-compatible, even. Graham?

> Personally, I can live without auto-take. I know there are people who
> regard it as an essential convenience, though.

At least as essential as a "sack" object, which is pretty important in
games with many objects.

Gareth Rees

unread,
Feb 6, 1997, 3:00:00 AM2/6/97
to

Daryl McCullough <da...@cogentex.com> wrote:
> > Give water to creature.

> (the quantity of water to the crested animal)
> (first taking the quantity of water)
> The quantity of water is already in the jar.

I had to jump through a lot of hoops to get this kind of thing to work
in "Christminster". See the file "alchemy.inf" in the source
distribution.

--
Gareth Rees

Joe Mason

unread,
Feb 8, 1997, 3:00:00 AM2/8/97
to

"Re: Funny Bug in Inform L", declared Andrew Plotkin from the Vogon
ship:

AP>important feature. (Request! Request!) The only way to deal with it
AP>is to change the grammar line from
AP> * held "to" creature -> Give
AP>to
AP> * noun "to" creature -> Give
AP>and hope nobody complains about the sudden lack of auto-take for that
AP>verb.

Or better yet,

* NewHeld "to" creature -> Give

which could duplicate the normal "held" token except that liquids in
containers now count as held if the containers are held, etc.

Joe

ş CMPQwk 1.42 9550 şIf all else fails, lower your standards.

Reply all
Reply to author
Forward
0 new messages