Newsgroups: rec.arts.int-fiction
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!news.maxwell.syr.edu!logbridge.uoregon.edu!arclight.uoregon.edu!news.tufts.edu!newstransit.mitre.org!world!not-for-mail
From: buzzard@TheWorld.com (Sean T Barrett)
Subject: Re: [INFORM] Containers in transparent objects.
Sender: news@world.std.com (Mr Usenet Himself)
Message-ID: <GzBEAJ.B49@world.std.com>
Date: Mon, 15 Jul 2002 23:51:55 GMT
References: <3d31cfc4$0$22477$3c090ad1@news.plethora.net>
NNTP-Posting-Host: shell01.theworld.com
Organization: The World Public Access UNIX, Brookline, MA
X-Newsreader: trn 4.0-test72 (19 April 1999)
Lines: 37
Xref: news.duke.edu rec.arts.int-fiction:106184

Peter Seebach <seebs@plethora.net> wrote:
>So, I have a desk, containing drawers.  The desk is "transparent" so you can
>see the drawers... but as a result the *contents* of the drawers are seen as
>"part of the desk".  What obvious combination of flags have I overlooked?
>
>Tree:
>	Desk (transparent, ~container)
>	-> Drawer (container)
>	-> -> book
>
>> take book
>That seems to be part of the desk.

I believe that this is due to the Inform library not properly
considering what it means to be nested down more than one level from
a transparent non-container--i.e. the idea that you have a container
as a component. For one game in which the equivalent of the desk
was moved and removed (The Weapon), I addressed this by "fixing"
the libary rather than using AddToScope, which feels too hacky
to me. (E.g. parent(x) no longer reports things correctly, so
you have to engineer around it.)

I don't know for sure that this doesn't somehow break something
else, although I've never noticed any problems with it; but I've
been hesitant to submit it to the patch page because of this.

The fix is to modify the second section of ObjectIsUntouchable
so that if it's checking for takability (flag2), it only checks
the hasnt container/hasnt supporter relation the first time
through the loop--it's ok if your grandparent isn't a container
if your parent is. Hmm, in fact, my implementation does have a
bug, since it should continue checking for the animate case as
it goes higher--you shouldn't be able to take something in a
container carried by an NPC, but you should be able to take
something in a container that's a component of an object.

SeanB
