However, in some cases you may need to include variable content in the message.
For example, say you want to show a message that the current conversant has joined the party. For example in English, it might look like:
"Tony Joined Party"
One way to do this using the ShowAlert() Lua functions is:
Code: Select all
ShowAlert(Variable["Conversant"] .. " " .. GetTextTableValue("Joined Party")
If another language uses a different type of word order -- such as "Ymunodd Tony â'r Blaid" in Welsh -- you will need to handle it differently. In this case, you can write a C# method such as:
Code: Select all
void ShowConversantJoinedParty()
{
string formatString = DialogueManager.GetLocalizedText("Conversant Joined Party");
string message = string.Format(formatString, DialogueLua.GetVariable("Conversant").asString);
DialogueManager.ShowAlert(message);
}
- English: "{0} Joined Party"
- Welsh: "Ymunodd {0} â'r Blaid"