Page 1 of 1

Get Localized Display name through code

Posted: Mon Apr 24, 2023 2:53 pm
by forrestuv
Hi,
I'm trying to get localized version of DisplayName through code but I can't figure out why

Code: Select all

actor.LocalizedName
doesn't return the "Display Name en" field. (the language code is correct and letter case is correct)
I saw that the LookupValue() function is searching for a field named "Name"...shouldn't it be "Display Name"?it returns null.

("Use Display Name" is ticked)

Re: Get Localized Display name through code

Posted: Mon Apr 24, 2023 4:07 pm
by Tony Li
Actor.localizedName returns the localizsed version of the Name field, if it exists. Use this instead:

Code: Select all

string localizedDisplayName = DialogueLua.GetLocalizedActorField(actor.Name, "Display Name");