Load a text from a node

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
megadok
Posts: 54
Joined: Sat Sep 05, 2020 12:04 pm

Load a text from a node

Post by megadok »

Hi, Tony!
I was wondering how to load into a string a text from a specific node of a conversation.
Thanks!
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load a text from a node

Post by Tony Li »

Hi,

How will you identify the dialogue entry node? If you have the conversation ID and dialogue entry ID:

Code: Select all

var dialogueEntry = DialogueManager.masterDatabase.GetDialogueEntry(conversationID, dialogueEntryID);
string text = dialogueEntry.currentDialogueText;
(EDIT: Fixed typo.)

The currentDialogueText property takes into account the current language, if you've localized your database. If you want the original Dialogue Text, use the DialogueText property. If you want the original Menu Text, use the MenuText property.
megadok
Posts: 54
Joined: Sat Sep 05, 2020 12:04 pm

Re: Load a text from a node

Post by megadok »

conversation.GetDialogueEntry only acept string, not 2 int parameters...
I have only the conversation name and the id entrys...
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load a text from a node

Post by Tony Li »

Sorry, I meant to type DialogueManager.masterDatabase, not conversation. I had typed something else and then changed it. I just fixed it in my reply above.
megadok
Posts: 54
Joined: Sat Sep 05, 2020 12:04 pm

Re: Load a text from a node

Post by megadok »

Thank you so much Tony!
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load a text from a node

Post by Tony Li »

Happy to help!
Post Reply