Approaches by Emily Short

If the played types “GO TO (unvisited room)” the response is “That noun did not make sense in this context.”

Is it possible to change this response to either “You haven’t visited that room yet.” or “That’s not a room.” as appropriate? None of the rooms is a secret. I just don’t like the standard parser response much.

Thanks.

The Riverside Path example in Approaches’ docs addresses how you would simply allow ‘go to’ to work for unvisited rooms.

Understand "go to [any room]" or "go back to [any room]" or "return to [any room]" or "revisit [any room]" as approaching.
The new approach heading finding rule is listed instead of the approach-heading selection rule in the approach-finding rules.     
This is the new approach heading finding rule:      
    now approach-heading is the best route from the location to the noun.

For sensible handling of unvisited rooms and nonsense, this is an approach…

Understand "go to [any room]" or "go back to [any room]" or "return to [any room]" or "revisit [any room]" as approaching.

Understand "go to [something]" or "go back to [something]" or "return to [something]" or "revisit [something]" as a mistake ("You can't go to that!").

[ previous, worse idea:
Understand "go to [something]" or "go back to [something]" or "return to [something]" or "revisit [something]" as thing-approaching.
Thing-approaching is an action applying to one thing.
Instead of thing-approaching, say "You can't go to that!" ]

Rule for printing a parser error when the latest parser error is the noun did not make sense in that context error:
  if the player's command matches the regular expression "^(go\s+to|go\s+back\s+to|return\s+to|revisit)\s+", say "There's no such place.";
  otherwise say "That noun did not make sense in this context."

Check approaching an unvisited room:
  say "You haven't been there and aren't sure of the way." instead.

After deciding the scope of the player when approaching an unvisited room:
  repeat with unvisited-room running through unvisited rooms begin;
    place unvisited-room in scope;
  end repeat.

The thing-approaching part is so that if the player tries to go to a noun that is in scope but isn’t a room they get “You can’t go to that” instead of “There’s no such place.” And if you have any enterable containers, there would be more cases you’d probably want to handle…

[edited: better than adding a bogus thing-approaching action, we can just understand it as a mistake]

1 Like