textadventures / quest

Create text adventure games
http://textadventures.co.uk/quest
MIT License
304 stars 69 forks source link

More options for error handling #1053

Closed ThePix closed 6 years ago

ThePix commented 6 years ago

If we insert

else if (HasScript(game.pov.currentcommandpattern, "unresolved")) {
  do (game.pov.currentcommandpattern, "unresolved", QuickParams("object", unresolvedobject, "key", unresolvedkey))
}

... in to UnresolvedCommand, we can run a script when a command fails to match an object. This would allow the command to give a better response than "I can't see that. (north)" when the player types PUSH CRATE NORTH, for example saying that there is no exit that way.

Ideally CoreEditorCommand will be updated, as well as any editor languages.

ThePix commented 6 years ago

Done