#Need Help Building Upon Dialogue System

1 messages · Page 1 of 1 (latest)

remote stump
#

Hi, so as the name of the thread suggests I'm trying to build upon a dialogue system (following the guide of CodeGnat here https://www.youtube.com/watch?v=Pue2SNciSgw) but I wanted to build upon this - problem is, I'm not quite sure how to do that. Below is an example of the code I'm working on, just for extra context with details added to help explain my thought process.

    private DialogueSection Conversation()
    {

        //character emotional integers controlled in their own script for sake of clarity.
        int happy = 0;
        int sad = 0;
        int confusion = 0;
        int anger = 0;


        //Speaker's name
        string localName = "Tester One";



        //Final dialogue option appears
        Monologue j = new Monologue(localName, "Thank you for taking your time to look over this project.");

        //Another example of choices and their results this time with fewer options
        Monologue h_one = new Monologue(localName, "This displays if you picked the first option.", j);
        Monologue h_two = new Monologue(localName, "This displays if you picked the second option.", j);

        Choices g = new Choices(localName, "Here is an example where the player has less than 4 choices - in this case, 2.", ChoiceList(Choice("This is choice one,", h_one), Choice("and choice two.", h_two)));

        //Integer-dependent dialogue option displayed next
        Monologue f_one = new Monologue(localName, "This displays if you picked the first option. If I wanted to branch these out from here it would be simple, but for this demonstration.", g);
        Monologue f_two = new Monologue(localName, "This displays if you picked the second option.",g);
        Monologue f_three = new Monologue(localName, "Displayed if you chose the third option.", g);
        Monologue f_four = new Monologue(localName, "Shown if the fourth option was chosen.", g);

        //More dialogue
        Monologue e = new Monologue(localName, "The next message will display a different option depending on your previous selected answer.");

        Monologue d = new Monologue(localName, "While it may initially seem like the previous choice didn't matter without the provided context, the point is for a slow but steady built-up of the effects of the player's choices.", e);

        Monologue c = new Monologue(localName, "All four previous choices lead back to here, but each one controls a value hidden to the player that will affect future dialogue.", d);

        //Result of all 4 possible choices
        Monologue b_one = new Monologue(localName, "1> This choice controls a hidden value that increases the 'happiness' integer for the speaker.", c);
        Monologue b_two = new Monologue(localName, "2> This choice controls a hidden value that increases the 'sadness' integer for the speaker.", c);
        Monologue b_three = new Monologue(localName, "3> This choice controls a hidden value that increases the 'confusion' integer for the speaker.", c);
        Monologue b_four = new Monologue(localName, "4> This choice controls a hidden value that increases the 'anger' integer for the speaker.", c);

        //First set of choices the player can make
        Choices b = new Choices(localName, "Here you are presented with your first choice. Please pick one.", ChoiceList(Choice("This is choice one,", b_one), Choice("choice two,", b_two), Choice("the third choice,", b_three), Choice("and the fourth choice.", b_four)));

        //Leads to first choice
        Monologue a = new Monologue(localName, "This is an example of a branching dialogue system in Unity, heavily based and built upon the guide provided by CodeGnat Studios at https://www.youtube.com/watch?v=Pue2SNciSgw.", b);

        //Initiates the first monologue, monologue a
        return a;
    }```

The problem itself should be simple but I'm at a loss - how can I use this system to track values, and change future-

Take a quick peek at the code here: https://github.com/alexzorzella/Branching-Dialogue-Tutorial

Have fun making it look nice! Make sure to add some more features yourself to make it even better.

Covering the entirety of the dialogue system that I use myself would take four or five hours, so I decided to strip my dialogue system to just its dia...

▶ Play video
#

dialogue that is displayed?

elder cairn
#

Highly recommend checking out ink

#

If you can be bothered using an existing tool

#

Solves all your problems and more