Page 1 of 1

Actor Names localization not updating after import

Posted: Tue Feb 18, 2025 7:31 am
by windwalking
Hi there,

We are having a recurring issue where, after doing imports into the database, the actor names localization doesn't work for the new languages. The only way to get it to work is to change the actor names to *completely new* ones that were not used before. We are wondering if somehow this data is persisted elsewhere and it's not being synced.

I have attached screenshots, you can see that it falls back to the actor name and not the display name. We have also tried changing the display name information directly but it also doesn't reflect unless we change the actor name to something completely new.

Any help on how to force update this would be great!

Re: Actor Names localization not updating after import

Posted: Tue Feb 18, 2025 7:37 am
by Tony Li
Hi,

From what source are you importing the localization/database?

In your last screenshot (Screenshot 2025-02-18 143414.png), is the issue that the localizations for fr, de, it, etc., blank? Or that the other ones such as ja, en, and zh-Hans are now appearing in-game?

Re: Actor Names localization not updating after import

Posted: Tue Feb 18, 2025 7:41 am
by windwalking
Hi Tony,

We are importing via csv. The issue is that the older languages : en and ja appear correctly. But the new values for zh-Hans and zh-Hant are falling back to the actor name instead of the display name.

Re: Actor Names localization not updating after import

Posted: Tue Feb 18, 2025 7:55 am
by Tony Li
What CSV are you using? The Localization Export/Import section of the Dialogue Editor's Database tab?

Could it be an issue with the '-' in the localization code? It shouldn't be a problem, but it's something to check. If you provide a new translation for "fr", does that work?

Re: Actor Names localization not updating after import

Posted: Tue Feb 18, 2025 8:17 am
by windwalking
Yes, we are using the built-in export/import section.

The issue happens with all new changes. It also occurs with fr and other languages; it will simply fall back to the actor name. It also happened when we did the Japanese import earlier and the only way around was to create new actors.

If I make a change to the existing japanese or english display names, it won't reflect in the UI either. It's as if once the actor was created with whatever localization present at the time, it will always remain regardless of any updates either via import or directly via editor.

Re: Actor Names localization not updating after import

Posted: Tue Feb 18, 2025 8:34 am
by windwalking
I may have found the root cause. There is a setting to include actor data in the persistent data settings which causes it to ignore what is in the database. I guess this may make sense if we are changing the actor data during runtime but we are not.

If I create a new save file then I see the new data correctly. But we have players already playing and would rather avoid a new save file. Is there a way to force the save file to be updated from the asset database?

Re: Actor Names localization not updating after import

Posted: Tue Feb 18, 2025 8:47 am
by Tony Li
Was the Dialogue Manager's Persistent Data Settings > Include Actor Data checkbox ticked when the players' old saved games were created? If so, then you're correct that those saved games will contain the old actor data.

In this case, you can hook into the C# event PixelCrushers.SaveSystem.saveDataApplied. This event occurs after the save data has been applied. In your event handler, update the display names. Alternatively, you can make and use a subclass of DialogueSystemSaver and override ApplyDataImmediate() to call base.ApplyDataImmediate() and then update the display names. Example:

Code: Select all

void Awake() => PixelCrushers.SaveSystem.saveDataApplied += OnSaveDataApplied;

void OnSaveDataApplied()
{
    foreach (var actor in DialogueManager.masterDatabase.actors)
    {
        var actorName = actor.Name;
        foreach (var field in actor.fields)
        {
            if (field.title.StartsWith("Display Name"))
            {
                DialogueLua.SetActorField(actorName, field.title, field.value);
            }
        }
    }    
}

Re: Actor Names localization not updating after import

Posted: Tue Feb 18, 2025 12:11 pm
by windwalking
That works! Thank you Sir Tony!

Re: Actor Names localization not updating after import

Posted: Tue Feb 18, 2025 1:59 pm
by Tony Li
Glad to help!