Multiple Actors and Conversants in one conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Reznik
Posts: 18
Joined: Sat Apr 24, 2021 9:21 am

Multiple Actors and Conversants in one conversation

Post by Reznik »

Hi, I'm trying to put together a dialogue sequence where multiple actors and conversants are involved, and I'm not sure if I'm missing something or it's just not supported out of the box.

I have the Dialogue Actor scripts for multiple actors on different game objects. When i bring in different characters to speak in the same conversation, it displays portrait and name properly for the characters outside the original conversant set to the conversation, but the other portrait is ALWAYS the original actor set, regardless of what i put in the the node dropdown for actor and conversant.

Example: I have Actors A, B, C in the database and a conversation between A (actor) and B (conversant).
I can bring in C as a conversant with A, but I can't get B and C to show dialogue and portraits properly for a node together (i.e. ignoring A for that node). It will always show A as one of the portraits.

Trying to simulate a group conversation. Thanks!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple Actors and Conversants in one conversation

Post by Tony Li »

Hi,

Is this is the scenario you're describing?
  • Actors A, B, C, and D.
  • Conversation's primary actor and conversant are A & B.
  • A node's actor and conversant are set to C & D.
  • C's portrait appears since C is the speaker. But D's portrait does not appear.
If so, then that's the way the Standard Dialogue UI is currently implemented. It only updates the speaker (i.e., the node's actor).

If you want to also update the portrait of the node's conversant, you can add a script with an OnConversationLine method, or make a subclass of StandardDialogueUI and override the ShowSubtitle method. Either way, get the other subtitle panel (not the one used by the speaker) and set its portrait image. Example:

Code: Select all

void OnConversationLine(Subtitle subtitle)
{
    // (Your logic for determining panels may differ:)
    var ui = DialogueManager.dialogueUI as StandardDialogueUI;
    var otherPanel = subtitle.speakerInfo.isNPC ? ui.conversationUIElements.defaultPCPanel : ui.conversationUIElements.defaultNPCPanel;
    otherPanel.portraitImage.sprite = subtitle.listenerInfo.portrait;
}
Reznik
Posts: 18
Joined: Sat Apr 24, 2021 9:21 am

Re: Multiple Actors and Conversants in one conversation

Post by Reznik »

Code worked like a charm! Thanks.

And just so i understand, if I wanted to implement something where 3-5 portraits are on screen at once for a single node, I'd have to heavily customize things to get that working?
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple Actors and Conversants in one conversation

Post by Tony Li »

Reznik wrote: Sun Apr 25, 2021 10:19 amAnd just so i understand, if I wanted to implement something where 3-5 portraits are on screen at once for a single node, I'd have to heavily customize things to get that working?
Not really. Add 3-5 subtitle panels. (See the VN Template Standard Dialogue UI for an example. It has 3 or 4 subtitle panels.)

Then just kind of repeat the same process in OnConversationLine. You'd want a way to specify which characters to show, maybe using custom fields in your dialogue entry template.

Alternatively, you could write a custom sequencer command such as "ShowPortrait" that you could use in the node's Sequence. In use, it might look something like:

Code: Select all

{{default}}; // Include the Dialogue Manager's Default Sequence
ShowPortrait(Ann, 2); // Show Ann's portrait in subtitle panel 2's portrait image
ShowPortrait(Bob, 3); // Show Bob's portrait in subtitle panel 3's portrait image
ShowPortrait(Carl, 4); // Show Carl's portrait in subtitle panel 4's portrait image
Post Reply