Conversation stops after first node

Announcements, support questions, and discussion for the Dialogue System.
OneManOnMars
Posts: 105
Joined: Tue Apr 05, 2016 9:37 am

Conversation stops after first node

Post by OneManOnMars »

Hi Tony,

sorry, for bothering you so frequently atm. :?

But this is so strange that I can't figure it out at all.
What can be a reason for a conversation stopping after the first conversation node?
I had that a few times recently.
Once after creating a new character and conversation/ could not figure out why. So I deleted the character copied another one and changed this copy and it worked.
Now today I copied working characters from one scene into another to create a test scene for a coder and suddenly all the characters stop their conversation after the first node.
I use a world space speechbubble UI with a continue button. I can see the button image flashing when I hit the button, but the conversation does not advance.
I first thought it might be due to a lua coda (SetContinueMode(flase)) somewhere. But double checking this it didn't seem to be the case.
Or does this state gets saved somewhere and when the last entry was false it stays false until it gets true, even after scene changes or start and stop playing?
But I doubt that.

So do you have any idea what this could be? This is driving me crazy! :?
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conversation stops after first node

Post by Tony Li »

Hi,

Yes, the state gets saved. If you set continue mode false, it stays false until you set it true.
OneManOnMars
Posts: 105
Joined: Tue Apr 05, 2016 9:37 am

Re: Conversation stops after first node

Post by OneManOnMars »

Thank you, but after doing more tests I came to the conclusion that it can't be the cause behind this.
For two reasons:

1. The continue button is visible and shows the button has been pressed.
If I do SetContinueMode(false) the continue button disappears until I Set ContinueMode(true)

2. I added SetContinueMode(true) to the first conversation node. But it still does not work. So it has to be something else.

But what??? :(

What I do is this: A SequenceTrigger> OnTriggerEnter [SetEnabled(ProCamera2D, false, MainCamera); SendMessage(StartConversation,,Play_SpecialMovement); SetActive(KARA., true); PProLookAt(KARA., HERO_SCENE_PREFAB)@0.25; PProPlayAnimation(IDLE, HERO_SCENE_PREFAB)@0.25; MoveTo(Cam_WP01, MainCamera, 3)@1; AnimatorPlay(IDLE_CALM, KARA.); MoveTo(Kara_WP03, KARA., 3)@ 2; SendMessage(OnUse,,KARA.)@3.5;]
Then the ConversationTrigger kicks in on the last Conversation Node this Sequence is active:
[SetContinueMode(false); SetEnabled(ProCamera2D, true, MainCamera); SendMessage(StopConversation,,Play_SpecialMovement); SetActive(KARA., false)@1; SetActive(Boss_Kara, true)@1; SetActive(BEAST_FIRE, false)@1; SetContinueMode(true)@1; Continue()@1;]
So the ContinueMode should be true.

Now if I die and revisit the same Sequencetrigger, the conversation gets started but it stops after the first node. The continue button is visible and it blinks when I hit the a button.

My easy fix would be to do a continue()@5 on each node so it does not block the game but I hope you can help me figure out the real problem.

Thank you very much!
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conversation stops after first node

Post by Tony Li »

What do you mean by the conversation "stops after the first node"? Does it freeze there, not allowing you to move forward in the conversation? Or does it end the conversation after the first node? If it

Have you tried temporarily setting the Dialogue Manager's Debug Level to Info? This will log information to the console such as:

Code: Select all

Dialogue System: Starting conversation '...', actor=... and conversant=...
Indicates that a conversation has started.

Code: Select all

Dialogue System: Add Link (actor): ID 'dialogue text'
Indicates that a node's Conditions were true or blank, so this node was added to the list of valid links.

Code: Select all

Dialogue System: Block on False Link (actor): ID 'dialogue text' Condition=lua-code
Indicates that the specified Conditions were false, so this node was not added to the list of valid links.

Code: Select all

Dialogue System: Ending conversation.
Indicates that a conversation has ended. A conversation ends if there are no currently-valid links, or if the player presses the Cancel Conversation key/input button.


What is Play_SpecialMovement? You're calling the method StopConversation() on this GameObject.


Does the problem only happen after the player dies? If so, what changes after the player dies? Does it reload the scene?


I don't know if this will address the problem, but you can try to add the "required" keyword in front of the "@1" commands:

Code: Select all

SetContinueMode(false); 
SetEnabled(ProCamera2D, true, MainCamera); 
SendMessage(StopConversation,,Play_SpecialMovement); 
required SetActive(KARA., false)@1; 
required SetActive(Boss_Kara, true)@1; 
required SetActive(BEAST_FIRE, false)@1; 
required SetContinueMode(true)@1; 
Continue()@1
I don't think it's needed after Continue()@1. The "required" keyword ensures that the command runs even if the sequence ends before the command has a chance to run. Commands should run in relative order -- that is, SetContinueMode(true)@1 should run before Continue()@1 -- but maybe Continue()@1 is running just ahead of SetContinueMode(true)@1.

BTW, did you mean to have a period ( "." ) in SetActive(KARA., false)?

Please feel free to send an example scene or steps to reproduce the problem to tony (at) pixelcrushers.com. I'll be happy to take a look.
OneManOnMars
Posts: 105
Joined: Tue Apr 05, 2016 9:37 am

Re: Conversation stops after first node

Post by OneManOnMars »

Thank you Tony. I just tried the Manger Info thing. And it seems as if the conversation is running.
What do you mean by the conversation "stops after the first node"? Does it freeze there, not allowing you to move forward in the conversation? Or does it end the conversation after the first node? If it
Yes it just finishes after the first node. The game does not freez or anything I just can't advance in the conversation.

But what I found out and could be related to this problem is the following warning:

Multiple EventSystems in scene... this is not supported
UnityEngine.EventSystems.EventSystem:OnEnable()

This happens just after the scene is reloaded (when the player dies) The EventSystem is a child of the Canvas in the DialogSystem.
But if I am looking in the Inspector for "EventSystem" there is just one. So this is a bit confusing.

But could it be, that this is related to the conversation stoping thing?
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conversation stops after first node

Post by Tony Li »

OneManOnMars wrote:Multiple EventSystems in scene... this is not supported
I don't think this is the issue. But, as a test, please try to make the EventSystem a separate GameObject from the entire Dialogue Manager GameObject hierarchy. The Dialogue Manager sticks around through scene changes, including restarting the game. It automatically destroys duplicates. But it's possible that the EventSystem on the duplicate is printing the "Multiple EventSystems" message just before the duplicate is destroyed.
OneManOnMars wrote:Yes it just finishes after the first node.
I'm sorry for not completely understanding. After the first node, do you see "Dialogue System: Ending conversation."? Or is the conversation still onscreen? If the conversation is still onscreen, is the continue button visible? If the continue button is visible, does it respond properly when you click it?
OneManOnMars wrote:SendMessage(StopConversation,,Play_SpecialMovement);
What happens if you temporarily remove this sequencer command? I'm still not sure what it does, so I don't know if it has an effect on the issue.
OneManOnMars
Posts: 105
Joined: Tue Apr 05, 2016 9:37 am

Re: Conversation stops after first node

Post by OneManOnMars »

Hi Tony,

thank you for asking the good questions I do appreciate it.
I'm sorry for not completely understanding. After the first node, do you see "Dialogue System: Ending conversation."? Or is the conversation still onscreen? If the conversation is still onscreen, is the continue button visible? If the continue button is visible, does it respond properly when you click it?
Yes, the conversation is on screen, the conversation is marked as ongoing. The active node (the first) is marked green in the dialog wizard. The continue button is visible and it flashes when I hit the A button. So everything seems to be normal, but the conversation is not advancing.

As a test, I added a continue()@4 to the first node, and this makes the conversation moving on the second node. But there it does stop again.

SendMessage(StopConversation,,Play_SpecialMovement);
Is to let my character system know that the conversation has ended and it will let me control the character again.
SendMessage(StartConversation,,Play_SpecialMovement); takes controls away from the character controller, makes the character go idle and let me control the animation via dialogue systems.

Removing all of it did not solve the issue. Nor did moving the event system out of the dialog manager, as you had thought.
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conversation stops after first node

Post by Tony Li »

It sounds like the continue button's OnClick() event is no longer pointing to the dialogue UI's OnContinue() method. (Or to the ContinueButtonFastForward's OnFastForward() method if that's what you're using.)

Can you please post a screenshot of your Hierarchy that shows the Dialogue Manager, dialogue UI, and continue button?

And if you'd like to send an example scene that demonstrates the issue, you can send it to tony (at) pixelcrushers.com.
OneManOnMars
Posts: 105
Joined: Tue Apr 05, 2016 9:37 am

Re: Conversation stops after first node

Post by OneManOnMars »

Man! Tony, you know your stuff!!!

That's it! After the character dies the OnClick method is gone. Why is that so? I mean the Speech Bubble Dialogue UI isn't even destroyed on load.

How can I prevent this from happening?

About sending a sample. I would, but the project is quite big and I would have to sort some thing to not have to send you everything. But if we can't figure it out, I'll prepare a sample. Thank you for the offer!
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Conversation stops after first node

Post by Tony Li »

Now that we have an idea of what's going on, I'll try to reproduce the conditions that could cause the OnClick method to disappear. If I can do that, I'm sure I can suggest a solution fairly quickly.

What's currently assigned to the continue button's OnClick event?
Post Reply