QuestLog.GetQuestTitle is falling back on the default name field as the "Display Name" field appears to be returning nil by Lua. I followed the debugger down to GetTableField and the luTable element appears to be correct but the Display Name fields is not in the dictionary list and I think that is why it is returning nil.
It appears that The Display Name field (text) added when checking the "Use Display Name" is not in the dictionary.
Dialogue Database - The Quest
- Name: TutorialForest-TrollProblem
- Use Display Name: True (checked)
- Display Name: Another troll... (also tried it without the ...)
Code to pull up the quest title
Code: Select all
string questTitle = QuestLog.GetQuestTitle("TutorialForest-TrollProblem");
"TutorialForest-TrollProblem"
I was expecting the display name "Another troll..." instead.
How to fix?
Do I need to add "Display Name" to the quest template? When "Use Display Name" is checked it adds a display name field (text) to the DB UI. Does the "Display Name" field need to be set to localization instead of text? I ask that because the GetQuestTitle function is using the following:
Code: Select all
var title = DialogueLua.GetLocalizedQuestField(questName, "Display Name").asString;
Code: Select all
DialogueLua.GetLocalizedQuestField("TutorialForest-TrollProblem", "Display Name").asString;