Hi, I am just started using the plungin, and creat a converstion tree.
And when the conversation is at the end of node, I want to use script to restart the conversation from the start entry node. But don' t kown the correspoding API.
Also I 'm trying to call an Event from the Dialogue node when a Conversation ends, but there is only the On Execute() event that I can call. And the event need a prefab, why can' t just use the gameobject from the scene like the button onclick event of UGUI
And how to get the conversation from DialogueSystemTrigger through script(not the conversation name).
When the conversation is at the end of node, how to restart the conversation from the start entry
Re: When the conversation is at the end of node, how to restart the conversation from the start entry
If you want to do it within the conversation itself, you can create a link from the final node to the first node.
If you want to know when the conversation has ended, there are several options:
- Connect to the C# event DialogueManager.instance.conversationEnded
- Or add a script with an OnConversationEnd(Transform) method to the Dialogue Manager or actor or conversant
- Or add a Dialogue System Events component to the Dialogue Manager or actor or conversant
You can use a scene GameObject. In the OnExecute() section, click Add Scene Event.
Do you mean a reference to the actual Conversation object in the dialogue database? If so, use DialogueManager.masterDatabase.GetConversation(). Examples:
Code: Select all
// Get the conversation that was most recently started:
Conversation conv = DialogueManager.masterDatabase.GetConversation(DialogueManager.lastConversationStarted);
// Or get the conversation assigned to this GameObject's Dialogue System Trigger:
DialogueSystemTrigger trigger = GetComponent<DialogueSystemTrigger>();
Conversation conv = DialogueManager.masterDatabase.GetConversation(trigger.conversation);