Page 1 of 1

How to access quest display name?

Posted: Mon Mar 27, 2023 2:28 pm
by hipsterdufus
Hi, I'm trying to access the quest display name at runtime. I'm trying like this but it's not able to find the Display_Name field.

Code: Select all

   string questDisplayName = Lua.Run($"return Quest[{questname}].Display_Name").asString;
Do I have the right field?

Re: How to access quest display name?

Posted: Mon Mar 27, 2023 2:43 pm
by Tony Li
Hi,

You can do this:

Code: Select all

string questIndex = DialogueLua.StringToTableIndex(questName);
string questDisplayName = Lua.Run($"return Quest['{questIndex}'].Display_Name").asString;
But it's easier to use the DialogueLua class:

Code: Select all

string questDisplayName = DialogueLua.GetQuestField(questName, "Display Name").asString;