Difference between revisions of "The command parser"
(him & her) |
m |
||
Line 88: | Line 88: | ||
<FONT COLOR=#19A58A> | <FONT COLOR=#19A58A> | ||
The egyptians used to wrap these inside mummy's for protection.</FONT> | The egyptians used to wrap these inside mummy's for protection.</FONT> | ||
− | </td><td> When a command refers to a specific object, ADRIFT stores a reference to that object and the | + | </td><td> When a command refers to a specific object, ADRIFT stores a reference to that object and the next time the player uses the word "it", it is replaced with the name of that object. |
− | next time the player uses the word "it", it is replaced with the name of that object. | + | |
</td></table> | </td></table> | ||
==== THEM ==== | ==== THEM ==== | ||
Line 116: | Line 115: | ||
<FONT COLOR=#19A58A> | <FONT COLOR=#19A58A> | ||
The pirate bites the coin to make sure its real, smiles at you, then saunters off.</FONT> | The pirate bites the coin to make sure its real, smiles at you, then saunters off.</FONT> | ||
− | </td><td> When a command refers to a specific male character, ADRIFT stores a reference to that character and the | + | </td><td> When a command refers to a specific male character, ADRIFT stores a reference to that character and the next time the player uses the word "him", ADRIFT uses the name of that character. |
− | next time the player uses the word "him", ADRIFT uses the name of that character. | + | |
</td></table> | </td></table> | ||
==== HER ==== | ==== HER ==== | ||
Line 131: | Line 129: | ||
<FONT COLOR=#19A58A> | <FONT COLOR=#19A58A> | ||
"This is for you" she says, handing it to you.</FONT> | "This is for you" she says, handing it to you.</FONT> | ||
− | </td><td> When a command refers to a specific female character, ADRIFT stores a reference to that character and the | + | </td><td> When a command refers to a specific female character, ADRIFT stores a reference to that character and the next time the player uses the word "her", ADRIFT uses the name of that character. |
− | next time the player uses the word "her", ADRIFT uses the name of that character. | + | |
</td></table> | </td></table> |
Revision as of 09:04, 29 September 2012
When the player enters a new command, the words that they type are interpreted by a special program called a "Parser". The parser
Contents
One word commands
The simplest commands consist of a single noun. In the standard library this is only used for the most common commands such as moving in a particular direction or looking at your inventory, but you can add more of your own if you wish. As this is usually done to save typing for commands that the player is using regularly, these commands usually have a one or two character abreviation to simplify them even further.
> i |
"i" is the abreviation for inventory, and lists everything the players character is wearing and carrying. |
> ne |
"ne" is the abreviation for walking to the northeast. If it is not possible to go in that direction then ADRIFT will tell the player which directions they can move towards, from their current location. |
Verb+Noun commands
A verb followed by a noun is the most common type of command in interactive fiction.
Special parser key-words
The following keywords are directly decoded by the parser to allow more complex commands to be entered than has been defined in the general tasks.
This allows for more natural commands to be entered, and enables the player to manipulate multiple objects with a single command.
ALL
The ALL keyword can be used anywhere an %object% reference appears in a command. It causes the tasks actions to be executed for every object that would pass the tasks restrictions. The output message of the task is then printed, using a list of those objects where it would normally print the name of a single object.
> get all |
get all will get every object in the current location that the player is allowed to take. |
> drop all |
drop all will drop everything in the players inventory. |
AND
The AND keyword lets the player specify several items at once.
> get flowers and mat |
Using AND you can perform the same command on two objects at once. |
> get scarab, flowers and mat |
For more than two objects, separate them with comma's. |
EXCEPT
The EXCEPT keyword is usually used with ALL to exclude one or two objects from a large group.
> get all except flowers and mat |
Player gets everything except the objects he excludes. |
IT
> get scarab | When a command refers to a specific object, ADRIFT stores a reference to that object and the next time the player uses the word "it", it is replaced with the name of that object. |
THEM
> get chopsticks | When a command refers to an object that has been defined with the article "some", ADRIFT stores a reference to that object and the next time the player uses the word "them", it is replaced with the name of that object. Note that the "it" and "them" objects are stored separately and will not refer to the same object. |
HIM
> x pirate | When a command refers to a specific male character, ADRIFT stores a reference to that character and the next time the player uses the word "him", ADRIFT uses the name of that character. |
HER
> x famous author | When a command refers to a specific female character, ADRIFT stores a reference to that character and the next time the player uses the word "her", ADRIFT uses the name of that character. |