How can I get subtitle lines (strings) from a conversation without starting a conversation?
For example, I want to get the second line of "Conversation_A" (just the string).
Can I do this via script? Thanks!
Get subtitle lines without starting conversation
Re: Get subtitle lines without starting conversation
Hi,
Yes, here are two ways:
1. If you only need the text:
2. If you need to process all the logic:
Yes, here are two ways:
1. If you only need the text:
Code: Select all
Conversation conversation = DialogueManager.masterDatabase.GetConversation("Conversation_A");
DialogueEntry startEntry = conversation.GetFirstEntry();
DialogueEntry secondEntry = conversation.GetDialogueEntry(startEntry.outgoingLinks[0].destinationDialogueID);
string text = FormattedText.Parse(secondEntry.currentDialogueText);
Debug.Log($"Second entry: {text}");
Code: Select all
model = new ConversationModel(DialogueManager.masterDatabase, "Conversation_A", null, null, true, null);
var response = model.firstState.hasNPCResponse ? model.firstState.firstNPCResponse : model.firstState.pcResponses[0];
var secondState = model.GetState(response.destinationEntry);
Debug.Log($"Second entry: {secondState.subtitle.formattedText.text}");
Re: Get subtitle lines without starting conversation
Awesome! Thanks, Tony!
Re: Get subtitle lines without starting conversation
Glad to help!