Dealing with objects not at player's current location

I don’t like the standard the standard “That noun did not make sense in this context” response.

Three situations come to mind where the response could be more specific:

  • The player tries examining an object that they have already seen but is in another location.

x gift
You can’t examine the gift as it’s not in this location!

  • The player tries examining an object that they have not yet seen but in context of the story, the PC will be aware of it.

x cat
You look about for the cat. It’s not here.
x bed
It’s probably in your bedroom. As usual.

  • The player tries examining an object that they have not yet seen and the PC is unaware of it.

x monster
What monster?

Is this possible? What’s the best way to implement them?

Well, you can certainly edit Inform’s responses. If you find the name of the response for that error - and I think I advise doing a Ctrl-F on the Standard Rules for that, I think it’ll be faster - it’s trivial to edit. Getting the effects you want will be a bit less trivial.

For all of your examples, you need a way to track which objects the player has already seen. The extension “Epistemology” does it for you, I think. In fact, it seems like it’s pretty much what you need. Everything else goes on top of that.

Automating the second example is tricky, but doable - and tedious. For instance, you can declare a certain type of object as being “PC-known”, and construct the response so that if the object is “PC-known” you build it a certain way ("[if the noun is PC-known][The noun] is probably in [location of the noun], as usual.", or “You look about for [the noun]. It’s not here”). (you’ll want to use adaptive text to cover “it’s not here”, but I don’t remember the actual phrasing right now).

If you make it so that everything can be PC-known or “PC-unknown”, you can toggle it as the PM gains knowledge of items. But hey, I’m pretty sure Epistemology does something like that already.

Bottom line, check out the extension, then use its features when constructing the response.

(Mind you, I am unsure exactly what causes that response to appear in the first place. Depending on its conditions, it may be more or less tricky to get the whole thing to work - if scope calculations are made, it can throw things a bit)

Use the extension Remembering by Aaron Reed. It will intercept attempts to interact with non-visible but previously-seen objects and let you print a more interesting response.