How to access string text inserted as replacement for [var=xxx] in dialogue text?
Posted: Fri Apr 29, 2022 12:14 pm
Hi Toni,
I have a variable "mRaceDaysUntilSunday" which is e.g. "Two"
It's value is set by a script with DialogueLua.SetVariable("mRaceDaysUntilSunday", mRaceDaysUntilSunday);
The dialogue nodes' text is "[var=mRaceDayToday]"
During the dialogue, the user gets to a response panel, showing 3 choices, that have these dialogue texts':
1. [var=mRaceDayToday], e.g. "Two"
2. [var=mRaceDayWrong1], e.g. "Three"
3. [var=mRaceDayWrong2], e.g. "Four"
-> those response texts have to be dynamic because the answer changes depending on which day is today in real life.
Now, in the response menu, I have a button for each response choice that reads out loud what the response text says via speech synthesis.
And here is my problem: when accessing the responses' text, DSFU returns me e.g. "[var=mRaceDayToday]" (the variable placeholder) instead of the "real" text that the variable is replaced with (in my example e.g. "Two"). Of course I would need the actual value, not the variable name for speech synthesis (and typewriter rewrite effect) to work. I tried fetching the response text with
"string text = DialogueManager.masterDatabase.GetDialogueEntry(conversation.id, entry.id).responseButtonText;"
or other variables that are offered by GetDialogueEntry but with no luck.
How to I access the text that is inserted as replacement for the [var=xxx] ?
Thanks, Michael
I have a variable "mRaceDaysUntilSunday" which is e.g. "Two"
It's value is set by a script with DialogueLua.SetVariable("mRaceDaysUntilSunday", mRaceDaysUntilSunday);
The dialogue nodes' text is "[var=mRaceDayToday]"
During the dialogue, the user gets to a response panel, showing 3 choices, that have these dialogue texts':
1. [var=mRaceDayToday], e.g. "Two"
2. [var=mRaceDayWrong1], e.g. "Three"
3. [var=mRaceDayWrong2], e.g. "Four"
-> those response texts have to be dynamic because the answer changes depending on which day is today in real life.
Now, in the response menu, I have a button for each response choice that reads out loud what the response text says via speech synthesis.
And here is my problem: when accessing the responses' text, DSFU returns me e.g. "[var=mRaceDayToday]" (the variable placeholder) instead of the "real" text that the variable is replaced with (in my example e.g. "Two"). Of course I would need the actual value, not the variable name for speech synthesis (and typewriter rewrite effect) to work. I tried fetching the response text with
"string text = DialogueManager.masterDatabase.GetDialogueEntry(conversation.id, entry.id).responseButtonText;"
or other variables that are offered by GetDialogueEntry but with no luck.
How to I access the text that is inserted as replacement for the [var=xxx] ?
Thanks, Michael