- Home /
Modifying Brackeys' dialogue system for questions/different dialogue "paths"?
Hello! I followed this tutorial: https://www.youtube.com/watch?v=_nRzoTzeyxU
And have made my own modifications to it (But none that necessarily change it majorly from the tutorial itself, it functions roughly the same.)
But I'm stuck on trying to figure out how to implement a way to add the ability to answer yes or no to certain dialogue.
I've brainstormed several things but can't.... quite "get it" in a sense.
Adding a mark for when a dialogue contains a question, and then locking the camera but unlocking the mouse so the player can click yes or no, or use Y or N to answer in some way. The shortcoming with this is how would I make it display the proper dialogue for the yes or no answer, and more than one sentence and whatnot.
Doing the above, but having UI buttons popup and when clicked uses DialogueTrigger again to display its respective question answer. The issue with this is how would I let it know which dialogue to trigger based on character or even object.
doing something complex like adding the question answers to the same dialoguetrigger, but have it jump to a specific sentence and continue from there. This seems like the possibly best and easiest option, but I'm unsure of how I'd implement this, and jump to certain parts of the sentence queue. I can think of ways to block dialogue 2 (the question, in this scenario) from continuing to 3 if 3 is for something else by simply using a boolean to say if the question was answered, but thats its own giant mess too...
Answer by hectorux · Nov 07, 2018 at 11:11 PM
When i started a Visual Novel, i make a system of marks, a # would mean to create X buttons with a custom int, meaning the answers(to split meaning i used | too). I have the code, but it is in spanish
Sounds promising, could you break it down a bit more? IE, how did you implement the dialogue, how did you create the buttons and answers, etc, and so on?
sure, first i realized that a switch was a bad idea, ins$$anonymous$$d of that i made a TextAsset with the dialogue separate them by a sign like #Anna@FFFF(this is the color for the name)|Hi, my name is Anna #You@FAFAFA|Hi, how are you? something like this to start. I first made an arary with all the text split by # and then use the other sign to separate the other functions i neede, such the color i set. Then, when i wanted a decision, i made a system that called for other conversation TextAsset. I make a symbol for the decision, and also passed information. For that i instantiate a button for choice, and give a string that store the information that i wanted to pass. Ex:
{(this means a selection choice)Pero si se está muy bien a la sombra…|0(this is the int value i passed for int)
Tu siempre tan fuerte, Cérea|1 @Venga ya, ¡si llevamos días viajando!|2
then, i set the answers and the next converastion i ahve to implement based on a string+int.tostring()
}(this means select the answer by the posiotion in the int)Cérea|0FF@...Qué remedio
Cérea|0FF@[...] }Cérea|0FF@Vale, vale... relájate, pararemos un poco
Ask me your doubts about this ;)
Ah so if I get this right, you basically set the dialogue to have kind of an... "ID", the int in this case, and then pulled the dialogue depending on what int?