creating a back button (need guidance)
Posted: Wed Jan 20, 2016 4:17 pm
// Question
My playtester wanted to go backwards through the dialog choices. Any thoughts on how to implement it?
I can create an array of Conversation ID's and node id's and jump to a specific node, but I think it's going to cause a lot of problems.
// Possible Solution Ideas -----------------------------------------------------------------------------------------
Methods I think are relevant:
var dialogueEntry = DialogueManager.CurrentConversationState.subtitle.dialogueEntry;
int conversationID = dialogueEntry.conversationID; //<-- This is the conversation ID.
int dialogueEntryID = dialogueEntry.id; //<-- This is the dialogue entry ID.
DialogueManager.StartConversation("Title", actor, conversant, dialogueEntryID);
Thanks!
// Relevant post-----------------------------------------------------------------------------------------------------
This question by EWalk13 is similar to mine.
Getting Node ID through code
Postby EWalk13 » Fri Oct 30, 2015 3:50 pm
--------------------------
Hi,
EWalk13 wrote:
Hi I was wondering how you get a conversation nodes id through C# code. I need to be able to access these to work in my audio.
Every conversation has a conversation ID, and every dialogue entry in the conversation has a dialogue entry ID. If you set the Dialogue Manager's Debug Level to Info, you'll see lines like this:
CODE: SELECT ALL
Dialogue System: Add Link (Player): ID=12:34 'Hello, world.'
The conversation ID is 12, and the dialogue entry ID is 34.
You can get to any dialogue entry through DialogueManager.MasterDatabase. But I'm guessing you want the current line's IDs. The current dialogue entry is DialogueManager.CurrentConversationState.subtitle.dialogueEntry. So use this:
CODE: SELECT ALL
var dialogueEntry = DialogueManager.CurrentConversationState.subtitle.dialogueEntry;
int conversationID = dialogueEntry.conversationID; //<-- This is the conversation ID.
int dialogueEntryID = dialogueEntry.id; //<-- This is the dialogue entry ID.
If you're making a subclass of your dialogue UI class, such as UnityUIDialogueUI, the ShowSubtitle() method also gives you a reference to the subtitle.
You might also find entrytags helpful for your audio. In code, you can use DialogueManager.MasterDatabase.GetEntrytag().
EWalk13 wrote:
Also, is there a way to enter a conversation and jump right to a specific node and skip the ones above it?
Pass the dialogue entry ID to DialogueManager.StartConversation():
CODE: SELECT ALL
DialogueManager.StartConversation("Title", actor, conversant, dialogueEntryID);
Personally, I don't like working with IDs directly. They're fine, they're stable and reliable, but I feel like the logic is more transparent if I put it inside the dialogue tree's Conditions and Script fields instead. For example, in the Feature Demo, Private Hart's conversation jumps to different sections of the dialogue tree by using Conditions on all the dialogue entries that link from the START entry.
My playtester wanted to go backwards through the dialog choices. Any thoughts on how to implement it?
I can create an array of Conversation ID's and node id's and jump to a specific node, but I think it's going to cause a lot of problems.
// Possible Solution Ideas -----------------------------------------------------------------------------------------
Methods I think are relevant:
var dialogueEntry = DialogueManager.CurrentConversationState.subtitle.dialogueEntry;
int conversationID = dialogueEntry.conversationID; //<-- This is the conversation ID.
int dialogueEntryID = dialogueEntry.id; //<-- This is the dialogue entry ID.
DialogueManager.StartConversation("Title", actor, conversant, dialogueEntryID);
Thanks!
// Relevant post-----------------------------------------------------------------------------------------------------
This question by EWalk13 is similar to mine.
Getting Node ID through code
Postby EWalk13 » Fri Oct 30, 2015 3:50 pm
--------------------------
Hi,
EWalk13 wrote:
Hi I was wondering how you get a conversation nodes id through C# code. I need to be able to access these to work in my audio.
Every conversation has a conversation ID, and every dialogue entry in the conversation has a dialogue entry ID. If you set the Dialogue Manager's Debug Level to Info, you'll see lines like this:
CODE: SELECT ALL
Dialogue System: Add Link (Player): ID=12:34 'Hello, world.'
The conversation ID is 12, and the dialogue entry ID is 34.
You can get to any dialogue entry through DialogueManager.MasterDatabase. But I'm guessing you want the current line's IDs. The current dialogue entry is DialogueManager.CurrentConversationState.subtitle.dialogueEntry. So use this:
CODE: SELECT ALL
var dialogueEntry = DialogueManager.CurrentConversationState.subtitle.dialogueEntry;
int conversationID = dialogueEntry.conversationID; //<-- This is the conversation ID.
int dialogueEntryID = dialogueEntry.id; //<-- This is the dialogue entry ID.
If you're making a subclass of your dialogue UI class, such as UnityUIDialogueUI, the ShowSubtitle() method also gives you a reference to the subtitle.
You might also find entrytags helpful for your audio. In code, you can use DialogueManager.MasterDatabase.GetEntrytag().
EWalk13 wrote:
Also, is there a way to enter a conversation and jump right to a specific node and skip the ones above it?
Pass the dialogue entry ID to DialogueManager.StartConversation():
CODE: SELECT ALL
DialogueManager.StartConversation("Title", actor, conversant, dialogueEntryID);
Personally, I don't like working with IDs directly. They're fine, they're stable and reliable, but I feel like the logic is more transparent if I put it inside the dialogue tree's Conditions and Script fields instead. For example, in the Feature Demo, Private Hart's conversation jumps to different sections of the dialogue tree by using Conditions on all the dialogue entries that link from the START entry.