Hi Tony
If I add a localize field like "Name zh-CN" and tick the "main" checkbox in actor template, it won't show the localize field in the actor editor, not like the "Display Name zh-CN".
Is there any special way to localize actor name? tks
How to localize actor name?
Re: How to localize actor name?
In general, you should localize the Display Name, not the Name field. Is there a reason you want to localize the Name field? Perhaps I can suggest a different approach.
Side note: There's a small bug in the current DS version's Dialogue Editor that doesn't show "Name xx" fields in the main section even if you've ticked the template's Main checkbox. It'll be fixed in 2.2.45.
Side note: There's a small bug in the current DS version's Dialogue Editor that doesn't show "Name xx" fields in the main section even if you've ticked the template's Main checkbox. It'll be fixed in 2.2.45.
Re: How to localize actor name?
For example, let's say there's an actor named "Joe Smith", and he is a teacher, so I set his diaplay name to "Teacher Smith" (yeh, I know, more like a nick name, but it makes player much easier to remember his role)
In my game, the subtitle (dialogue entry) uses display name, so the subtitle will display "Teacher Smith".
However, sometimes I need show this actor's name more formly, for instance, in his resume, or profile. So I will use the Name field.
Nevertheless, it is ok to use fields to assign nick name, etc, but another problem is that to get the actor's name (not from conversationModel), there is only one property "localizedName", and that points to the actor Name, not the display name.
So I guess I need to develop my own method/property to to get localized display name, just curious if we can get direct access to the localized display name from Actor class
In my game, the subtitle (dialogue entry) uses display name, so the subtitle will display "Teacher Smith".
However, sometimes I need show this actor's name more formly, for instance, in his resume, or profile. So I will use the Name field.
Nevertheless, it is ok to use fields to assign nick name, etc, but another problem is that to get the actor's name (not from conversationModel), there is only one property "localizedName", and that points to the actor Name, not the display name.
So I guess I need to develop my own method/property to to get localized display name, just curious if we can get direct access to the localized display name from Actor class
Re: How to localize actor name?
It's fine to localize the Name field, and 2.2.45 will show localized Name fields in the main section. I just wanted to make sure there wasn't a better approach.
To get the localized Display Name field, use DialogueLua.GetLocalizedActorField("name", "Display Name").asString, where "name" is the actor's Name. You can write a function or two if you want:
To get the localized Display Name field, use DialogueLua.GetLocalizedActorField("name", "Display Name").asString, where "name" is the actor's Name. You can write a function or two if you want:
Code: Select all
public string GetLocalizedDisplayName(Actor actor)
{
return DialogueLua.GetLocalizedActorField(actor.Name, "Display Name").asString;
}
Re: How to localize actor name?
Thank you Tony
Re: How to localize actor name?
Glad to help!