Quick overview:
1. Create GUI
2. Put TextBox on GUI
3. Put 'Enter' button on GUI
4. Make GUI pop-up modal if you want to pause the game while it's on
If user clicks on 'Enter', use ParseText() with the text from your Textbox (put it in a string with .GetText() and ParseText that string). Now you can use Said() to check if the user entered a word from the dictionary:
if (Said("look at door")) {cEgo.Say("There is no door in this room.");}
Synonyms are easy - if you add a synonym to a present word in the word list (like adding synonym 'look' to word 'examine'), the player can enter both and get the same result:
If the player's entered 'look at door' or 'examine door' and you do if (Said("look at door")), the 'examine door' text will trigger the same action.
EXAMPLE GAME: http://www.origamihero.com/files/parserex.zip
Really basic, but shows how to implement a simple parser. Call it by pressing space. You can hit the button or press enter to accept after typing your commands. It also shows how to make standard replies.
1. Create GUI
2. Put TextBox on GUI
3. Put 'Enter' button on GUI
4. Make GUI pop-up modal if you want to pause the game while it's on
If user clicks on 'Enter', use ParseText() with the text from your Textbox (put it in a string with .GetText() and ParseText that string). Now you can use Said() to check if the user entered a word from the dictionary:
if (Said("look at door")) {cEgo.Say("There is no door in this room.");}
Synonyms are easy - if you add a synonym to a present word in the word list (like adding synonym 'look' to word 'examine'), the player can enter both and get the same result:
If the player's entered 'look at door' or 'examine door' and you do if (Said("look at door")), the 'examine door' text will trigger the same action.
EXAMPLE GAME: http://www.origamihero.com/files/parserex.zip
Really basic, but shows how to implement a simple parser. Call it by pressing space. You can hit the button or press enter to accept after typing your commands. It also shows how to make standard replies.