How To: Text Entry Instead of Response Menus
Posted: Tue Feb 11, 2020 7:17 pm
In this example scene, the player can type sentences instead of choosing from a menu of response buttons:
DS_TypedKeywordsExample_2020-02-11.unitypackage
It uses a custom subclass of StandardDialogueUI. The Menu Text of each response node contains a list of keywords separated by space characters. When the player enters text, it tries to match the player's input with one of the responses.
The script is documented, and there are editor comments on the dialogue UI and the new Response Input Panel inside the dialogue UI.
The script has a method named WordListsCompare(). Currently it checks of the player's word list contains all of the words in the response's word list. You could customize this method to do other things, too, such as accepting optional words or synonyms such as "killed" or "murdered" for a murder mystery instead of just "killed".
DS_TypedKeywordsExample_2020-02-11.unitypackage
It uses a custom subclass of StandardDialogueUI. The Menu Text of each response node contains a list of keywords separated by space characters. When the player enters text, it tries to match the player's input with one of the responses.
The script is documented, and there are editor comments on the dialogue UI and the new Response Input Panel inside the dialogue UI.
The script has a method named WordListsCompare(). Currently it checks of the player's word list contains all of the words in the response's word list. You could customize this method to do other things, too, such as accepting optional words or synonyms such as "killed" or "murdered" for a murder mystery instead of just "killed".