Hi,
Z4kk wrote: ↑Mon May 01, 2023 3:50 pmI have a question regarding barks. Since I use a separate portrait for barks, I tried passing the portrait using the sequence command "
SetPortrait(ActorName, pic=2)" to the `
START` node of the conversation containing the barks, but without success.
In the case of barks, SetPortrait() takes effect after the command is run, and doesn't take effect in <START> nodes. So if you use SetPortrait() in one of the bark nodes, it will only appear the second time the character barks. One way to change this behavior is to make a subclass of StandardBarkUI and use the subclass on your character in place of StandardBarkUI. (See
this post for tips on replacing with subclasses.)
In general, if you're ever tempted to directly modify any Dialogue System script, make a subclass or use an event hook instead. That way you won't lose your customizations when you update the Dialogue System.
In the case of a StandardBarkUI subclass, you can override Bark() method to set the NPC to portrait 2:
Code: Select all
public class MyBarkUI : StandardBarkUI
{
public override void Bark(Subtitle subtitle)
{
base.Bark(subtitle);
var actor = DialogueManager.masterDatabase.GetActor(subtitle.speakerInfo.id);
portraitImage.sprite = actor.GetPortraitSprite(2);
}
}
Z4kk wrote: ↑Mon May 01, 2023 3:50 pmI'm also wondering about the use of Sprite Portraits and Texture Portraits - which portrait index is used?
Texture Portraits if present; otherwise Sprite Portraits. This is primarily for compatibility with older projects that predated the Sprite type. Nowadays, just assign Sprites to the Sprite Portraits list and leave Texture Portraits blank.