Hi, quick code question.
I'm trying to make a game with a text parser and I was wondering if it was possible to ignore words that the user inputs that are not in the word group? basically I want something that takes an unknown word and sets it's word group number to 0.
here's the pseudo-code
if (Parser.SaidUnknownWord()) {
UnknownWord = 0;
}
Something like that
Bascally if someone types "look at carpet" and there is no word for carpet the get the message:
"there's not much to see"
instead of:
"Please use another word for carpet"
Thanks for your help
I'm not sure if I quite understand what you're trying to do, but could you do a Replace on the input string to replace the unknown word with a blank string, and then run it through ParseText again?
This is probably not of interest to you, but I put together a simple module to allow more natural dialogue through the text parser. A thread about it is here (http://www.adventuregamestudio.co.uk/yabb/index.php?msg=414612;topic=32129.0;sesc=b61032cb448c670ec36d66099cb3b4ac)
It ignores everything except keywords and the presence of more than one keyword. It can also use a chatterbot trick of returning the user's input to them to simulate a broader vocabulary.
There's a simple demo, here (http://www.filefront.com/15731565/Dialogue_Parser_Demo.zip). However, it would need a lot more dialogue writing to make a convincing character, and this only has a very limited set of responses.
EDIT: Thanks magintz!
Quote from: Ali on Wed 03/03/2010 18:14:03
This is probably not of interest to you, but I put together a simple module to allow more natural dialogue through the text parser. A thread about it is here (http://www.adventuregamestudio.co.uk/yabb/index.php?action=post;msg=414612;topic=32129.0;sesc=b61032cb448c670ec36d66099cb3b4ac)
I kept getting errors visiting that link but I assume you're referring to the Conversation Simulation Module (http://www.adventuregamestudio.co.uk/yabb/index.php?msg=414612;topic=32129.0;sesc=b61032cb448c670ec36d66099cb3b4ac) if anyone has similar problems with the clicky-clicky :)
Hey, got it sorted. I was using a text parser tutorial I found in the forums and it had alot more functionality than I wanted.
I just removed the line:
else if (Parser.SaidUnknownWord()) {
Display("Please use another word for '%s'.", Parser.SaidUnknownWord());
}
Thanks for the help anyway