Changing portrait of NPC during dialogue to alternative

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Maltakreuz
Posts: 40
Joined: Sat Jul 25, 2015 2:36 pm

Changing portrait of NPC during dialogue to alternative

Post by Maltakreuz »

It is possieble in Inspector of Actors to add more then one PortraitTexture with + symbol. But how do change NPC-portrait during the conversation?

Probably somehow to assign portrait_index = 2 from Script. But i can not find anything about alternative portrait in docs. How to achive that?

I have tryed

Code: Select all

Actor["Rivatha_the_Archer"].Pictures = "2"
but it does not work.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Changing portrait of NPC during dialogue to alternative

Post by Tony Li »

Hi,

To use a different portrait image for a single dialogue entry, include a [pic=#] markup tag in the Dialogue Text.

To change to a different portrait image for the duration of the conversation, use a SetPortrait() sequencer command in the Sequence field.
Maltakreuz
Posts: 40
Joined: Sat Jul 25, 2015 2:36 pm

Re: Changing portrait of NPC during dialogue to alternative

Post by Maltakreuz »

Thank you, it works! Even with spaces in Actor name.

If you say for duration... so it will also be saved / loaded by SaveSystem?
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Changing portrait of NPC during dialogue to alternative

Post by Tony Li »

Hi,

No, only for the current conversation. If you want to save it in the save system, you can do that separately.

The exception is if you have used the SetPortrait() sequencer command to specify a portrait image that's not in the actor's portraits list.
  • SetPortrait(Bob, pic=2): Will make Bob use portrait 2 in its portraits list for the duration of the conversation.
  • SetPortrait(Bob, default): Will make Bob use its default portrait 1 for the duration of the conversation.
  • SetPortrait(Bob, SpecialImageXYZ): Will load a sprite named "SpecialImageXYZ" from a Resources folder, asset bundle, or Addressables and use it until changed. Will be included in the save system. This is because this is the only reference to the image since it's not in the portraits list.
Post Reply