Page 1 of 1
Change portrait to an image from another actor's portrait?
Posted: Sun Jul 23, 2017 10:06 am
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.
Re: Change portrait to an image from another actor's portrait?
Posted: Sun Jul 23, 2017 11:46 am
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.
Re: Change portrait to an image from another actor's portrait?
Posted: Wed Jul 26, 2017 5:53 pm
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.
Re: Change portrait to an image from another actor's portrait?
Posted: Wed Jul 26, 2017 8:34 pm
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:
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.
Re: Change portrait to an image from another actor's portrait?
Posted: Thu Jul 27, 2017 8:59 am
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.
Re: Change portrait to an image from another actor's portrait?
Posted: Thu Jul 27, 2017 9:16 am
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=#].