Page 1 of 1

GetDialogueEntry does not run Lua commands

Posted: Thu Sep 10, 2020 10:37 am
by kheper
I am using text from the Dialogue System in my UI so am manually accessing the database as follows:

Code: Select all

Conversation con = DialogueManager.masterDatabase.GetConversation(convoRef);
DialogueEntry ent = con.GetDialogueEntry(i+1);
reflectLabel[i].text = ent.DialogueText;
This was working great until I put a Lua command in the text '[var=mcName]'. Now the displayed text just shows the '[var=mcName]' instead of the name. I tried doing Lua.Run but that seems to require the command be isolated with no text.

So what is the best method to run all inline lua commands on a provided string file? Or is there a way to get the processed string directly from the DialogueManager?

Re: GetDialogueEntry does not run Lua commands

Posted: Thu Sep 10, 2020 10:41 am
by Tony Li
Hi,

Use FormattedText.Parse:

Code: Select all

reflectLabel[i].text = FormattedText.Parse(ent.DialogueText);

Re: GetDialogueEntry does not run Lua commands

Posted: Thu Sep 10, 2020 10:19 pm
by kheper
Thanks! That works. I knew there would be an easy solution just couldn't find in all the documentation.

Re: GetDialogueEntry does not run Lua commands

Posted: Thu Sep 10, 2020 10:29 pm
by Tony Li
Glad to help!