Page 1 of 1
'BarkString', but using the Dialogue UI.
Posted: Sat Jun 04, 2022 6:32 pm
by DarkProphet
Is there a way to use the normal dialogue UI to 'bark' a one-off custom string?
Basically, instead of using StartConversation(title)
you would have BarkConversation(customString, dialogueActor)
or something like that.
Is there functionality for this built in - or can someone help me write some code to make it possible?
Re: 'BarkString', but using the Dialogue UI.
Posted: Sat Jun 04, 2022 8:16 pm
by Tony Li
Hi,
You can manually open the dialogue UI, make a subtitle object, and show it. For example:
Code: Select all
DialogueManager.standardDialogueUI.Open();
PixelCrushers.DialogueSystem.CharacterInfo speakerInfo = new PixelCrushers.DialogueSystem.CharacterInfo(2, "NPC", null, CharacterType.NPC, null);
PixelCrushers.DialogueSystem.CharacterInfo listenerInfo = new PixelCrushers.DialogueSystem.CharacterInfo(1, "Player", null, CharacterType.PC, null);
FormattedText formattedText = FormattedText.Parse("Hello world");
string sequence = "Delay(2)";
string responseMenuSequence = string.Empty;
DialogueEntry dialogueEntry = null;
Subtitle subtitle = new Subtitle(speakerInfo, listenerInfo, formattedText, sequence, responseMenuSequence, dialogueEntry);
DialogueManager.standardDialogueUI.ShowSubtitle(subtitle);
yield return new WaitForSeconds(2);
DialogueManager.standardDialogueUI.Close();
Re: 'BarkString', but using the Dialogue UI.
Posted: Sat Jun 04, 2022 10:49 pm
by DarkProphet
Ok cool! I'll look into this.
Thanks a bunch!
Re: 'BarkString', but using the Dialogue UI.
Posted: Sun Jun 05, 2022 8:13 am
by Tony Li
Glad to help!