QuestLog.GetQuestTitle is not returning display name
Posted: Sat Mar 26, 2022 12:00 am
I have a question about QuestLog.GetQuestTitle and the "Use Display Name" toggle in the quest/item area. I'm using the special quest names to sort them into groups in the dialogue DB UI, so those names are not desired for display in the game quest UI.
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
Code to pull up the quest title
Result
"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:
I also tried accessing the field like this:
That returns an empty string.
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;