Setting Continue Button to Always loops conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
muttsang
Posts: 6
Joined: Sat Nov 11, 2023 10:26 am

Setting Continue Button to Always loops conversation

Post by muttsang »

Hello,

I've got a bit of a confusing situation. I want the continue button to be always available to the player, so I've set the "Continue Button" option to "Always" on the Dialogue Manager game object's Dialogue System Controller component.

The problem is that when there is a conversation which ends with the NPC having the last dialogue, the entire conversation re-starts and loops. This does not happen in two conditions; When the last dialogue in the conversation is said by the player or if the "Continue Button" option to either "Never" or "Optional".

I have also made sure to have the Dialogue Actor component in both the player and the NPC as well and have assigned the conversation actor and the conversation conversant properties for the Dialogue System Trigger component on both the Player and NPC are also properly set up.

I am not sure what is going on, any help on this would be greatly appreciated!

Thank you!
Attachments
ConversationEndingWithNPCDialogue.png
ConversationEndingWithNPCDialogue.png (27.74 KiB) Viewed 451 times
DialogueManager_ContinueButton_Always.png
DialogueManager_ContinueButton_Always.png (70.15 KiB) Viewed 451 times
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Setting Continue Button to Always loops conversation

Post by Tony Li »

Hi,

I suspect what's happening is that the click (or other input) to click the final continue button is also being read to trigger whatever starts the conversation. If you're using a Dialogue System Trigger to start the conversation, you can usually prevent it by ticking the Prevent Restart On Same Frame Ended checkbox.

Here's an example scene with Continue Button set to Always that doesn't repeat. It starts the conversation OnStart.

DS_TestContinueAlwaysEndOnNPC_2024-05-20.unitypackage
muttsang
Posts: 6
Joined: Sat Nov 11, 2023 10:26 am

Re: Setting Continue Button to Always loops conversation

Post by muttsang »

thank you so much Tony!

That was it! ticking the Prevent Restart On Same Frame Ended checkbox on the Dialogue System Trigger fixed the issue!

Thank you so much for taking the time to create a new unity package as well to show a sample!
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Setting Continue Button to Always loops conversation

Post by Tony Li »

Glad to help!
Hereder
Posts: 76
Joined: Mon Dec 21, 2020 2:53 am

Re: Setting Continue Button to Always loops conversation

Post by Hereder »

Tony Li wrote: Mon May 20, 2024 8:44 pm Hi,

I suspect what's happening is that the click (or other input) to click the final continue button is also being read to trigger whatever starts the conversation. If you're using a Dialogue System Trigger to start the conversation, you can usually prevent it by ticking the Prevent Restart On Same Frame Ended checkbox.

Here's an example scene with Continue Button set to Always that doesn't repeat. It starts the conversation OnStart.

DS_TestContinueAlwaysEndOnNPC_2024-05-20.unitypackage

if im not using a Dialouge System Trigger , how can I prevent the conversation to restart itself?
It seem to restart even BEFORE i can read the last sentence.
Anywa ideà?
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: Setting Continue Button to Always loops conversation

Post by Tony Li »

Hi,

How are you starting the conversation? If you're starting it from C#, you could do something like this:

1. Add a script to the Dialogue Manager that records the frame on which the conversation ended:

Code: Select all

public class ConversationMonitor : MonoBehaviour
{
    public static int FrameLastConversationEnded {get; private set;}    
    void OnConversationEnd(Transform actor) { FrameLastConversationEnded = Time.frameCount; }
}
2. Before calling DialogueManager.StartConversation(), check it:

Code: Select all

if (Time.frameCount == ConversationMonitor.FrameLastConversationEnded)
{
    Debug.Log("Not starting conversation. Another conversation just ended on this frame.");
}
else
{
    DialogueManager.StartConversation("title");
}
Hereder
Posts: 76
Joined: Mon Dec 21, 2020 2:53 am

Re: Setting Continue Button to Always loops conversation

Post by Hereder »

I did via script. Thanks for ponintng me in the right direction!
I got it to work!

Ah, but... Sometimes when I talk with NPCs, and going through a quite complicated dialouge, I feel like they skip stuff or stop to early on. Is that a thing? Or maybe I had some conditions that were not met and I thought it quit to soon.
Post Reply