For example, you set up your Dialog structure like usual:
NPC: "Hello there!"
You:
a) "Hi"
b) "Leave me alone"
c) "Goodbye"
d) [Invalid]
Instead of selecting one of the three options (a, b, c), you're prompted with an input text box. If you type the exact string in a, b or c, it will initiate the dialog branch exactly as intended. If your inputted string does not match any of those three, it activates the fourth branch (d).
So it goes:
NPC: "Hello there!"
You: [Input text box]
If [Input text box String] = String of Option A
then
Start next dialog branch for Option A
If [Input text box String] = String of Option B
then
Start next dialog branch for Option B
If [Input text box String] = String of Option C
then
Start next dialog branch for Option C
If [Input text box String] ≠ String of Option A, B, or C
then
Start next dialog branch for Option D
Thanks!
Comments
First, you'd have to make your Conversation menu non-interactive by checking "Ignore cursor clicks" in it's properties box. Then create a new Input box menu (follow this tutorial) and have it appear at the same time as your conversation begins.
You'll then have to create an actionlist / cutscene that reads the entered value, and checks it against each dialogue option.
Hi there,
I hope this is the right place to ask for help on this topic, despite it being from 2015.
I'm trying to do something similar. But I have a conversation going and the NPC asks the player to name their dog. I want this name to be stored in a global varible so the name can be referenced at some later conversation.
How do I do this mid dialogue and then return to the next part of the conversation.
i.e Here's your new dog sir, what will you name him?
~(input name)
Hey that's a great name.
I've managed to create an input box using the tutorial before but that was when I was creating a whole menu for the player to enter their name and that needed a button to confirm the name. Is there a way other than this (like hitting enter on a keyboard to register the name)
I hope this makes sense, any help/advice would be greatly appreciated.
Thanks
You can avoid the need to have a "Confirm" button be shown, but it will need to be defined in your Menu.
The Input element has a 'Enter' key's linked Button that, when set to another Button element in the same Menu, will invoke that Button's click behaviour when the user presses enter. This Button element can be made invisible, and then used to close the Menu / update the Global variable etc.
To return to the next part of the Conversation, use the ActionList: Run Action to reference the Conversation's ActionList, and then uncheck Run from start? so that you can specify the Action to start from.
Sorry it took so long to get back to you.
Thanks very much Chris this worked like a charm once I realised I needed the new menu to pause gameplay