Page 1 of 1

speakerInfo.nameInDatabase returning display name?

Posted: Fri Aug 19, 2022 2:10 pm
by Strook
Hello! I'm using a custom script to modifiy the color of some UI during dialogue (The background of the title of the name of the character)

I'm using:

Code: Select all

subtitle.speakerInfo.nameInDatabase


to get some custom data from the actor, but logging this value, it seems that this always returning the "Display Name" of the character, and not the "Name" value from the database! Is this expected, and if not, is there a way to fix this?

This seems to happens when "Use Display Name" is checked, but Im not sure!


Thanks!

Re: speakerInfo.nameInDatabase returning display name?

Posted: Fri Aug 19, 2022 2:19 pm
by Tony Li
Hi,

That was a bug that was fixed in version 2.2.28.

Since you're locked on an older version for now, you can use subtitle.speakerInfo.id to get the Actor ID instead. Example:

Code: Select all

Actor actor = DialogueManager.masterDatabase.GetActor(subtitle.speakerInfo.id);
string nameInDatabase = actor.Name;

Re: speakerInfo.nameInDatabase returning display name?

Posted: Fri Aug 19, 2022 2:20 pm
by Strook
Ha! that's amazing, thanks a lot!!

Re: speakerInfo.nameInDatabase returning display name?

Posted: Fri Aug 19, 2022 2:43 pm
by Tony Li
Happy to help!