Page 1 of 1
Load a text from a node
Posted: Mon Apr 19, 2021 6:07 pm
by megadok
Hi, Tony!
I was wondering how to load into a string a text from a specific node of a conversation.
Thanks!
Re: Load a text from a node
Posted: Mon Apr 19, 2021 6:21 pm
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.
Re: Load a text from a node
Posted: Mon Apr 19, 2021 6:25 pm
by megadok
conversation.GetDialogueEntry only acept string, not 2 int parameters...
I have only the conversation name and the id entrys...
Re: Load a text from a node
Posted: Mon Apr 19, 2021 6:46 pm
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.
Re: Load a text from a node
Posted: Mon Apr 19, 2021 6:51 pm
by megadok
Thank you so much Tony!
Re: Load a text from a node
Posted: Mon Apr 19, 2021 9:23 pm
by Tony Li
Happy to help!