- Home /
How do you guys code dialogue?
I'm thinking of making a single method/class/something that will handle my dialogue in the game. AKA, something like:
Main text:
Choice 1 Choice 2
So I want a method that will able to put different strings into the main text section and also different strings into the Choice options. I've been thinking about solutions, and so far I've come up with just a simple method that accepts parameters for main text, choice1 and choice2 -- problem being that the strings called will be quite long and I think it looks a little clumsy? Also I won't want to have 2 choices every time, OR I want to have multiple "pages" of dialogue show up before you need to take an action. This would require me to overload methods which may turn out quite ugly?
So yeah I don't have a lot of experience with this and method overloading is all I've thought about for now. I've given thought to interfaces/abstract classes but I'm not entirely sure if they're even relevant for what I want to do. Any thoughts?
Answer by tanoshimi · May 27, 2015 at 07:00 PM
I think what I want is too simple to justify not doing it myself. I literally want to have something like one page of dialogue, with two choices, then two pages of dialogue that show depending on what choice you picked.
Your answer
![](https://koobas.hobune.stream/wayback/20220613200330im_/https://answers.unity.com/themes/thub/images/avi.jpg)