Change portrait to an image from another actor's portrait?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
thehazard
Posts: 27
Joined: Sun Jul 23, 2017 9:56 am

Change portrait to an image from another actor's portrait?

Post by thehazard »

Hi,

I'm trying to create conversation system where I only want to show the portraits of the actor and not the portrait of the player. So no matter who's talking, the portrait always display that of the actor the main character is talking to. I came across this thread, http://pixelcrushers.com/phpbb/viewtopic.php?f=3&t=742
I'm trying to use the sequence, SetPortrait(Actor2,pic=2), but it's not working for me. I'd appreciate any ideas.
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change portrait to an image from another actor's portrait?

Post by Tony Li »

Hi,

I'll assume you're using Unity UI. If you're using a different GUI system, please let me know.

On the Unity UI Dialogue UI component, tick Dialogue > NPC Subtitle > Always Visible.

If you've ticked the Dialogue Manager's Subtitle Settings > Show PC Subtitles During Line checkbox, unassign Dialogue > PC Subtitle > Portrait Image and Portrait Name, and deactivate the corresponding GameObjects.

If that doesn't get you exactly what you want, let me know how you'd like it to work differently. The Unity UI Dialogue UI is very flexible. Because of this, it can be a little complicated to set up.
thehazard
Posts: 27
Joined: Sun Jul 23, 2017 9:56 am

Re: Change portrait to an image from another actor's portrait?

Post by thehazard »

Thank you for the reply Tony. Yes, I'm using the Unity UI. Is it possible for Actor2 to talk while showing a portrait of Actor3? I know it's strange request, but I'm trying to show the reaction of one character while another speaks.
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change portrait to an image from another actor's portrait?

Post by Tony Li »

Anything is possible with a little scripting. The Dialogue System doesn't lock you into any specific UI behavior. You can write an OnConversationLine method to show the portrait, or make a subclass of UnityUIDialogueUI and and override the ShowSubtitle method, or even provide your own implementation of the simple C# interface IDialogueUI (e.g., using the starter template in Scripts/Templates) if you want to bypass UnityUIDialogueUI and work with Unity UI directly.

However, the easiest way is to add Actor3's image as an alternate portrait for Actor2. Then use the [pic=#] tag to show the image:

Image

If that won't work for your needs, let me know. I'll explain how to implement one of the other methods that I mentioned above.
thehazard
Posts: 27
Joined: Sun Jul 23, 2017 9:56 am

Re: Change portrait to an image from another actor's portrait?

Post by thehazard »

Thanks Tony. I'll just stick to adding Actor3's portrait into Actor2 for now. Doing it the other way may be a little too complicated for me.
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change portrait to an image from another actor's portrait?

Post by Tony Li »

Okay. If using [pic=#] becomes too cumbersome, let me know and I'll describe how to do it the other way. It isn't quite as complicated as I made it sound above, but it's also not as simple as just using [pic=#].
Post Reply