Re: Inform: Question about scope


Sun, 10 Sep 1995 20:50:20 +0100

Christopher E. Forman (ceforma@rs6000.cmp.ilstu.edu) wrote:

> Is there a simple function in Inform to check if a particular item is in
> scope?

I *think* the following routine will do what you want:

[ Available c p;
do
{ c=parent(c);
} until (c==0 || c==p || (c hasnt transparent && c hasnt supporter &&
c hasnt open));
if (c==p) rtrue;
rfalse;
];

Then if, for example, you wanted to find out if a cat was in scope to the
player you would use:

if (Available(cat, player)==1) "Yes, you can see the cat.";

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