Hello!
I'm doing a project where some conversations will require a confirmation from the player to proceed with that choice.
It should work like this: When the player chooses a response dialogue, the Confirmation panel should appear, warning the player that that choice will have a more serious repercussion and asking if he is sure to proceed and know the consequences (Like spending some important resource or generating some "no-turning-back" event).
Doing this on the end of a conversation is easy, just triggering a OnConversationEnd event, but I'm having difficulty doing this in the middle of a dialogue.
Does anyone have any idea if the Plugin have anything I can use or a way to implement it somehow?
Thanks in advance!
"Accept/Cancel" prompt panel in the middle of a conversation
-
- Posts: 5
- Joined: Thu Jul 27, 2017 2:44 pm
Re: "Accept/Cancel" prompt panel in the middle of a conversation
Hi,
Here are two ways to do it:
1. Write a custom sequencer command that shows the confirmation panel and sets a variable, named "Confirm" for example, to true or false. Then write your conversation like this:
2. Or, run the confirmation as part of the conversation, but override the UI elements. Let's say you have three actors -- Player, NPC, and Confirmation -- and your conversation looks like this:
Create an empty GameObject (typically under Dialogue Manager) named "Confirmation" so it matches the actor name. (Or add an Override Actor Name component to the GameObject, and set the Override Name to "Confirmation".) Add an Override Unity UI Dialogue Controls component to the GameObject, and assign your confirmation panel's UI elements to it. When the actor named Confirmation "speaks" a line such as "Are you sure?...", the Dialogue System will show these UI elements instead of the regular dialogue UI.
Here are two ways to do it:
1. Write a custom sequencer command that shows the confirmation panel and sets a variable, named "Confirm" for example, to true or false. Then write your conversation like this:
- NPC: "Want to buy a $15 Rolex?"
- Player: "No."
- Player: "Yes."
Sequence: ShowConfirmationPanel()- NPC: (blank) -- empty node delays evaluation
Sequence: None()- NPC: "Nice doing business with you."
Conditions: Variable["Confirm"] == true
Script: RemoveCurrency(15); AddItem("Rolex")
- NPC: "Nice doing business with you."
- NPC: (blank) -- empty node delays evaluation
2. Or, run the confirmation as part of the conversation, but override the UI elements. Let's say you have three actors -- Player, NPC, and Confirmation -- and your conversation looks like this:
- NPC: "Want to buy a $15 Rolex?"
- Player: "No."
- Player: "Yes."
- Confirmation: "Are you sure? This will remove $15 from your wallet."
- Player: "Cancel"
- Player: "OK"
- NPC: "Nice doing business with you."
Script: RemoveCurrency(15); AddItem("Rolex")
- NPC: "Nice doing business with you."
- Confirmation: "Are you sure? This will remove $15 from your wallet."
Create an empty GameObject (typically under Dialogue Manager) named "Confirmation" so it matches the actor name. (Or add an Override Actor Name component to the GameObject, and set the Override Name to "Confirmation".) Add an Override Unity UI Dialogue Controls component to the GameObject, and assign your confirmation panel's UI elements to it. When the actor named Confirmation "speaks" a line such as "Are you sure?...", the Dialogue System will show these UI elements instead of the regular dialogue UI.
-
- Posts: 5
- Joined: Thu Jul 27, 2017 2:44 pm
Re: "Accept/Cancel" prompt panel in the middle of a conversation
Hey! Thanks for the quick reply!
Both options are great! I'll have to check with the team how they prefer to show the confirmation to the player!
Both options are great! I'll have to check with the team how they prefer to show the confirmation to the player!