Send Dialog via Script
Send Dialog via Script
Say I have a dialogue open, is there a way I can interrupt what's currently displayed and display some other text instead via script? I don't want it to instantly appear.
Re: Send Dialog via Script
Hi,
Yes; here are some ways to do it:
1. Directly change the text that's shown in a subtitle panel's subtitle text UI element. Example:
or, to type it using the typewriter effect:
2. Or redirect the conversation to a different dialogue entry:
3. Or create a fake Subtitle object and show it:
Yes; here are some ways to do it:
1. Directly change the text that's shown in a subtitle panel's subtitle text UI element. Example:
Code: Select all
var subtitleText = DialogueManager.standardDialogueUI.conversationUIElements.defaultNPCSubtitlePanel.subtitleText;
subtitleText.text = "This is new text.";
Code: Select all
var panel = DialogueManager.standardDialogueUI.conversationUIElements.defaultNPCSubtitlePanel;
panel.GetTypewriter().StartTyping("This is new text.");
2. Or redirect the conversation to a different dialogue entry:
Code: Select all
var newDialogueEntry = DialogueManager.masterDatabase.GetDialogueEntry(conversationID, entryID);
var newState = DialogueManager.conversationModel.GetState(newDialogueEntry);
DialogueManager.conversationController.GotoState(newState);
3. Or create a fake Subtitle object and show it:
Code: Select all
var subtitle = new Subtitle(speakerInfo, listenerInfo, new FormattedText.Parse("This is new text."), sequence, "", null);
DialogueManager.standardDialogueUI.ShowSubtitle(subtitle);