Page 1 of 1

Start a conversation but lost its text

Posted: Mon Jun 03, 2024 6:01 am
by cozysmommy
Hi Tony! Hope you are doing great :D .

I'm encountering a weird problem now.
I want to start a conversation based on a specific entryID, so I wrote this line of code:

Code: Select all

DialogueManager.StartConversation(_currentConversationStarted, GetRegisteredActorTransform("Ethan"), _currentConversantTransform, _currentEntryID);
Let's say _currentEntryID = 19, which was an NPC node and was a part of conversation A. Ran the above line of code, the conversation A was triggered and started at the entryID of 19. So far, so good. Then something weird happened. The NPC subtitle Panel showed nothing. I added this line of code in the OnConversationLine(Subtitle subtitle) method:

Code: Select all

if (subtitle.speakerInfo.isNPC)
        {          
            questionText = subtitle.formattedText.text; // the text of entryID of 19 is "abc"
            Debug.Log(questionText);  // abc
The Output info showed that this node had text, but it didn't appear on the NPC panel. Why did this problem happen? How can I solve it?

Re: Start a conversation but lost its text

Posted: Mon Jun 03, 2024 8:16 am
by Tony Li
Hi,

Temporarily set the Dialogue Manager GameObject's Other Settings > Debug Level to Info. Then reproduce the issue. Verify that you see something like:

Dialogue System: Add Link (NPC): ID=1:19 'Some text.' (True)
Dialogue System: NPC says 'Some text.'

If you see those line, then we know the Dialogue System's data model is correct, and the issue is with the UI. If so, check for any errors or warnings in the Console window. If you don't see any errors or warnings, examine the dialogue UI in the Hierarchy and Inspector. Are the dialogue panel and subtitle panel GameObjects active? Does the subtitle panel's Subtitle Text contain the correct text?

Another thought: Is time paused? If so, and if the Dialogue Manager's Other Settings > Dialogue Time is set to Gameplay, it will observe the pause, and the typewriter effect (if you're using it) won't start typing.

Re: Start a conversation but lost its text

Posted: Thu Jun 13, 2024 8:08 am
by cozysmommy
Hi, I've changed the debug level to info, and I only saw the below information from the console window:

Dialogue System: NPC says 'Some text.' // conversation A starts at entryID = 19

But I couldn't find sentence like:

Dialogue System: Add Link (NPC): ID=1:19 'Some text.' (True)

Guess that's why the NPC played the audio clip while the NPC dialogue panel showed nothing.

Re: Start a conversation but lost its text

Posted: Thu Jun 13, 2024 8:22 am
by Tony Li
Hi,

Since you've specified a dialogue entry to start at, it doesn't need to evaluate and add links, so you won't necessarily see Add Link.

Are you doing this as soon as the scene starts, or at some later point in play? If it's as soon as the scene starts, as another test try delaying it until after the scene has started. This may tell us if it's a dialogue UI initialization issue.

Re: Start a conversation but lost its text

Posted: Thu Jun 13, 2024 9:02 am
by cozysmommy
OMG, thank you for the early reply! That means a lot to me.

I'm working on a function to save and reload the current conversation state. If the player doesn't finish all the conversations at this level, he\she will continue the current conversation when he\she goes back to this scene. That means the StartConversation() function is triggered as soon as the scene starts.

If you don't mind, I'd like to update you something on this issue, and I hope this will help. I've found that when the conversation is started at a Player ID instead of an NPC ID, the response menu panel will show precisely the formatted text this subtitle contains, so the missing text issue only happens when an NPC ID triggers the conversation.

Re: Start a conversation but lost its text

Posted: Thu Jun 13, 2024 9:14 am
by Tony Li
Hi,

To make sure it isn't a known bug (which has been fixed for 2.2.47), please try starting the conversation at least one frame after the scene has started. If this "fixes" the issue, I'll provide a patch for the real fix that's in 2.2.47.

Re: Start a conversation but lost its text

Posted: Thu Jun 13, 2024 9:33 am
by cozysmommy
Thanks, Tony!

I tried starting the conversation one frame after the scene had been activated, but it didn't work, and the NPC subtitle panel still showed nothing. The fix patch would be great, but this function is highly important and urgent for my program. Are there some alternative solutions to this issue?

Re: Start a conversation but lost its text

Posted: Thu Jun 13, 2024 11:28 am
by Tony Li
Hi,

We first need to identify the issue. Can you send me a reproduction project? https://www.pixelcrushers.com/dialogue_ ... proProject