Page 1 of 1

Select the diferent portrait to expressions

Posted: Tue Jul 21, 2015 10:51 am
by alfonso
Hi i notice that you can add to the actors various portrait, but how can i select it for a defined node? the idea is to express emotions feelings (angry, happy ...) in each node.

my first iteration was to put a variable inside the node "faceType" if is empty use the normal face, otherwise use the defined. (dont know if exist a easier way to do that) the "faceType" variable is hidding in "All Fields", is any way to put up with the rest, like translations?

Thanks :)

Re: Select the diferent portrait to expressions

Posted: Tue Jul 21, 2015 4:06 pm
by Tony Li
Hi,

It's much easier than that. When you add portrait images to an actor in the dialogue database, each image has a number (1, 2, 3,...).

In the node, use the "[pic=#]" tag in your Dialogue Text. For example, say image #2 is an angry face. Use this Dialogue Text:

Dialogue Text: "[pic=2] I'm very angry at you!"

If you use translations, put "[pic=2]" in each translation text.

This will only take effect for one node. If you want to permanently change the actor's portrait, use the SetPortrait() sequencer command instead.

Re: Select the diferent portrait to expressions

Posted: Wed Jul 22, 2015 5:28 am
by alfonso
mmm interesting and is possible to add a enum in the Dialogue Entry with the list of faces and show the selected one?

Re: Select the diferent portrait to expressions

Posted: Wed Jul 22, 2015 9:26 am
by Tony Li
That's a good idea! I'll look into adding this feature in the next version. If you need it before then, you can modify the source code yourself. You'd need to edit Scripts/Core/Editor/Dialogue Editor/DialogueEditorWindowDialogueTreeSection.cs.

If you don't want to modify the source code (which can be complicated), you could add a custom field type. You could define a dropdown with elements such as "Happy", "Angry", etc. In this case, you'd want to assign the Happy image to all actors as pic #1, Angry as pic #2, etc. You'd still need to do a step at runtime to look up the value of this field and set the right image.