Hi Tony,
I'm experiencing an issue where the first line of the conversation doesn't trigger the "On Conversation Line End (Subtitle)" event in DialogueSystemEvents. I'm using a script to manage the visibility of my custom Continue Button, specifically for fast-forwarding Bark conversations. It seems that "On Conversation End" is not triggered after the first line, and it gets triggered one extra time after the conversation concludes. Any insights on this? Thanks!
DialogueSystemEvents problem
DialogueSystemEvents problem
Last edited by ds2497 on Sun Dec 24, 2023 11:46 am, edited 1 time in total.
Re: DialogueSystemEvents problem
After investigation, it appears that the variable "_subtitle" in ConversationView is null and is causing the problem. I hope this information helps!
Re: DialogueSystemEvents problem
Hi,
I think you found a bug. Try changing that line to:
I think you found a bug. Try changing that line to:
Code: Select all
if (lastSubtitle != null) NotifyParticipantsOnConversationLineEnd(lastSubtitle)
Re: DialogueSystemEvents problem
Cool! The "On Conversation End" finally got triggered! However, it didn't resolve the second issue. I'm trying to change the text on the continue button from "Continue" to "Finish Conversation" right after the final line of the conversation is played(RefreshContinueButtonText). Currently, it seems that "On Conversation End" is triggered twice when the last line is played. The outcome of my code is that the final line doesn't display "Finish Conversation" when it plays but it does appear when the conversation is over. Any thoughts?Tony Li wrote: ↑Sun Dec 24, 2023 12:02 pm Hi,
I think you found a bug. Try changing that line to:
Code: Select all
if (lastSubtitle != null) NotifyParticipantsOnConversationLineEnd(lastSubtitle)
Re: DialogueSystemEvents problem
Hi,
OnConversationEnd only happens once at the end of the conversation. If you want to get to the bottom of the issue, check that you're not connecting it to more than one UnityEvent.
However, to accomplish what you want, use an OnConversationLine(Subtitle) method to change the continue button's text instead. Example:
OnConversationEnd only happens once at the end of the conversation. If you want to get to the bottom of the issue, check that you're not connecting it to more than one UnityEvent.
However, to accomplish what you want, use an OnConversationLine(Subtitle) method to change the continue button's text instead. Example:
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class ManageContinueButtonLabel : MonoBehaviour
{
public UITextField label; //<-- ASSIGN IN INSPECTOR
public string txtContinue = "Continue";
public string txtEndConversation = "End Conversation";
void OnConversationLine(Subtitle subtitle)
{
label.text = DialogueManager.currentConversationState.hasAnyResponses ? txtContinue : txtEndConversation;
}
}
Re: DialogueSystemEvents problem
Thanks for the help, Tony!
Wish you Merry Christmas!
Wish you Merry Christmas!
Re: DialogueSystemEvents problem
Glad to help! Merry Christmas!