Alternate portrait not registering

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 20788
Joined: Thu Jul 18, 2013 1:27 pm

Re: Alternate portrait not registering

Post by Tony Li »

Hi,

Great! Now it's just a matter of configuring it to work exactly the way you want.

At what point do you want the player's portrait to change? Keep in mind that the SetPortrait() command will take effect in the next response menu.

Take the conversation below for example. Let's say the default portrait is a happy face, and portrait #2 is a grumpy face.
  • [0] NPC: "How's it going?"
    • [1] Player: "Grrr, I'm grumpy." { Sequence: SetPortrait(Player,pic=2) }
      • [2] NPC: "Sorry to hear it. Want some ice cream?"
        • [3] Player: "Harrumph! Well... okay."
This conversation has two player response menus, on dialogue entry nodes [1] and [3]. The menu for [1] will use the default portrait (happy face). When the player selects node [1] (and not before), node [1] will execute its Sequence, which will record portrait #2 as the current portrait image. When the menu appears again for [3], it should use portrait #2.

If you want menu [1] to use a grumpy face, you'll need to move the SetPortrait(Player,pic=2) command earlier, such as in node [0].
Laurie_CF
Posts: 10
Joined: Sat Aug 13, 2016 3:31 pm

Re: Alternate portrait not registering

Post by Laurie_CF »

Hi Tony,

Sorry, I think I wasn't quite clear. The SetPortrait() command only worked when Show PC Subtitles During Line was ticked. Once I untick it, the portraits remain unchanging, no matter where the command is placed.

But when Show PC Subtitles During Line is ticked, the dialogue system does not work as intended and effectively shows each message twice, and the portrait only changes on the second time.

And thanks for the clarification on where to put the sequence, that makes sense.

Thank you!
User avatar
Tony Li
Posts: 20788
Joined: Thu Jul 18, 2013 1:27 pm

Re: Alternate portrait not registering

Post by Tony Li »

Hi,

Try assigning the same PC portrait image UI element to Response Menu > PC Image. So it should be assigned to PC Subtitle > Portrait Image and Response Menu > PC Image.
Laurie_CF
Posts: 10
Joined: Sat Aug 13, 2016 3:31 pm

Re: Alternate portrait not registering

Post by Laurie_CF »

Hi Tony, looking forward to trying this.

I think perhaps our UI structure might be a bit off, as I'm not seeing the objects you're mentioning. Here's mine:
Screen Shot 2016-08-17 at 12.40.30.png
Screen Shot 2016-08-17 at 12.40.30.png (63.26 KiB) Viewed 1361 times
(I'm sorry my screenshots are always too big, retina display)

I'm not sure which template our UI was built from, but I think it was one of the JRPG ones. Are we missing something to have these features working?

Thanks as always
User avatar
Tony Li
Posts: 20788
Joined: Thu Jul 18, 2013 1:27 pm

Re: Alternate portrait not registering

Post by Tony Li »

I think it should still work with your current UI structure.

Inspect PerpetualNight Dialogue UI with Continue Button. Under Dialogue > Response Menu, locate the field named PC Image. Make sure the child GameObject Portrait Image is assigned to PC Image.

If it's already set that way, please let me know.
Laurie_CF
Posts: 10
Joined: Sat Aug 13, 2016 3:31 pm

Re: Alternate portrait not registering

Post by Laurie_CF »

Hi Tony,

It seems to be correct:
Screen Shot 2016-08-17 at 14.18.08.png
Screen Shot 2016-08-17 at 14.18.08.png (223.81 KiB) Viewed 1359 times
User avatar
Tony Li
Posts: 20788
Joined: Thu Jul 18, 2013 1:27 pm

Re: Alternate portrait not registering

Post by Tony Li »

Hmm, I'm out at a customer site at the moment, but when I get back to the office (in about 6 hours), I'll give it a test with the same UI structure.

As a test, does it work correctly if you temporarily switch to a different UI such as the legacy Circle UI or the Generic Unity UI?
Laurie_CF
Posts: 10
Joined: Sat Aug 13, 2016 3:31 pm

Re: Alternate portrait not registering

Post by Laurie_CF »

Hi Tony,

That would be great, thank you. Though I'm increasingly feeling that there must be something interfering on my end, rather than a problem with DSfU. Thank you for trying though!

The issue remained when testing Circle UI, and I tried a few Generic Unity UIs, but they didn't seem to feature PC portraits.
User avatar
Tony Li
Posts: 20788
Joined: Thu Jul 18, 2013 1:27 pm

Re: Alternate portrait not registering

Post by Tony Li »

If the issue remained with the other UIs, it's probably not a UI issue. Unfortunately, I don't know how to reproduce it. Here's an example scene that uses a UI structure similar to your screenshot:

Test_Laurie_CF_2016-08-17.unitypackage

I built it in Unity 5.3.4. (I forgot to ask you what version of Unity you're using.) It imports into a folder named "Test".

If you play the scene, it will start a conversation right away. After the first player response menu, the next NPC line will change the player's portrait. The second player response menu will show a different player portrait (with a red guy instead of the trooper model portrait).

If that doesn't shed any light on the issue, would it be possible for you to send a pared-down example scene to tony (at) pixelcrushers.com? Even if it doesn't include any graphics assets or other content, as long as it can demonstrate the issue it should help me get to the bottom of it.
Post Reply