Custom EntryTag provider

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
nehvaleem
Posts: 93
Joined: Tue Sep 10, 2019 4:52 am

Custom EntryTag provider

Post by nehvaleem »

Hi,

I'll try to be brief this time. Is it possible to customize the way that EntryTag is being constructed? It would be awesome if we could override it somehow.

My use case:
I have a lot of ink content written already. Each line has a custom tag (for localization purposes). It is unique for each line. It would be awesome if I could somehow create an EntryTag for my lines (for example in subclass of DialogueSystem) and then make it just work with all the Sequencer commands.

It will be tedious for me to add other tags or Sequencer calls for every line that I have just in order to play VoiceOver file for example.

I am a bit confused by the DialogueEntry vs Subtitle classes. It seems that there is something like ProcessTag with DialogueEntry being passed to, but I don't see a way how to modify the subtitle entrytag. Probably doing something wrong - it would be great if I could get any suggestion about how to handle my case.
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom EntryTag provider

Post by Tony Li »

Hi,

I think I can add an option to provide your own entrytag provider. Essentially you'd assign something like DialogueManager.entrytagProvider a method like this:

Code: Select all

DialogueManager.entrytagProvider = MyCustomEntrytagProvider;

string MyCustomEntrytagProvider(Conversation conversation, DialogueEntry entry)
{
    return //(figure out how to use conversation & entry to generate an entrytag)
}
However, before I commit to that, I'll want to take a look at how this will work with the Ink integration. For the Ink integration, It may be better to add an option so that DialogueSystemInkIntegration.OnConversationLine sets the dialogue entry's VoiceOverFile field to some tag. Then you can set the Dialogue Manager's Entrytag Format to VoiceOverFile.
nehvaleem
Posts: 93
Joined: Tue Sep 10, 2019 4:52 am

Re: Custom EntryTag provider

Post by nehvaleem »

In my case the thing with DialogueSystemInkIntegration.OnConversationLine is that it has stripped out & modified contents because of the OnPrepareConversationLine when I do some stuff before actually displaying it. So in my case, the data needed to form the EntryTag in OnConversationLine is gone. It might be something that I could handle differently probably tho.
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom EntryTag provider

Post by Tony Li »

How are you specifying the voiceover tags? I'll set up a similar test over here to play with some ideas.
nehvaleem
Posts: 93
Joined: Tue Sep 10, 2019 4:52 am

Re: Custom EntryTag provider

Post by nehvaleem »

This is how my typical ink line looks like:

Code: Select all

Ishida: Bunzō? And who's that? # LineTag_01_village_0455_6C810D78_Ishida
And then in OnPrepareConversationLine I am extracting the LineTag, fetch translated content and replacing the line contents with the localized version. I would love to use this exact same tag as entrytag for my lines.
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom EntryTag provider

Post by Tony Li »

I think you can make a subclass that overrides the ProcessTag() method. Something like:

Code: Select all

public class CustomDialogueSystemInkIntegration : DialogueSystemInkIntegration
{
    protected override void ProcessTag(string tag, DialogueEntry entry)
    {
        if (tag.StartsWith("LineTag"))
        {
            Field.SetValue(entry.fields, "VoiceOverFile", tag);
        }
        else        
        {
            base.ProcessTag(tag, entry);
        }
    }
}
Then set the Dialogue Manager's Entrytag Format to VoiceOverFile.
nehvaleem
Posts: 93
Joined: Tue Sep 10, 2019 4:52 am

Re: Custom EntryTag provider

Post by nehvaleem »

That seems wonderful and suits my case perfectly I think! I'll try that right away, thank you again. Although maybe consider adding a customization for EntryTags in the future. Maybe it would help somebody else.
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom EntryTag provider

Post by Tony Li »

Will do. I added it to the task list.
Post Reply