Using Portraits with custom names not index

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Heiden
Posts: 8
Joined: Wed Mar 20, 2019 10:47 pm

Using Portraits with custom names not index

Post by Heiden »

Hi!

I was wondering if there was a way to change Portraits by names I've given them, instead of the index. I have ~128 different expressions for each of my characters (oops;; haha) and it would be a lot easier if I could just name all of them and then do [pic="angryface"] instead of trying to figure out which number it's assigned to.

Thank you!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Portraits with custom names not index

Post by Tony Li »

Hi,

Not exactly. But here are some ideas:

1. Put the portrait files in a Resources folder (or assetbundle if you prefer). You can put them in subfolders by actor name, such as "Resources / Bob / angryface". Then use the SetPortrait() sequencer command, such as:
  • Sequence: SetPortrait(Bob, Bob/angryface)
The difference between [pic=#] in Dialogue Text and SetPortrait() in a Sequence is that SetPortrait() permanently changes the portrait until you change it again with another SetPortrait() command.

2. Or define dialogue database variables with names such as "angryface" and set their numeric values (e.g., 42). Then change the [pic=42] to [pic=[var=angryface]].
DragoonHP
Posts: 62
Joined: Tue Jan 15, 2019 8:17 am

Re: Using Portraits with custom names not index

Post by DragoonHP »

It would be really nice if using custom names for portrait is possible
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Portraits with custom names not index

Post by Tony Li »

I agree. The number system comes from Chat Mapper. The Dialogue System was originally a Unity front-end for Chat Mapper and uses Chat Mapper's data format. In general it's a robust format that's used widely by professional narrative writers. But there are a few areas like this where it's a bit awkward.

Any suggestions about how you'd define those custom names? Would it be sufficient to simply go by the image filename?
DragoonHP
Posts: 62
Joined: Tue Jan 15, 2019 8:17 am

Re: Using Portraits with custom names not index

Post by DragoonHP »

Actors field can have a portrait field array where people can drag in the image and give it a custom name?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Portraits with custom names not index

Post by Tony Li »

I think that should work. When you add a portrait, the name will default to the image filename, but you can change it. I'll add this to the roadmap.
Heiden
Posts: 8
Joined: Wed Mar 20, 2019 10:47 pm

Re: Using Portraits with custom names not index

Post by Heiden »

Oh thank you!!

I think I'll try the SetPortrait() method for now!
And excited to hear that a change has been added to the roadmap!
Post Reply