How to access quest display name?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
hipsterdufus
Posts: 95
Joined: Thu Aug 12, 2021 6:39 pm

How to access quest display name?

Post 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?
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to access quest display name?

Post 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;
Post Reply