Dialogue Actor portrait and actor name not used until actor's first line
Posted: Tue May 10, 2022 5:18 pm
Hi Tony,
In my game I create conversation in the dialogue editor with placeholder actors, by placeholder actors I mean I created 2 actors, "Player" and "NPC" with dummy display name "Player-Name" with dummy portrait (a banana image) and "NPC-Name" with dummy portrait (an apple image).
The reason for this is I want to override these placeholder actors' info by having a Dialogue Actor component assigned to each actual NPC (and my Player) in my game scene, and I have script to update the display name and portrait sprite field in the Dialogue Actor at run time (start of game) by using Player and NPC's real info (so that I don't have to go and find all of the sprites for each actor during conversation creation time, where some of the NPC sprites might not be created yet).
The dialogue UI I use is the Standard Dialogue UI, the prefab called OldSchool IIRC, with 2 Standard UI Subtitle Panels on each side, left side if NPC, right side is Player.
The issue I have here is, whenever I start a conversation through script by using the DialogueManager.Instance.StartConversation, pass in player's transform and NPC's transform, the portrait and display name is not updated, until actor's first line come up.
For example, if the conversation starts with the Player saying "Hi" first, then in the dialogue UI, the Player's display name and the portrait are set to what the Player's Dialogue Actor's actor name and portrait sprite is correctly, but the NPC's display name is still "NPC-Name" and the portrait is an apple. The NPC's name and portrait only get updated to what the Dialogue Actor defines on NPC's first line, for example, after Player says "Hi", NPC replies with "Hello", and that is when the NPC's display name and portrait get set to whatever the NPC's Dialogue Actor component defines.
Is there a way to update the Standard Dialogue UI to scan and use whatever the actor's Dialogue Actor defines on the beginning of the whole conversation, not at the time when actor's first line come up?
Thanks in advance.
In my game I create conversation in the dialogue editor with placeholder actors, by placeholder actors I mean I created 2 actors, "Player" and "NPC" with dummy display name "Player-Name" with dummy portrait (a banana image) and "NPC-Name" with dummy portrait (an apple image).
The reason for this is I want to override these placeholder actors' info by having a Dialogue Actor component assigned to each actual NPC (and my Player) in my game scene, and I have script to update the display name and portrait sprite field in the Dialogue Actor at run time (start of game) by using Player and NPC's real info (so that I don't have to go and find all of the sprites for each actor during conversation creation time, where some of the NPC sprites might not be created yet).
The dialogue UI I use is the Standard Dialogue UI, the prefab called OldSchool IIRC, with 2 Standard UI Subtitle Panels on each side, left side if NPC, right side is Player.
The issue I have here is, whenever I start a conversation through script by using the DialogueManager.Instance.StartConversation, pass in player's transform and NPC's transform, the portrait and display name is not updated, until actor's first line come up.
For example, if the conversation starts with the Player saying "Hi" first, then in the dialogue UI, the Player's display name and the portrait are set to what the Player's Dialogue Actor's actor name and portrait sprite is correctly, but the NPC's display name is still "NPC-Name" and the portrait is an apple. The NPC's name and portrait only get updated to what the Dialogue Actor defines on NPC's first line, for example, after Player says "Hi", NPC replies with "Hello", and that is when the NPC's display name and portrait get set to whatever the NPC's Dialogue Actor component defines.
Is there a way to update the Standard Dialogue UI to scan and use whatever the actor's Dialogue Actor defines on the beginning of the whole conversation, not at the time when actor's first line come up?
Thanks in advance.