Login
Remember
IF Answers
Ask a Question

# How do I change parser error messages from sounding like smackdowns?

+2 votes
114 views
asked Mar 23 in Authoring by AndrewS (250 points)
recategorized Mar 27 by Alex
Unfortunately some defaults in Inform sound a bit harsh and/or bland. But they need to be informative in some way, and they can't be too specific. What to do?

- process
- user-friendliness
- inform7

## 2 Answers

+3 votes
answered Mar 26 by mattweiner (121 points)
In version 6G60 and earlier versions of Inform 7, find Ron Newcomb's Custom Library Messages/Default Messages extensions in order to change the default messages.
In versions 6L02 and later, you can use the built-in rule response facility to change messages. See sections 14.10 through 14.12 of Writing with Inform; you can use the RESPONSES command to figure out which response you need to change and then change it in your source code as described there.
0 votes
answered Mar 23 by AndrewS (250 points)
Ron Newcomb's Custom Library Messages is a good extension.
But there are some parser rejects I find specifically useful in Inform. The note below is a bit crude, and you may want to provide custom rejects to enhance a room's scenery (e.g. "the wall is sealed up. You will need to break through,") but it's useful as a start.
definition: a direction (called dir) is viable:
if the room dir of location of player is nothing, decide no;
decide yes;
before going nowhere:
let vd be the number of viable directions;
if vd is 0:
say "You can't go any direction right now. Maybe you need to solve a puzzle first." instead;
say "You can't go [noun], but you can go [list of viable directions]." instead;
Also,
Rule for printing a parser error when the latest parser error is the I beg your pardon error:
say "No action comes to mind."
You can search for this in the Inform IDE. 17.33 in 6g, "Printing a parser error." This covers many default mesages you'll see, and it really can help the player relax and bring out flavor in your game. It's no substitute for good puzzles, but anything you can do not to upset a player is a good thing.
commented Mar 25 by dw (9 points)
Too dense. Cut to just the last paragraph. Then put the code example at the end so readers can skip it.

## Related questions

- How do I keep testing from becoming boring, for my games or others'?
- How can I change the interface to look like Beyond Zork?
- How do I find the default parser verbs in Inform?
- How do I change 'if the player consents'? pre-Inform 6L or post-
- How do I back up my source file without source control?

...