ParseText (string text)Stores the supplied user text string for later use by Said. You need to call this command first with the user's input before using the Said command. You probably want to call this inside the interface_click function when your text box control is activated.
Example:
string command; txtParser.GetText(command); ParseText(command);will get the players input and store it in string "command" for use with the said command.
See Also: Said
Said (string text)Checks whether the player typed in TEXT in their input passed to ParseText. Returns 1 if it matches, 0 otherwise.
See the text parser documentation for a more detailed description.
Example:
string input; txtParserInput.GetText(input); ParseText(input); if (Said("load")) { txtParserInput.SetText(""); RestoreGameDialog(); }will bring up the restore game dialogue if the player types "load" in the text parser.
See Also: ParseText, SaidUnknownWord
SaidUnknownWord (string buffer)If a word not in the game dictionary was submitted to the last ParseText call, then BUFFER is filled with the word. This allows you to display a message like "Sorry, this game doesn't recognise 'XXXX'."
Returns 1 if the player typed an unknown word, or 0 if all words were recognised.
Example:
string buffer; if (SaidUnknownWord (buffer)) Display("You can't use '%s' in this game.", buffer);will display the message if the player types a word that’s not in the vocabulary.
Browser Based Help. Published by chm2web software. |