Page 1 of 1

Many characters in one dialogue

Posted: Sat Feb 10, 2024 7:05 am
by SilverMoon17
Is there any way to create a dialogue with 3 or more characters using the Dialogue System for Unity? I tried to do this using variables and barks. But I don't know how to control when bark ends. Here's what I tried

Code: Select all

public void SayTimeToSleep(Action OnComplete = null)
    {
        DialogueLua.SetVariable("TimeToSleep", true);
        
        StartCoroutine(CheckBarkConditions());

        IEnumerator CheckBarkConditions()
        {
            while (DialogueManager.IsConversationActive && DialogueManager.CurrentActor == this.transform)
            {
                yield return null;
            }
            
            OnComplete?.Invoke();
        }
    }
This doesn't work either, I tried

Code: Select all

public void OnBarkEnd(Transform actor){}
But it is called too early, almost immediately after bark starts. Is there some way to make a small dialogue between 3 and more characters?

Re: Many characters in one dialogue

Posted: Sat Feb 10, 2024 8:37 am
by Tony Li
Hi,

If a dialogue exchange involves more than one dialogue entry, use a conversation instead of a bark.

You can assign two main characters to the conversation's Actor and Conversant:

multiple1.png
multiple1.png (7.13 KiB) Viewed 133 times

And then assign other characters to individual dialogue entries:

multiple2.png
multiple2.png (14.06 KiB) Viewed 133 times

See also: Character GameObject Assignments

Re: Many characters in one dialogue

Posted: Sat Feb 10, 2024 8:51 am
by SilverMoon17
How can I then change the conversation for the actors or how can I organize it all correctly?

Re: Many characters in one dialogue

Posted: Sat Feb 10, 2024 9:27 am
by Tony Li
Hi,

I'm not sure what you mean. Can you give a specific example, even if it's just hypothetical?