Page 1 of 1

How to send dialog to an existing chat window

Posted: Fri Mar 08, 2019 7:57 pm
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?

Re: How to send dialog to an existing chat window

Posted: Fri Mar 08, 2019 8:20 pm
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) {}

Re: How to send dialog to an existing chat window

Posted: Sat Mar 09, 2019 4:04 pm
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?

Re: How to send dialog to an existing chat window

Posted: Sat Mar 09, 2019 4:54 pm
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.

Re: How to send dialog to an existing chat window

Posted: Sat Mar 09, 2019 5:03 pm
by ProgLord
Perfect! Thank you so much for the help and for making this awesome asset!

Re: How to send dialog to an existing chat window

Posted: Sat Mar 09, 2019 5:10 pm
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)

Re: How to send dialog to an existing chat window

Posted: Sat Mar 09, 2019 5:26 pm
by Tony Li
There's probably a typo. Try retyping "None()" (without quotes).
none.png
none.png (29.61 KiB) Viewed 621 times

Re: How to send dialog to an existing chat window

Posted: Sat Mar 09, 2019 5:32 pm
by ProgLord
The warning is gone. Maybe there was a space in there or something. Thanks again!

Re: How to send dialog to an existing chat window

Posted: Fri Jun 10, 2022 4:30 am
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.

Re: How to send dialog to an existing chat window

Posted: Fri Jun 10, 2022 8:59 am
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