Page 1 of 1
Changing player portraits.
Posted: Fri Feb 08, 2019 10:32 am
by HughDMann
Hi, so I'm using the SetPortrait() function, and am able to get portraits to change. However, the portraits aren't changing immediately, the change doesn't take effect until the next subtitle.
According to the documentation for the SetPortrait() command:
As of version 1.2.4, this command takes visual effect immediately instead of waiting until the next subtitle.
I'm on the newest release, version 2.1.1, so presumably this should be working.
What can I do to get the portrait changes to take effect immediately on the subtitle that they're assigned to?
Thanks.
Re: Changing player portraits.
Posted: Fri Feb 08, 2019 10:46 am
by Tony Li
Hi,
I'll check this today and provide an answer or a fix.
Re: Changing player portraits.
Posted: Fri Feb 08, 2019 11:04 am
by Tony Li
Hi,
Can you provide an example scene?
I haven't been able to reproduce the issue. Here's an example:
Test_SetPanel_2019-02-08.unitypackage
The NPC goes from a green portrait to a red portrait to an anime portrait. The portrait changes happen on the same node that contains the SetPanel() command.
Re: Changing player portraits.
Posted: Fri Feb 08, 2019 12:15 pm
by HughDMann
Hi, thanks for the response.
I can see that the NPC portraits are working as expected. I should have mentioned that I was actually having issues with the Player portaits. When setting up the Player portraits in the same way that the NPCs are setup, and using the JRPG Unity UI Dialogue UI so the Player's portraits are also visible, the Player is not updating until the following subtitle.
For an example of this, I extended the example that you sent and added some lines for the Player attempting to change the portrait using SetPortrait() in the same way.
https://mega.nz/#!iXQAXKbb!aHNTnXsvVbT2 ... WFKzuyzN14
Re: Changing player portraits.
Posted: Fri Feb 08, 2019 3:12 pm
by Tony Li
Thanks for sending that. Let's take a look at this player response entry:
- Dialogue Text: "Player should be red."
- Sequence: SetPortrait(Player,pic=2)
The issue is that the Sequence doesn't run until the player has selected the response. (Otherwise, if it played during the menu and the menu had multiple responses, the Dialogue System wouldn't know which response's sequence to play.) So it won't change the portrait until the player clicks on "Player should be red."
The solution is to move SetPortrait(Player,pic=2) to the previous node's Response Menu Sequence.
Re: Changing player portraits.
Posted: Fri Feb 08, 2019 5:49 pm
by HughDMann
Ok cool, response menu sequence, didn't see that before. Thanks!
Re: Changing player portraits.
Posted: Fri Feb 08, 2019 8:28 pm
by Tony Li
I think the response menu sequence will take care of this.
However, if you still need to change the player's portrait while an NPC subtitle is being displayed, can you use the Standard Dialogue UI instead of the deprecated Unity UI Dialogue UI? There is a JRPG template in Plugins / Pixel Crushers / Dialogue System / Prefabs / Standard UI Prefabs / Templates / JRPG. If you switch to the Standard Dialogue UI version, I think you'll find that it works the way you expect.
The Unity UI Dialogue UI is still supported, but it wasn't designed to distinguish shared UI elements the same way that the Standard Dialogue UI does.