Page 1 of 3

Few questions about changing dialogue flow on runtime

Posted: Thu Mar 09, 2017 5:18 pm
by hellwalker
Hello,

I'm using switch panel component and chat logger components to switch between normal dialogue and "Smart Phone Chat" style conversations.
The switching works great, but I also need to change few things about dialogue flow, and I was wondering what is the best way to do this.

1) I want to be able to change the way continue works at runtime. So on some dialogues conversations for it to advance automatically, on others for it to require that user click continue button. What would be the best way to approach this? I tried accessing DialogueSystemController's continue button field but it seems to be closed.

2) When PC has only one response, I want on some dialogues for PC to automatically "Speak" the dialogues, on other to have to click the line. What would be best way to switch this at runtime?


Thanks in advance

Re: Few questions about changing dialogue flow on runtime

Posted: Thu Mar 09, 2017 8:13 pm
by Tony Li
Hi,
hellwalker wrote:1) I want to be able to change the way continue works at runtime. So on some dialogues conversations for it to advance automatically, on others for it to require that user click continue button. What would be the best way to approach this? I tried accessing DialogueSystemController's continue button field but it seems to be closed.
To override the continue button mode for a specific conversation, inspect the conversation's properties. (Click on empty canvas space in the conversation node editor.) Then tick the Override Display Settings checkbox and the Subtitle Settings checkbox. Finally, change the Continue Button dropdown:

Image

If you want to change the continue button mode partway through a conversation, use the SetContinueMode() sequencer command.
hellwalker wrote:2) When PC has only one response, I want on some dialogues for PC to automatically "Speak" the dialogues, on other to have to click the line. What would be best way to switch this at runtime?
Inspect the Dialogue Manager. Under Display Settings > Input Settings, untick Always Force Response menu:

Image

When this checkbox is unticked and the player only has one valid response, the Dialogue System will automatically play that response instead of showing it in a menu. If you then want to show a specific one-response entry in a menu, add the [f] markup tag:

Image

And then if you don't want it to also appear as a subtitle, set its Sequence to None(). [EDIT: Or, if you're using a continue button mode, set the Sequence to Continue().]

Re: Few questions about changing dialogue flow on runtime

Posted: Fri Mar 10, 2017 4:04 am
by hellwalker
Awesome thank you. But I have problem with setting continue mode back to true.
In one conversation I set it to false and at the start of next conversation I set it to SetContinueMode(true); but the conversation still flows automatically :(

Re: Few questions about changing dialogue flow on runtime

Posted: Fri Mar 10, 2017 8:07 am
by hellwalker
Also None() does not work, when I add that into sequence field it still shows the text. I wanted to use the dialogue like action button, so you choose action but it does not display as text.

Re: Few questions about changing dialogue flow on runtime

Posted: Fri Mar 10, 2017 9:34 am
by Tony Li
Hi,
hellwalker wrote:Awesome thank you. But I have problem with setting continue mode back to true.
In one conversation I set it to false and at the start of next conversation I set it to SetContinueMode(true); but the conversation still flows automatically :(
Let's make sure those sequencer commands are actually getting run. Please temporarily set the Dialogue Manager's Debug Level to Info, and then reproduce the problem. Check the Console window for these lines:

Code: Select all

Dialogue System: Sequencer: SetContinueMode(false)
and

Code: Select all

Dialogue System: Sequencer: SetContinueMode(true)
hellwalker wrote:Also None() does not work, when I add that into sequence field it still shows the text. I wanted to use the dialogue like action button, so you choose action but it does not display as text.
It sounds like you're using a continue button at that point. In this case, instead of None() use Continue(). This simulates a continue button press. The None() sequencer command tells it to not play a sequence, but if you're still waiting for a continue button it will show the text and wait for the continue button. The Continue() command, on the other hand, simulates a continue button press and automatically progresses the conversation.

Re: Few questions about changing dialogue flow on runtime

Posted: Fri Mar 10, 2017 12:35 pm
by hellwalker
Ah wow lol, this is weird. It was not being called and then I noticed I had two nodes in the same place as start node and I had code on second one.
I did some testing and this seems to happen when you click on empty space and create node from there, a node gets created as child of start node and in the same place as first node, overlapping it. For me this must have happened when I accidentally clicked empty area around the node, whose child I wanted to create.

I'm going through my dialogues and I have this on around 5% of dialogues hmm.

Re: Few questions about changing dialogue flow on runtime

Posted: Fri Mar 10, 2017 1:24 pm
by Tony Li
hellwalker wrote:Ah wow lol, this is weird. It was not being called and then I noticed I had two nodes in the same place as start node and I had code on second one.
I did some testing and this seems to happen when you click on empty space and create node from there, a node gets created as child of start node and in the same place as first node, overlapping it. For me this must have happened when I accidentally clicked empty area around the node, whose child I wanted to create.

I'm going through my dialogues and I have this on around 5% of dialogues hmm.
Do you have any suggestions on how to improve the UI to help prevent this?

You could always right-click on the canvas and select "Auto Arrange" to expose overlapping nodes, but this will rearrange all your nodes.

Re: Few questions about changing dialogue flow on runtime

Posted: Sat Mar 11, 2017 2:33 pm
by hellwalker
I was thinking about this, I think this is something Unity has to fix with Animator/Controller flow. Two nodes should not be allowed to overlap like that/should be pushed. Otherwise all suggestions seem hacky like randomizing initial position etc.
Although perhaps it's possible to add optional feature, so that if you create a node in empty area, it just gets created as empty unconnected node in that specific spot?

I have one more question, so for example situation like this

[Player: Choose Weapon]
----[Player: I choose Spear]
----[Player: I choose Potato]

So in essence a player dialogue that leads to two more player dialogue choices. How can I prevent in this specific scenario only [Player: Choose Weapon] from writing "Choose Weapon" as text in response subtitle while player has dialogue choices displayed? Is there a built in method or should I use something like SetActive(ResponceSubtitlePanel, false) ?

Re: Few questions about changing dialogue flow on runtime

Posted: Sat Mar 11, 2017 2:55 pm
by Tony Li
Sounds like the Dialogue Manager's Subtitle Settings > Allow PC Subtitle Reminders checkbox is ticked. This tells the Dialogue System to show the PC's line as the reminder if the PC was the last one to "speak." Try unticking it. If it's unticked, it will show the last NPC line instead. Here's an example scene:

SubtitleReminderExample_2017-03-11.unitypackage


Regarding the overlapping node issue, I've made a note to play with this in a future update. It might work best to push nodes apart so they never overlap more than halfway. I've give it some thought.

Re: Few questions about changing dialogue flow on runtime

Posted: Wed Mar 15, 2017 8:30 pm
by hellwalker
Thanks,

I have a new question. I could swear I found this option somewhere before but cannot find it now.
Is it possible to give Actor names specific colors? So their names(not subtitles) show in specific color?