What is the difference between verbs and commands?

MerryCo
19 Jan 2007, 13:01
I really don't see the difference between the two, other than it may be easier to set up synonyms for the same action using verbs.

Alex
19 Jan 2007, 15:57
Both commands and verbs allow you to process player input. They work in different ways:

Verbs let you set up specific things that can be done to specific objects. They let you quickly make a book readable for example - just select the book, and create a "read" verb for it.

When you do this, Quest will automatically handle a lot of things sensibly. For example:

read book
read the book
read boo
read bo

will all work.

Also "read table", "read sofa", "read zebra" will all respond in the way you would expect - either "I can't see that" or "You can't read it".

So, verbs let you quickly set up a way for things to be done to something particular. Now, you could do the same thing with a command, but you would have to set up a script for the command which would be a bit more complicated.

Why use a command ever then? Well:

- sometimes you will want to handle some input that doesn't refer to an object, like "say hello"
- sometimes you'll want to handle some input that's a bit more complicated, like "insert coin into slot", "dial 1234 on keypad" etc.
- sometimes you'll only want to write one script, which will handle doing something to any object. Remember when you set up "read book", whatever you type is only going to happen when the player reads the book, and not anything else in the game. For example, if you wanted reading anything to move the player to a room called "World of Literature", you could create one command to do that. Although you would be rather odd.

For these you'll need to use a command instead of a verb.

To summarise, verbs provide a lot of handy automatic behaviour for when you want the player to type "verb object". For anything else, use a command instead.

See page 16 of the tutorial for an introduction to verbs. See page 30 for information on commands.