Get Localized Display name through code

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
forrestuv
Posts: 64
Joined: Tue Nov 06, 2018 11:28 am

Get Localized Display name through code

Post 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)
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Get Localized Display name through code

Post 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");
Post Reply