Page 2 of 3

Re: Using Spine GameObjects as animated portraits

Posted: Sat Apr 11, 2020 10:55 am
by Tony Li
Hi,

Can you set the conversant to use panel 0 and the actor (e.g., Player) to use panel 1? You can change them in conversations by using the [panel=#] markup tag in your Dialogue Text or the SetPanel() sequencer command. For example, if a third character joins the conversation and wants to use panel 1, you can tell the actor to use panel 2 by using SetPanel(Player,2).

If you need to dynamically change panels in code, you can:
  • You can get a reference to the player's DialogueActor component and call DialogueActor.SetMenuPanelNumber().
  • If the player doesn't have a DialogueActor, you can call the Standard Dialogue UI's OverrideActorMenuPanel() with the player's transform.
  • If the player doesn't have a transform either, call the dialogue UI's conversationUIElements.standardMenuControls.OverrideActorMenuPanel() method.

Re: Using Spine GameObjects as animated portraits

Posted: Sat Apr 11, 2020 3:00 pm
by RGV
Many little things raised up from your suggestion, but I'm just talking about the main ones:
  • Using SetPanel() sequence command is near what we want, but the SpineGameObject isn't showing until he talks for the first time.
  • SetPanel() is ignored from Start node sequence field. Is that a desired and known behaviour? It's a problem because if any dialogue needs to set the subtitle panel to the actor who talks in the first place, that's ignored in Start node so it's unattainable.
Here is an example about what we wish: let's suppose we have a dialogue wherein 4 different actors talk. We want all of them being showed from the first dialogue entry, regardless when they will talk (maybe they won't talk at all, but we want them to be animated or so).

Re: Using Spine GameObjects as animated portraits

Posted: Sun Apr 12, 2020 12:10 am
by Tony Li
Hi,
RGV wrote: Sat Apr 11, 2020 3:00 pmHere is an example about what we wish: let's suppose we have a dialogue wherein 4 different actors talk. We want all of them being showed from the first dialogue entry, regardless when they will talk (maybe they won't talk at all, but we want them to be animated or so).
To do this, I would:
  • Create 4 subtitle panels with portrait images in different positions.
    • Set their Visibility dropdowns to Always From Start.
    • Assign them to the Standard Dialogue UI's Subtitle Panels list.
  • Add a Dialogue Actor component to each actor's GameObject.
    • Select the actor from the dropdown.
    • Set Dialogue UI Settings > Subtitle Panel number to a unique panel number for each actor (0 - 3).
p.s. - The [panel=#] tag works on the current node, but SetPanel() takes effect in the actor's next node. The [panel=#] tag applies to a single node, after which the actor resumes using its original panel. SetPanel() changes the actor's panel for the rest of the conversation.

Re: Using Spine GameObjects as animated portraits

Posted: Sun Apr 12, 2020 6:35 am
by RGV
I will write over your suggestions.
Tony Li wrote: Sun Apr 12, 2020 12:10 am To do this, I would:
  • Create 4 subtitle panels with portrait images in different positions. We have it.
    • Set their Visibility dropdowns to Always From Start. We have it.
    • Assign them to the Standard Dialogue UI's Subtitle Panels list. We have it.
  • Add a Dialogue Actor component to each actor's GameObject. We have it.
    • Select the actor from the dropdown. We have it.
    • Set Dialogue UI Settings > Subtitle Panel number to a unique panel number for each actor (0 - 3).We cannot. We don't know where any actor (even who) will be displayed because this is determined by dialogue design.
p.s. - The [panel=#] tag works on the current node, but SetPanel() takes effect in the actor's next node. The [panel=#] tag applies to a single node, after which the actor resumes using its original panel. SetPanel() changes the actor's panel for the rest of the conversation. But, why SetPanel() is not working from Start node?
Main problem here is
  • how determine by design who will be in each subtitle panel. SetPanel() is the answer but isn't enough since it doesn't work from Start node.
  • how determine who of them must appear from the beginning. Dialogue UI Settings > Subtitle Panel from any actor is not the answer because you don't know this info in editor time — it's coming from dialogue design.
Thanks so much.

Re: Using Spine GameObjects as animated portraits

Posted: Sun Apr 12, 2020 9:23 am
by Tony Li
By "dialogue design," do you mean the author of the conversation will specify these two things when writing the conversation?

1. Which actors much appear from the beginning.

2. Which subtitle panels the actors will use.

Are those two things above specified by a human author, or are they automatically computed by a script?

I can describe how to do either one. I'll put together a quick example, too. I just need to know what you mean by "dialogue design."

Re: Using Spine GameObjects as animated portraits

Posted: Sun Apr 12, 2020 9:43 am
by RGV
Oh, sorry if I'm not clear enough. As I said before, English writing is such a pain to me. :(

When I say dialogue design I mean the human way, indeed. A human designer who knows the game script will create the conversation in Dialogue Editor and fill it properly, even Sequence commands or so.
Then, when on playing time, Dialogue scene will load the appropriate conversation when necessary.

Let me know if you need more concrete information.

UPDATE: either the automatically calculated way might be useful, as well, in case there is not specified info by the human author, but I was talking about the human designer one.

Re: Using Spine GameObjects as animated portraits

Posted: Sun Apr 12, 2020 10:05 am
by Tony Li
Thanks! I'll put together a small example and script today.

Re: Using Spine GameObjects as animated portraits

Posted: Sun Apr 12, 2020 10:14 pm
by Tony Li
Hi,

I put an updated integration package on the Extras page (DS_SpineSupport_2020-04-12.unitypackage). In it, the Example folder has a sub-folder for a SkeletonGraphic example. The README.txt file explains how it's set up.

Each conversation should have custom fields that specify which actor is in each panel and which panels start visible:

spineConversationFields.png
spineConversationFields.png (42.52 KiB) Viewed 1031 times

Re: Using Spine GameObjects as animated portraits

Posted: Mon Apr 13, 2020 1:14 am
by RGV
Wow, that's absolutely gorgeous!
So elegant solution. I'm looking at the example after my workday.

Thanks so much.

Re: Using Spine GameObjects as animated portraits

Posted: Mon Apr 13, 2020 3:34 pm
by RGV
I'm updating some comments here after exploring your example and adapt it to my case. Some are questions, but besides I hope some of them could help someone.
  • Just out of curiosity, why there is a canvas as child of any SpineDialogueActor object and, at the same time, acting as parent of the actual SpineGraphic object?
  • You may want set SpineGameObjects' sibling index at SpineDialogueActorUI, because right now it's showing above its name, after SetParent() call.
  • You may want mirror SpineGraphic objects when they go into a panel in the right side. It's easy just setting x scale sign depending, for example, subtitle panel name.
  • Actors of mine are playing a strange shader-like fade when showing or hiding, but not yours. I'm still debugging why, and where that animation came from.
  • Actors are hiding (shader-like fade animation included) when they don't talk. Still debugging, as well.
Be careful with Focus/Unfocus animation! It may causes:
  • 1. Show/Hiding if animation is something like that (silly fail), so you will be totally confused.
  • 2. A weird flow when travelling from Hide to Show, because it goes before through Unfocus then to Focus, so that's odd. I'm debugging this.