How to send dialog to an existing chat window

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ProgLord
Posts: 8
Joined: Mon Jun 18, 2018 1:34 pm

How to send dialog to an existing chat window

Post by ProgLord »

Hi, I have an existing chat window that I would like to use with the Dialogue System. Is there a way to send chat to it and for it to send the responses back to the Dialogue Manager?
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to send dialog to an existing chat window

Post by Tony Li »

Sure! Perhaps the easiest way is to have your chat window implement the C# interface IDialogueUI. It just needs to implement a few methods such as ShowSubtitle and ShowResponses. Then assign your chat window to the Dialogue Manager's Dialogue UI field.

Stub out any methods that you don't care to implement, such as ShowQTEIndicator:

Code: Select all

void ShowQTEIndicator(int index) {}
ProgLord
Posts: 8
Joined: Mon Jun 18, 2018 1:34 pm

Re: How to send dialog to an existing chat window

Post by ProgLord »

Awesome, I got everything just about figured out.

The only thing that's eluding me is the delay between when the NPC subtitle appears and when the responses pop up. I would like for the responses to pop up instantly with no delay and I can't seem to find that option. Could you point me in the right direction?
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to send dialog to an existing chat window

Post by Tony Li »

Set the Dialogue Manager's Camera & Cutscene Settings > Default Sequence to:

Code: Select all

None()
Every dialogue entry node plays a sequence. If its Sequence field is blank, it plays the Dialogue Manager's Default Sequence. The conversation doesn't progress to the next stage (e.g., from subtitle to response menu) until the sequence is done. "None()" is an empty command that finishes immediately, allowing the response menu to appear without delay.
ProgLord
Posts: 8
Joined: Mon Jun 18, 2018 1:34 pm

Re: How to send dialog to an existing chat window

Post by ProgLord »

Perfect! Thank you so much for the help and for making this awesome asset!
ProgLord
Posts: 8
Joined: Mon Jun 18, 2018 1:34 pm

Re: How to send dialog to an existing chat window

Post by ProgLord »

Actually I'm getting a warning error in the console after I put None() in the default sequence field.

Code: Select all

Dialogue System: Syntax error 'Expected ')'' at column 6 row 1 parsing: None(
UnityEngine.Debug:LogWarning(Object)
PixelCrushers.DialogueSystem.SequenceParser:Parse(String) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/SequenceParser.cs:54)
PixelCrushers.DialogueSystem.Sequencer:PlaySequence(String) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:536)
PixelCrushers.DialogueSystem.Sequencer:PlaySequence(String, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:551)
PixelCrushers.DialogueSystem.ConversationView:StartSubtitle(Subtitle, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:160)
PixelCrushers.DialogueSystem.ConversationController:GotoState(ConversationState) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:168)
PixelCrushers.DialogueSystem.ConversationController:OnFinishedSubtitle(Object, EventArgs) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Controller/ConversationController.cs:224)
PixelCrushers.DialogueSystem.ConversationView:FinishSubtitle() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:379)
PixelCrushers.DialogueSystem.ConversationView:OnFinishedSubtitle() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:386)
PixelCrushers.DialogueSystem.Sequencer:FinishSequence() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:469)
PixelCrushers.DialogueSystem.Sequencer:Update() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/Sequencer/Sequencer.cs:462)
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to send dialog to an existing chat window

Post by Tony Li »

There's probably a typo. Try retyping "None()" (without quotes).
none.png
none.png (29.61 KiB) Viewed 619 times
ProgLord
Posts: 8
Joined: Mon Jun 18, 2018 1:34 pm

Re: How to send dialog to an existing chat window

Post by ProgLord »

The warning is gone. Maybe there was a space in there or something. Thanks again!
ProgLord
Posts: 8
Joined: Mon Jun 18, 2018 1:34 pm

Re: How to send dialog to an existing chat window

Post by ProgLord »

I'm back 3 years later and I'm trying to do this same thing in another project, but I'm having some trouble getting responses to show in a custom chat window.

Previously, setting the Default Sequence to None() would show responses, but it's no longer doing so. Instead this completely skips the dialogue and doesn't even call ShowSubtitles to send them to my chat window. I've tried setting Default Player Sequence and Default Response Menu Sequence to None() as well, and no luck.

Maybe the code has changed in this time.

All I need to get is the current NPC Text and the current Responses for it.
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to send dialog to an existing chat window

Post by Tony Li »

Hi,

Try setting up the Dialogue Manager's Subtitle Settings like in How To: Bypass Response Menu When Player Has One Choice
Post Reply