Ongoing conversation lines during response - Telltale style

Announcements, support questions, and discussion for the Dialogue System.
8uddie
Posts: 12
Joined: Sun Sep 02, 2018 9:40 am

Ongoing conversation lines during response - Telltale style

Post by 8uddie »

Hi! If may i ask,

Is there an easy approach for NPC to keep continue their conversation Nodes.
Until Responses is chosen and also cut it right off to proceed with the chosen node lines.

kind of like 'Telltale' style decision dialogue where the NPC character delivers lines while you choosing decision

Thank you so much.
Last edited by 8uddie on Tue Sep 04, 2018 10:22 am, edited 2 times in total.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ongoing Bark-like conversation lines during response - Telltale style

Post by Tony Li »

Hi,

The Extras page has a Telltale-style example (direct link). It uses Response Menu Sequences to keep things going while the response menu is displayed.
8uddie
Posts: 12
Joined: Sun Sep 02, 2018 9:40 am

Re: Ongoing Bark-like conversation lines during response - Telltale style

Post by 8uddie »

Thank you. I understood the Response Menu Sequence is exactly what i'm looking for to achieve this.
But How do I set sequence-command during the Response Menu to let the another NPC line node continue ?

I did look over to the GoT example scene. they provide the example for switching cam and panning before response is chosen on their Response Menu Sequence but not the on-going conversation lines.

---

Also, another question that i'm confusing about is How do I override conversation if there's one on.

example. :
I want have a scene where the NPC speaking lines while the player can interrupt anytime with a question then the player's following response node can override the NPC's one ? ( and if there any chance the NPC line will be continued after the player's conversation node is end ? )
Last edited by 8uddie on Tue Sep 04, 2018 10:25 am, edited 1 time in total.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ongoing Bark-like conversation lines during response - Telltale style

Post by Tony Li »

Hi,

To allow more NPC lines to continue while showing the response menu, you'll need to do a little scripting. Another Dialogue System user, EternalAmbiguity, did something similar. It allows him to add and remove items from the response menu any time while the conversation is running through NPC nodes, and each response has a timer before it disappears. It's probably much more elaborate than what you need, but you can get it here if you're interested: Unity forum thread.

To do what you described, it's simpler than his example. Create a subclass of StandardDialogueUI. Override HideResponses() and ShowSubtitle(). Something like:

Code: Select all

public class MyDialogueUI : StandardDialogueUI 
{
    public override void HideResponses() {} // Don't hide menu.
    
    public override void ShowSubtitle(Subtitle subtitle)
    {
        if (subtitle.speakerInfo.isPlayer) base.HideResponses(); // Player chose a response. Hide menu.
        base.ShowSubtitle(subtitle);
    }
}
This will keep the response menu visible until the player chooses a response -- or until the timer runs out, if you've set a timeout value. You could add a custom tag to your Dialogue Text if you want to manually hide the menu. For example, let's say you call the tag "[closeMenu]". You could expand ShowSubtitle like this:

Code: Select all

public override void ShowSubtitle(Subtitle subtitle)
{
    bool closeMenu = subtitle.formattedText.text.Contains("[closeMenu]");
    subtitle.formattedText.text = subtitle.formattedText.text.Replace("[closeMenu]", string.Empty);    
    if (closeMenu || subtitle.speakerInfo.isPlayer) base.HideResponses();
    base.ShowSubtitle(subtitle);
}
When the player chooses a response from the menu, it will interrupt the NPC's line.
8uddie
Posts: 12
Joined: Sun Sep 02, 2018 9:40 am

Re: Ongoing conversation lines during response - Telltale style

Post by 8uddie »

Thank you so much for your reply,Tony
I'm sorry if my question is ameateur or I'm missing something..

But I'm still confused on how to set up conversation to keep going with both response menu and NPC line ? The DialogueSystem seem to choose continuing the NPC than the player node and without trigger the response menu in the same link.

I did create a subclass on your code HideResponses() and ShowSubtitle(). But without it shows the response menu while NPC node playing or shows the other around ,it isn't doing anything.

I also tired to trigger the response menu by using another conversation. and sequence 'SendMessage' to call it up ,hoping they will trigger responseUI menu while the NPC node playing. As far i know, The DialogueSystem prevent another conversation to be active. or if there a way to override the active conversation with another ?
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ongoing conversation lines during response - Telltale style

Post by Tony Li »

Hi!

I'm out of the office for several hours. When I get back, I'll put together an example and post it here.

It's possible to run simultaneous conversations (tick the checkbox on the Dialogue Manager), but to interrupt a conversation with another you will need to manually stop the first conversation.

Anyway, I think the example should make things clearer.
8uddie
Posts: 12
Joined: Sun Sep 02, 2018 9:40 am

Re: Ongoing conversation lines during response - Telltale style

Post by 8uddie »

Thank you

also I'm not sure if i convey what i tired to achieve right :
I want to create realistic conversation scene.
'While the Response menu is up and The NPC playing nodes reacting on how long the decision take.And another where player can trigger to prompt the response menu anytime (as a ask).
While NPC will react to this ask after play their last node from their ongoing interupted conversation.'

I also have tried to create var condition 'isAnswered' setting to every NPC node to force them to end if the response was chosen to set script to true.
but as i mention, I cant figure how to play out both node.

And, thank you again i look forward to see your solution
Last edited by 8uddie on Tue Sep 04, 2018 4:18 pm, edited 1 time in total.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ongoing conversation lines during response - Telltale style

Post by Tony Li »

The example will just play multiple NPC nodes while the response menu is visible. We can expand it from there once you see how it works.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ongoing conversation lines during response - Telltale style

Post by Tony Li »

Hi,

Here's an example:

AnotherTelltaleStyleExample_2018-09-05.unitypackage

I intentionally kept it very simple, especially the script, to make it easier to understand. This is the conversation:

Image

When the NPC lines are playing (NPC line 1, 2, 3, etc.), the response menu stays visible. If the player clicks a response menu button, the conversation will jump to it.

This is the script:

CustomDialogueUI.cs
Spoiler

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;

public class CustomDialogueUI : StandardDialogueUI
{

    public override void ShowSubtitle(Subtitle subtitle)
    {
        // Show the subtitle:
        conversationUIElements.standardSubtitleControls.ShowSubtitle(subtitle);

        // If the player is speaking, hide the response menu:
        if (subtitle.speakerInfo.isPlayer) base.HideResponses();

        // If there are response menu items, show the response menu:
        if (DialogueManager.currentConversationState.pcResponses.Length >= 2)
        {
            ShowResponses(subtitle, DialogueManager.currentConversationState.pcResponses, 
                DialogueManager.displaySettings.inputSettings.responseTimeout);
        }
    }

    public override void HideResponses() { } // Don't hide the response menu.
}
To assign it to the dialogue UI, I switched the Inspector to debug mode. Then I dragged CustomDialogueUI.cs into the dialogue UI's Script slot, replacing StandardDialogueUI.

Once you've confirmed that this is the kind of behavior you're looking for, let me know if you have questions about adding any of the other things you mentioned.
8uddie
Posts: 12
Joined: Sun Sep 02, 2018 9:40 am

Re: Ongoing conversation lines during response - Telltale style

Post by 8uddie »

It's working like a charm! now. Thank you!

The next thing i want to achieve is How do I manually trigger Hide and Show to a specific ResponseMenu via the UnityEvent and Sequence command.

Scenario :

1. To have one of the response node (maybe sequence/Lua) hide the ResponseMenu without end the conversation
and,then In the scene would have a ButtonUI that could trigger UnityEvent to show the ResponseMenu up again.

Which also have me at another scenario

2. Could I have ButtonUI in the scene that will pop up to let the player prompt the ResponseMenu themselves to begin with ? almost like QTE but with choices.

which if the 1. is achievable then i would guess this also could work too and maybe could use a Tag to determine which ResponseMenu show up and which group nodes will be hidden and prompt the ButtonUI instead.

---

I did experiment linking from an ongoing node to a player choice conversation.It didn't play. Another linking to two conversations both a npc and a player one. the ResponseMenu turn blank with no choice but the NPC Node convo is playing. ( Is this means that i will have to only linking node in the same conversation to achieve the ResponseMenu showing ?)
Post Reply