Hello,
I'm still fairly new to Dialogue system, and I am currently using a different than normal input system. I need to script my Input Manager to control conversations.
I am having trouble figuring out how to manipulate conversations through scripting:
I know you can stop the current conversation with:
DialogueManager.StopConversation();
but I cannot seem to find how to:
1) Progress a Conversation
2) Control branching dialogue options (Cycling through the options or binding specific buttons for specific options)
3) Completing typewriting effects. (So I can then progress a conversation.)
4) Skipping to specific point within a Conversation?
Sorry to ask a question that was more than likely answered somewhere, but I can't seem to figure these out. I tried going through the scripting section in the documentation, and I tried looking around for examples in the Extras section.
If someone can point me in the right direction for examples, or know the answers it would be really helpful~
Controlling a Conversation through script~
Re: Controlling a Conversation through script~
Hi,
Thanks for using the Dialogue System!
1. In the Dialogue Editor, make a link to the specific dialogue entry. Set Conditions so the conversation follows that link when under specific conditions.
2. Or, stop the conversation and start it again at a specific dialogue entry using DialogueManager.StartConversation() or by setting the entry ID in a Dialogue System Trigger (Add Action > Start Conversation).
3. Or, get a conversation state and tell the conversation to go to that state. Conversations use a Model-View-Controller architecture. Get the conversation state from the model and tell the controller to go to it, such as:
Thanks for using the Dialogue System!
Are you using a dialogue UI? If so, then the simplest approach is to script your input to work with the dialogue UI, typically by writing a small subclass of StandardDialogueUI. There are examples of doing this for speech-to-text input, VR input, etc. If you can provide more details, I can point you to more specific resources.
Three ways:
1. In the Dialogue Editor, make a link to the specific dialogue entry. Set Conditions so the conversation follows that link when under specific conditions.
2. Or, stop the conversation and start it again at a specific dialogue entry using DialogueManager.StartConversation() or by setting the entry ID in a Dialogue System Trigger (Add Action > Start Conversation).
3. Or, get a conversation state and tell the conversation to go to that state. Conversations use a Model-View-Controller architecture. Get the conversation state from the model and tell the controller to go to it, such as:
Code: Select all
var state = DialogueManager.conversationModel.GetState(dialogueEntry);
DialogueManager.conversationController.GotoState(state);
Re: Controlling a Conversation through script~
wow that was a fast response..
I am using the Dialogue UI yes. I am using Unity new input system, so it isn't really complex what I need to do. But yes .. I can have my input manager work with the Dialogue UI. It's honestly using basic keyboard mouse / controller controls still.
Thank you for the reply about skipping to a specific point. That works fine.~
I am using the Dialogue UI yes. I am using Unity new input system, so it isn't really complex what I need to do. But yes .. I can have my input manager work with the Dialogue UI. It's honestly using basic keyboard mouse / controller controls still.
Thank you for the reply about skipping to a specific point. That works fine.~
Re: Controlling a Conversation through script~
Glad to help!
If you get stuck on it, just let me know. Official support for Unity's new input system will be introduced some time after version 2.2.0 is released (when the new input system is more of a final release and less of a beta feature).
If you get stuck on it, just let me know. Official support for Unity's new input system will be introduced some time after version 2.2.0 is released (when the new input system is more of a final release and less of a beta feature).
Re: Controlling a Conversation through script~
Sorry Tony, still a little stuck on this issue. I do have conversations working now, but I still couldn't figure out:
1) Controlling branching Dialogue options. I lose my controls when I reach a point in Dialogue where it branches. I'm not sure what kind of commands I should be sending the Dialogue manager. (Cycling through the options) with scripts. "Accepting" that option when you have it highlighted.
2) I am also having a problem with using my controls to End a Bark with WaitForContinue button option checked.
If you can give me any insight on how this works, it would be much appreciated. I've already got my Player starting conversations working since the last hint. : ) , and my barks / alerts are working properly.
1) Controlling branching Dialogue options. I lose my controls when I reach a point in Dialogue where it branches. I'm not sure what kind of commands I should be sending the Dialogue manager. (Cycling through the options) with scripts. "Accepting" that option when you have it highlighted.
2) I am also having a problem with using my controls to End a Bark with WaitForContinue button option checked.
If you can give me any insight on how this works, it would be much appreciated. I've already got my Player starting conversations working since the last hint. : ) , and my barks / alerts are working properly.
Re: Controlling a Conversation through script~
Call the dialogue UI's OnClick(Response) method.SystemId wrote: ↑Wed Aug 21, 2019 1:52 am1) Controlling branching Dialogue options. I lose my controls when I reach a point in Dialogue where it branches. I'm not sure what kind of commands I should be sending the Dialogue manager. (Cycling through the options) with scripts. "Accepting" that option when you have it highlighted.
The dialogue UI's ShowResponses(Response[]) method receives an array of Responses that it typically shows in a menu of buttons. When the player clicks a button, the button calls the dialogue UI's ShowResponses method, passing the corresponding Response.
Call the bark UI's OnContinue() method.