Is there a way to determine the action/verb in Library Messages Miscellany

Hello,

I came across a problem while programming Inform 6 with the standard library: I wanted to implement a GO TO location command, and in doing so, I needed an error message of “not a place you have visited” for nonsensical input or places not yet visited. The default error message is Miscellany #30, “You can’t see any such thing.”. Replacing the message for all actions would obviously not work, but I couldn’t find any way to determine the action triggering the message - testing action and action_to_be both failed.

In the end, I found a solution by handling things in the Sub for the new action, but I wanted to know if there was a better way going via the library message route (besides, I may later come across a situation where I need that check after all).

Yours,
Deathworks

The way that the Standard Library expects this sort of thing to be handled is with a scope token. If one is used, a custom error message can be provided that would take precedence over “You can't see any such thing.

See DM4 p. 233 (Chapter 4, section 32) for an example.

Hello,

Thank you. That has helped me.
Actually, looking into my code, I found that I had already put a print statement there, but no return true. Somehow, it got completely ignored, it seems.

But now, correcting it, it is working like a charm.

Yours,
Deathworks