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?

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.
This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...