Page 1 of 3
Celtx - Actor Fields
Posted: Tue Feb 07, 2023 2:04 pm
by jay
Hello,
Is there a way to set Actor Fields within Celtx? Particularly, is there a way to define Actor Sprites?
Thanks!
Re: Celtx - Actor Fields
Posted: Tue Feb 07, 2023 5:54 pm
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.
Re: Celtx - Actor Fields
Posted: Wed Feb 08, 2023 12:09 pm
by jay
Thank you!
Is there also a way to create a new actor field in celtx?
Re: Celtx - Actor Fields
Posted: Wed Feb 08, 2023 1:18 pm
by Tony Li
Not currently. I could add that. What kind of fields were you thinking of adding to characters?
Re: Celtx - Actor Fields
Posted: Wed Feb 08, 2023 3:30 pm
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!
Re: Celtx - Actor Fields
Posted: Wed Feb 08, 2023 3:53 pm
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:
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).
Re: Celtx - Actor Fields
Posted: Wed Feb 08, 2023 4:05 pm
by jay
Yup, that's exactly what I meant, thanks so much!
Re: Celtx - Actor Fields
Posted: Wed Feb 08, 2023 4:19 pm
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.
Re: Celtx - Actor Fields
Posted: Tue Feb 21, 2023 2:21 pm
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.
I am adding an image from Catalog-> Character and exporting the JSON from Script -> Export JSON.
Is this the correct way to do it?
Re: Celtx - Actor Fields
Posted: Tue Feb 21, 2023 2:28 pm
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.