(Dialogue tree) How to: end dialogue with user input, not a timer

Hi. This is too short to be a tutorial, but it will teach you how to make the dialogue wait for user input at the end of a dialogue with a method I found by experimentation.

What I was trying to accomplish: In most RPGs (at least all I’ve played), when you talk to a NPC, the player presses a button to advance the dialogue. The Dialogue Tree extension works somewhat like this, except for the last line in the dialogue. In the Dialogue Tree/Yarn example, for example, the NPCs end their dialogues after a set amount of time without user input. While this may be the desired effect for some, I wanted it to be like the RPGs I played: let the user end the dialogue after they want to, i. e., after they’ve read it, in most cases.

I found no tutorial online that taught this the way I’ll explain here, but testing things out I found out how to do this easily.

How to do it: there seems to be a default <<command>> called <<wait>>. It is used through out the example, but it can also be added at the end of a branch to allow the player to end the dialogue when he feels like it, like so:

command

This way there’s no need for adding an empty end node (which doesn’t work, by the way), and you can always use it anywhere, any time, so long you want the user to have a say in when he closes the dialogue with a NPC, instead of relying on a timer.

Hope this was useful for your projects, current and future, and thanks for reading!

4 Likes