<ceraphim13.DeleteThis@bresnan.net> wrote in message
news:1143453886.832161.97500@z34g2000cwc.googlegroups.com...
> How do you test to see if a player is holding something directly,
> or
> indirectly? I have seen posts how to do this in tads, but how do I
> acomplish this in Inform? I am designing a game and have a room
> that
> you can't leave if you are holding a specific object, even if it
> is
> closed up in a container you are holding. Any help would be
> appreciated!
For direct containment, test:
if(obj in player) ...
Where obj is the object in question. If by "directly held" you mean
you want to exclude objects that are currently being worn then use:
if(obj in player && obj hasnt worn) ...
To test whether obj is either directly or indirectly in the player's
inventory, use:
if(IndirectlyContains(player, obj))...
BTW, for future reference, this type of query might get a better
response if it's posted to rec.arts.int-fiction, which is the list
for discussing *writing* games; rec.games.int-fiction is intended
for the discussion of *playing* interactive fiction.
HTH,
Eric
>> Stay informed about: Testing what a player is holding