Page 1 of 1

Lines without actor prefix (using ink integration)

Posted: Wed May 19, 2021 12:52 pm
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 258 times
I've tried with an empty DisplayName, but that doesn't work.

Re: Lines without actor prefix (using ink integration)

Posted: Wed May 19, 2021 4:39 pm
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}";
    }
}

Re: Lines without actor prefix (using ink integration)

Posted: Thu May 20, 2021 1:20 am
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.

Re: Lines without actor prefix (using ink integration)

Posted: Thu May 20, 2021 8:44 am
by Tony Li
Thanks!