Lines without actor prefix (using ink integration)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

Lines without actor prefix (using ink integration)

Post by NotVeryProfessional »

Not sure if this is specific to the ink integration, probably not, but probably yes because I'm using the Actor prefix option (instead of the #Actor= tags)


I'd like to have lines with a "(actor): blabla" prefix, for narration lines.

Note that I am using a shared UI with only one subtitle panel for all, and I want to turn off the actor prefix ONLY for one specific actor (which I have named "Narrator" for now, and if it's much work I'll go with that, but it would just be more beautiful if I could have those lines without any prefix:
Bildschirmfoto 2021-05-19 um 18.29.36.png
Bildschirmfoto 2021-05-19 um 18.29.36.png (122 KiB) Viewed 241 times
I've tried with an empty DisplayName, but that doesn't work.
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Lines without actor prefix (using ink integration)

Post by Tony Li »

Hi,

You can turn off other actor prefix features and add the prefix in a script that has an OnConversationLine method. For example, add a script with this method to the Dialogue Manager:

Code: Select all

using PixelCrushers.DialogueSystem;
...
void OnConversationLine(Subtitle subtitle)
{
    if (subtitle.speakerInfo.nameInDatabase != "Narrator")
    {
        // If not the Narrator, prepend the actor's current display name:
        subtitle.formattedText.text = $"{subtitle.speakerInfo.Name}: {subtitle.formattedText.text}";
    }
}
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

Re: Lines without actor prefix (using ink integration)

Post by NotVeryProfessional »

Alright. I think I finally got it. Sorry for being such a bother, but I get that using OnConversationLine() you can essentially do whatever pre-processing you need. Incredibly powerful tool. I think the documentation doesn't do the sheer power of the Dialogue System justice. This is an utterly amazing package, one of the best I've ever bought.
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Lines without actor prefix (using ink integration)

Post by Tony Li »

Thanks!
Post Reply