I am trying to implement a script so that I can start a conversation when I want, move on to the next dialog entry when I want, and forcefully end the conversation when I want.
The OnUse() function was used to start a conversation when desired, and the function to move on to the next Dialogue Entry was implemented with the Sequence's WaitForMessage() function.
But I don't know how to force end the conversation.
1. I have multiple Enemys in my game, and each Enemy can talk to itself or have a conversation. I would like to know how I can force quit only the Conversations I want.
2. I wonder if there is a variable that can check if Conversatio is in progress.
How to stop conversation with script
How to stop conversation with script
- Attachments
-
- 캡처.PNG (1.42 KiB) Viewed 1085 times
-
- 2.PNG (75.32 KiB) Viewed 1085 times
Re: How to stop conversation with script
Hi,
To start a conversation from a script (if you prefer that to OnUse()), use DialogueManager.StartConversation().
To advance a conversation, call DialogueManager.standardDialogueUI.OnContinue() to simulate a continue button click, or use DialogueManager.conversationController.GotoState() to manually jump to a specific dialogue entry. For GotoState(), see this example.
To check if a conversation is active, check DialogueManager.isConversationActive.
To stop a conversation, use DialogueManager.StopConversation() or StopAllConversations().
If you run simultaneous conversations, each conversation will have an ActiveConversationRecord. You can access them through DialogueManager.instance.activeConverrsations. To stop a specific conversation, call its conversationController.Close() method.
To start a conversation from a script (if you prefer that to OnUse()), use DialogueManager.StartConversation().
To advance a conversation, call DialogueManager.standardDialogueUI.OnContinue() to simulate a continue button click, or use DialogueManager.conversationController.GotoState() to manually jump to a specific dialogue entry. For GotoState(), see this example.
To check if a conversation is active, check DialogueManager.isConversationActive.
To stop a conversation, use DialogueManager.StopConversation() or StopAllConversations().
If you run simultaneous conversations, each conversation will have an ActiveConversationRecord. You can access them through DialogueManager.instance.activeConverrsations. To stop a specific conversation, call its conversationController.Close() method.
Re: How to stop conversation with script
Thank you for answer!
Could it be that the sequence of the Entry cannot be set as a script at runtime?
I tried running the code to change the sequence as shown in the picture, but it didn't work.
Could it be that the sequence of the Entry cannot be set as a script at runtime?
I tried running the code to change the sequence as shown in the picture, but it didn't work.
- Attachments
-
- 캡처.PNG (1.85 KiB) Viewed 1081 times
Re: How to stop conversation with script
I changed it to DialogueManager.StartConversation() and tried it, but is DialogueManager.StartConversation() only output to Dialogue UI of Dialogue System Controller?
Enemy's self-talk wants to output the UI to the Custom Subtitle Panel set in Dialogue Actor.
Enemy's self-talk wants to output the UI to the Custom Subtitle Panel set in Dialogue Actor.
- Attachments
-
- 2.PNG (74.27 KiB) Viewed 1079 times
-
- 1.PNG (34.75 KiB) Viewed 1079 times
Re: How to stop conversation with script
You can do that before starting the conversation. But once you've started the conversation it's too late because the original Sequence will already be cached in a Subtitle object. You can use an OnConversationLine() method to modify the Subtitle object's sequence property.
Re: How to stop conversation with script
Provide the enemy GameObject to DialogueManager.StartConversation(). Example:
Code: Select all
DialogueManager.StartConversation("Self Talk", playerTransform, enemyTransform);
Re: How to stop conversation with script
Thank you for answer! It really helped a lot!
However, as an experiment, I tested it with two Enemy, and the same StartConversation was applied, but only one of the objects started the conversation. Can't two or more conversations run at the same time?
However, as an experiment, I tested it with two Enemy, and the same StartConversation was applied, but only one of the objects started the conversation. Can't two or more conversations run at the same time?
Re: How to stop conversation with script
Hi,
You must tick the Dialogue Manager GameObject's Other Settings > Allow Simultaneous Conversations.
In addition, add an Override Dialogue UI component to each enemy, and assign the Basic Standard Dialogue UI prefab. The enemy will use its own bubble panel, but it needs to the Basic Standard Dialogue UI's StandardDialogueUI script to control its operation.
You must tick the Dialogue Manager GameObject's Other Settings > Allow Simultaneous Conversations.
In addition, add an Override Dialogue UI component to each enemy, and assign the Basic Standard Dialogue UI prefab. The enemy will use its own bubble panel, but it needs to the Basic Standard Dialogue UI's StandardDialogueUI script to control its operation.