How do I check whether a person is in the presence of another object?

This is a sorta-confusing bit of Inform – I believe “in the presence of” is used when you’re talking about an action, like you can use it to construct rules of the form “before jumping in the presence of the scalpel.” But for conditionals in your example, where no action is involved and you’re just testing the state of the world, you want to use “the location of”, like “if the location of Fred is the location of the scalpel” (note that Inform also doesn’t like it when you try to do a logical test on something as nonspecific as “a person”, so if you want the rule to apply to every character in the game, you might need to do a “with X running through…” kind of thing).

The documentation on “the location of” is here; you might also be interested in the “enclosed by” relation discussed lower down on that page. There’s also a lot of really good, but fairly advanced, discussion in this thread that might be useful about the subtleties of containers, supporters, and so on that might wind up being relevant to what you’re trying to do.

1 Like