Alert Message Box in Middle of Conversation
Alert Message Box in Middle of Conversation
Hi there,
I'm new to be Unity and also this dialogue system, but am really loving it so far and feel like I've already saved a ton of time by using it.
I have a moment in the game that is kind of a turning point. The NPC has just explained their situation and I'd like the dialogue UI to go away, and have an alert message pop up in the middle of the screen that says "Will you help him?" and have Yes or No buttons with a timer. Then from there a cut scene will start.
Is this something that is fairly easy to do?
Any help I can get would be much appreciated.
I'm new to be Unity and also this dialogue system, but am really loving it so far and feel like I've already saved a ton of time by using it.
I have a moment in the game that is kind of a turning point. The NPC has just explained their situation and I'd like the dialogue UI to go away, and have an alert message pop up in the middle of the screen that says "Will you help him?" and have Yes or No buttons with a timer. Then from there a cut scene will start.
Is this something that is fairly easy to do?
Any help I can get would be much appreciated.
Re: Alert Message Box in Middle of Conversation
Hi,
Thanks for using the Dialogue System!
If you just wanted to show a non-interactive alert, you could do this:
1. Inspect the Dialogue Manager GameObject, and tick Display Settings > Alert Settings > Allow Alerts During Conversations.
2. Add a dialogue entry node after the turning point. Leave the dialogue text blank. Set the Script field to something like:
Set the Sequence field to something like:
or whatever duration the alert message lasts for.
---
However, since you want to ask Yes/No, there are two ways you could approach it:
1. It sounds like it happens at the end of the conversation since, after answering Yes or No, it starts a cutscene instead of continuing the conversation. If this is the case, you could write your own Yes/No box and run it at the end of the conversation.
2. But another way to do it is in the conversation itself, using an additional subtitle panel and response menu panel configured only for Yes/No questions. To do this:
Thanks for using the Dialogue System!
If you just wanted to show a non-interactive alert, you could do this:
1. Inspect the Dialogue Manager GameObject, and tick Display Settings > Alert Settings > Allow Alerts During Conversations.
2. Add a dialogue entry node after the turning point. Leave the dialogue text blank. Set the Script field to something like:
Code: Select all
ShowAlert("Your alert message here.")
Code: Select all
SetDialoguePanel(false);
SetDialoguePanel(true)@4
---
However, since you want to ask Yes/No, there are two ways you could approach it:
1. It sounds like it happens at the end of the conversation since, after answering Yes or No, it starts a cutscene instead of continuing the conversation. If this is the case, you could write your own Yes/No box and run it at the end of the conversation.
2. But another way to do it is in the conversation itself, using an additional subtitle panel and response menu panel configured only for Yes/No questions. To do this:
- Duplicate one of the existing subtitle panels, style it to look the way you want, and add it to the dialogue UI's Standard Dialogue UI component > Conversation UI Elements > Subtitle Panels list. Make a note of its element number (e.g., 2).
- Do the same to create a new response menu panel, and note its element number.
- In the dialogue entry node before the question, set the Sequence to:
Code: Select all
{{default}}; SetPanel(NPC, 2); SetMenuPanel(Player, 1)
- After that node, add a node for the question. Set its Sequence to:
Code: Select all
SetTimeout(5)
- Add Yes and No player response nodes after that. Set their Sequence fields to:
Code: Select all
{{default}}; SetPanel(NPC, 0); SetMenuPanel(Player, 0)
- In the SetPanel() sequencer commands, use the NPC actor's name in place of "NPC".
- In the SetTimeout() sequencer command, specify the timeout duration in seconds (e.g., 5 seconds in the example above).
- In the example scene below, I set the Dialogue Manager's Input Settings > Response Timeout Action to "Choose Last Response" so it will choose No by default.
Re: Alert Message Box in Middle of Conversation
Thanks so much! I probably won't be able to test this out tonight, but I'll let you know how it goes when I do. Again thanks for the help and quick response!
Re: Alert Message Box in Middle of Conversation
Happy to help!
Re: Alert Message Box in Middle of Conversation
hi,
sorry for bringing old thread up, but my case is about the same as the non interactive alert
i have this sequence
which worked fine but at the start of the sequence, it displayed the dialogue panel for a little moment before it started the sequence and show the alert, like this video
1.)how can i fix it so dialogue panel won't show up at all when using that sequence?
2.) is it possible to also insert dialogue text with alert in 1 node and play dialogue first, wait until continue button, then show the alert just using 1 node? or is it better to separate dialogue text with alert text into 2 nodes?
i tried set using this
but it didnt show the dialogue text, only the alert text
sorry for bringing old thread up, but my case is about the same as the non interactive alert
i have this sequence
Code: Select all
SetDialoguePanel(false);
Continue()@3;
SetDialoguePanel(true)@3;
1.)how can i fix it so dialogue panel won't show up at all when using that sequence?
2.) is it possible to also insert dialogue text with alert in 1 node and play dialogue first, wait until continue button, then show the alert just using 1 node? or is it better to separate dialogue text with alert text into 2 nodes?
i tried set using this
Code: Select all
{{default}}; //-> default = Delay({{end}})
SetDialoguePanel(false);
Continue()@3;
SetDialoguePanel(true)@3;
Re: Alert Message Box in Middle of Conversation
Hi,
Use SetDialoguePanel(false,immediate)
Either is fine. Use two nodes if it makes the order of event clearer. For one node, use the Script field to set Variable["Alert"] and call ShowAlert() in the Sequence field when the player continues:
- Script: Variable["Alert"] = "This is an alert message."
- Sequence: ShowAlert()@Message(Continued)
Re: Alert Message Box in Middle of Conversation
This works for the 2 nodes, thank you !SetDialoguePanel(false,immediate)
This works too, but it instantly end the conversation (regain character control) after showing the alert. i tried adding delay(3) below the showalert() but it doesnt work? how can i show the alert for 3second before ending conversation?Script: Variable["Alert"] = "This is an alert message."
Sequence: ShowAlert()@Message(Continued)
Re: Alert Message Box in Middle of Conversation
Hi,
Add an empty node at the end (or whenever you want to delay). Leave the Dialogue Text blank, and set the Sequence field to one of these:
If you want to delay, and the conversation doesn't normally require the player to click a continue button:
If the player normally has to click a continue button, use this instead to simulate a continue button click after 3 seconds:
If you also need to hide and then show the dialogue UI, use something like:
or:
Add an empty node at the end (or whenever you want to delay). Leave the Dialogue Text blank, and set the Sequence field to one of these:
If you want to delay, and the conversation doesn't normally require the player to click a continue button:
Code: Select all
Delay(3)
Code: Select all
Continue()@3
Code: Select all
SetDialoguePanel(false);
SetDialoguePanel(true)@3
Code: Select all
SetDialoguePanel(false);
required SetDialoguePanel(true)@3;
Continue()@3