Actor Names localization not updating after import

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
windwalking
Posts: 11
Joined: Tue Mar 26, 2024 6:31 am

Actor Names localization not updating after import

Post 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!
Attachments
Screenshot 2025-02-18 143627.png
Screenshot 2025-02-18 143627.png (50.45 KiB) Viewed 3725 times
Screenshot 2025-02-18 143344.png
Screenshot 2025-02-18 143344.png (411.46 KiB) Viewed 3725 times
Screenshot 2025-02-18 143358.png
Screenshot 2025-02-18 143358.png (413.87 KiB) Viewed 3725 times
Screenshot 2025-02-18 143414.png
Screenshot 2025-02-18 143414.png (80.5 KiB) Viewed 3725 times
User avatar
Tony Li
Posts: 23256
Joined: Thu Jul 18, 2013 1:27 pm

Re: Actor Names localization not updating after import

Post 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?
windwalking
Posts: 11
Joined: Tue Mar 26, 2024 6:31 am

Re: Actor Names localization not updating after import

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

Re: Actor Names localization not updating after import

Post 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?
windwalking
Posts: 11
Joined: Tue Mar 26, 2024 6:31 am

Re: Actor Names localization not updating after import

Post 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.
windwalking
Posts: 11
Joined: Tue Mar 26, 2024 6:31 am

Re: Actor Names localization not updating after import

Post 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?
Attachments
Screenshot 2025-02-18 153617.png
Screenshot 2025-02-18 153617.png (52.18 KiB) Viewed 3700 times
User avatar
Tony Li
Posts: 23256
Joined: Thu Jul 18, 2013 1:27 pm

Re: Actor Names localization not updating after import

Post 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);
            }
        }
    }    
}
windwalking
Posts: 11
Joined: Tue Mar 26, 2024 6:31 am

Re: Actor Names localization not updating after import

Post by windwalking »

That works! Thank you Sir Tony!
User avatar
Tony Li
Posts: 23256
Joined: Thu Jul 18, 2013 1:27 pm

Re: Actor Names localization not updating after import

Post by Tony Li »

Glad to help!
Post Reply