Page 1 of 1

Scripts/Alerts and Localization

Posted: Mon May 15, 2017 1:56 pm
by chud575
Howdy once more,

so I'm fiddling with your ORK integration and I noticed that you call an alert from the script field

Code: Select all

Variable["Alert"] = "Lost 10 gold, gained 50 faction.";
So my question is - how do hardcoded alerts like these work with localization?

Re: Scripts/Alerts and Localization

Posted: Mon May 15, 2017 3:34 pm
by Tony Li
If you've assigned a localized text table to the Dialogue Manager, it will look for a table entry with the key "Lost 10 gold, gained 50 faction." If it finds one, it'll use the localized version. Otherwise it will show the string directly.

Unlike the Sequence field (which can have localized variants such as "Sequence en" and "Sequence fr"), the Script and Conditions fields don't have localized variants.

If that doesn't meet your needs, you could register your own C# function with Lua, similar to the ShowAlert("string") Lua function, and use it to localize your text before sending it to DialogueManager.ShowAlert().