Custom messages for unsuccessful attempt of any kind

Hi all, this is my first post and I think it’s kind of a basic question but I’m failing to find the right vocabulary to search what I mean. Which also might make it hard for me to explain what I mean… :confused: I’m really new to this.

I want Inform to draw at random from pool of words/sentences that will print after the standard lib message printed for any type of failed action/unsuccessful turn. So if a player examines something undescribed it would say something like:

You can’t see any such thing. My random message here.

I see how I could change the first part but don’t know how to tell inform to say something after a lib message for any kind of failure, mainly so I don’t have to do it for every rule.

I want to leave the standard messages as they are. I just want certain information to surface every time the player makes a false/wrong input.

Thank you kindly for help in advance, hope this made sense.


It depends what you mean by “unsuccessful”. There are two (main) ways actions can fail in Inform.
1 - The game can’t understand the player’s input and turn it into a meaningful action in the simulated world.
2 - The game understands the input, but the player character fails to perform the simulated action.
The former is for inputs like “EXAMINE THE ASDFGH” (“You can’t see any such thing.”), the second for inputs like “OPEN THE DOOR” (“It seems to be locked.”).

It sounds like it’s the former you’re concerned with here. Those errors are handled by the “printing a parser error” activity. So try something like this:

After printing a parser error:
    say "You caused a parser error and should feel bad."

Thanks! Yes I see the difference now. I am in fact interested in both…so anytime a player makes an unsuccessful action or attempt of any kind these fragments of information I would add to the Say string would bubble up. Your suggestion worked for the former, how do I handle the latter?

Thanks so much again!

The latter case is more difficult, since most rules that will make actions fail in that way are assumed to print an appropriate message automatically. I can’t think of a good general method off the top of my head as it is. I’d probably use I6, though there may be a pure I7 way to accomplish the same goal.

There’s an “After Not Doing Something” extension by Ron Newcomb, which might help.