Page 1 of 2

SetPortrait not working when UseDisplayName is checked

Posted: Wed Mar 15, 2023 10:55 am
by Kit
Hi!

I've run into an issue where the sequencer command SetPortrait doesn't work when Use Display Name is checked.

Fx. I have an actor who is set up as "Paladin" but their display name is "Mark". Whenever I want to use a display name, the portrait doesn't change. I've tried using the method both with the actor name and display name as such:

SetPortrait(Paladin,pic=3);
SetPortrait(Mark,pic=3);

I can't seem to get it to work at all. As long as I don't use a display name, everything works fine. I can't figure out if I'm somehow missing something somewhere?

Re: SetPortrait not working when UseDisplayName is checked

Posted: Wed Mar 15, 2023 11:50 am
by Tony Li
Hi,

A fix for that is in version 2.2.35, which should be available this week. In the meantime, here's the patch:

DS_SetPortraitPatch_2023-03-15.unitypackage

Re: SetPortrait not working when UseDisplayName is checked

Posted: Thu Mar 16, 2023 5:24 am
by Kit
I downloaded it, but it doesn't seem to have fixed my problem. The portraits still won't change when an actor has a display name.

I dragged and dropped the package into the pixel crusher folder in my project and it seems to have replaced the old sequencer script automatically. Was that not the correct way to do it?

Re: SetPortrait not working when UseDisplayName is checked

Posted: Thu Mar 16, 2023 8:36 am
by Tony Li
I think that should have worked. I usually select menu item Assets > Import Package > Custom Package and select the .unitypackage file, but I think dropping the file into the Project view should work, too.

Can you send a reproduction project to tony (at) pixelcrushers.com?

Re: SetPortrait not working when UseDisplayName is checked

Posted: Thu Mar 16, 2023 9:54 am
by Kit
I can't send the project because it's for a company I'm interning for. We will try to wait for the update to be pushed and see if the next version update will fix it. Sorry for the inconvenience.

Thank you for your help!

Re: SetPortrait not working when UseDisplayName is checked

Posted: Mon Mar 20, 2023 9:10 am
by Kit
Hi again!

Updated to the new version and it still doesn't seem to work for me. Is there any information I can give you that might help to figure out what the issue is?

All my portraits are in "Portrait Sprites" while "Portrait Textures" is empty. I tried putting them into textures as well, but that didn't seem to fix anything.

Here's an example of how I have it set up:
Image

Re: SetPortrait not working when UseDisplayName is checked

Posted: Mon Mar 20, 2023 11:29 am
by Tony Li
Hi,

Here's an example scene:

DS_SetPortraitTest_2023-03-20.unitypackage

It's DemoScene1, but Private Hart's Display Name is Mark. His second line of dialogue changes his portrait image using SetPortrait(). I assigned Portrait Textures because that's what the original actor uses, but it works the same with Portrait Sprites.

Re: SetPortrait not working when UseDisplayName is checked

Posted: Tue Mar 21, 2023 9:50 am
by Kit
I tried your scene in an older version of our project and it works perfectly. I'm not sure what the problem in my project might be, but if I figure it out I'll let you know.

Re: SetPortrait not working when UseDisplayName is checked

Posted: Tue Mar 21, 2023 10:16 am
by Tony Li
Sounds good. Maybe you have a script with an OnConversationLine() method that changes the portrait, or a subclass of StandardUISubtitlePanel. You could try searching your code for "OnConversationLine" or ": StandardUISubtitlePanel".

Re: SetPortrait not working when UseDisplayName is checked

Posted: Wed Mar 22, 2023 9:07 am
by Kit
I figured out what the problem was! It was me.

I completely forgot that the Sequencer is played after the node finished. I only had 2 nodes in my conversation, one for each character, so the portraits never got to change.

My bad! Thank you again for all the help!