Page 1 of 1
Changing portrait of NPC during dialogue to alternative
Posted: Thu Dec 09, 2021 7:09 pm
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.
Re: Changing portrait of NPC during dialogue to alternative
Posted: Thu Dec 09, 2021 8:25 pm
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.
Re: Changing portrait of NPC during dialogue to alternative
Posted: Fri Dec 10, 2021 5:02 am
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?
Re: Changing portrait of NPC during dialogue to alternative
Posted: Fri Dec 10, 2021 9:38 am
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.