Celtx - Actor Fields

Announcements, support questions, and discussion for the Dialogue System.
jay
Posts: 13
Joined: Tue Feb 07, 2023 2:03 pm

Celtx - Actor Fields

Post by jay »

Hello,

Is there a way to set Actor Fields within Celtx? Particularly, is there a way to define Actor Sprites?

Thanks!
User avatar
Tony Li
Posts: 22135
Joined: Thu Jul 18, 2013 1:27 pm

Re: Celtx - Actor Fields

Post by Tony Li »

Hi,

Yes. Set the images on your actors in the Celtx catalog.

Then add the same images (exact same name) to your Unity project. During import, the importer will find those images in the Assets folder hierarchy and set the actors' Portrait Sprites fields.
jay
Posts: 13
Joined: Tue Feb 07, 2023 2:03 pm

Re: Celtx - Actor Fields

Post by jay »

Thank you!

Is there also a way to create a new actor field in celtx?
User avatar
Tony Li
Posts: 22135
Joined: Thu Jul 18, 2013 1:27 pm

Re: Celtx - Actor Fields

Post by Tony Li »

Not currently. I could add that. What kind of fields were you thinking of adding to characters?
jay
Posts: 13
Joined: Tue Feb 07, 2023 2:03 pm

Re: Celtx - Actor Fields

Post by jay »

I was considering adding an "InScene" bool and letting Dialogue System listen for the var changing to know when characters come in and out of scenes, to animate their portraits appropriately. (We are creating a system where all characters in a scene are on screen at the same time.) If there is already a way to handle this that I am missing, I would be excited to learn!
User avatar
Tony Li
Posts: 22135
Joined: Thu Jul 18, 2013 1:27 pm

Re: Celtx - Actor Fields

Post by Tony Li »

Hi,

By "in scene," do you mean participating in the conversation, or an actual GameObject in the Unity scene?

If you mean participating in the conversation like this:

Image

then you typically don't need any special fields. It's usually handled with Dialogue Actor components and multiple subtitle panels (one for each portrait image). The Dialogue System Extras page has an example (download).
jay
Posts: 13
Joined: Tue Feb 07, 2023 2:03 pm

Re: Celtx - Actor Fields

Post by jay »

Yup, that's exactly what I meant, thanks so much!
User avatar
Tony Li
Posts: 22135
Joined: Thu Jul 18, 2013 1:27 pm

Re: Celtx - Actor Fields

Post by Tony Li »

The example darkens non-speaking character portraits, but you can have them slide in from the slide or whatever. (I think there's an example of that floating around somewhere.) You can also use AnimatorPlay() sequencer commands to animate the portraits. Tip: Use the special keywords 'speakerportrait' and 'listenerportrait' to refer to the current dialogue entry's speaker and listener portraits; this way you don't need to specify unique GameObject names containing Animator components.
jay
Posts: 13
Joined: Tue Feb 07, 2023 2:03 pm

Re: Celtx - Actor Fields

Post by jay »

Hi Tony,

I'm having a little trouble with the sprite importing. It does not seem like the celtx json is capturing information about the images attached to the Characters.

Image

I am adding an image from Catalog-> Character and exporting the JSON from Script -> Export JSON.

Is this the correct way to do it?
User avatar
Tony Li
Posts: 22135
Joined: Thu Jul 18, 2013 1:27 pm

Re: Celtx - Actor Fields

Post by Tony Li »

Hi,

Make sure your Unity project's Assets folder (or any subfolder in Assets) contains a sprite asset whose filename exactly matches the name of that stone image's filename.

When the importer imports the character, it will look for images in Assets whose filenames match the names of the files in the Celtx catalog.
Post Reply