Page 1 of 1
Changing character portrait
Posted: Tue Jul 05, 2022 4:39 pm
by sanmaow
Having trouble changing character portrait during conversation. I am using the SetPortrait(actorName, textureName) sequence function. I first tried directly putting the portrait sprite name, and the console returned a not found message. I did realize that the parameter requires a path to a texture inside the resources folder, but I don't know the correct syntax for stating a path for Lua, I tried using "/" and still getting the not found message. Also stating the path every time seems error prone, can anyone explain how to define multiple portrait images in the database?
Re: Changing character portrait
Posted: Tue Jul 05, 2022 6:02 pm
by Tony Li
Hi,
The easiest way is to assign the portraits to the actor in the Dialogue Editor's Actors section. Each portrait will a have a number (1, 2, 3, etc.). Then use [pic=#] in a dialogue entry node's Dialogue Text to use the specified portrait for only that node. To change it ongoing, use the SetPortrait() sequencer command (it's not a Lua function) with pic=# as the second parameter. For example, if you want to change the actor named Fred to portrait #2:
Code: Select all
{{default}}; // Also play Dialogue Manager's Default Sequence.
SetPortrait(Fred, pic=2)
Re: Changing character portrait
Posted: Wed Jul 06, 2022 12:07 pm
by sanmaow
Where exactly is the Dialogue Editor's Actor section? Is it the actors section in the database, or the actors tab when editing a conversation, in either cases I don't see an option to upload/drop sprites.
Re: Changing character portrait
Posted: Wed Jul 06, 2022 12:08 pm
by sanmaow
Neverminded, I've found it