I'm afraid I have another question about the text parser. Here's the code I have for a say command:
function InputBox_OnActivate (GUIControl *control)
{
Parser.ParseText(InputBox.Text);
String saycommand = InputBox.Text; //The string I'm using to store the command temporarily is saycommand.
if (Parser.Said("say rol")) Display("You say aloud: \"\%s\"\.", saycommand);
This works fine, however, since the player types in "say something" the say also appears in the display, so it ends up like this:
You say aloud: "say something".
Is there a way to extract the word 'say' from my saycommand string, so it's just left with whatever the player typed after it? I'd be really grateful for any solutions.
saycommand = saycommand.Substring(4, saycommand.Length-4);
Thank you Khris, I've also extended it to extract synonym words for say too, so it's pretty cool.