Questions about simultaneous panel movement of actors.

Announcements, support questions, and discussion for the Dialogue System.
losemarins
Posts: 19
Joined: Tue Feb 23, 2021 10:39 pm

Re: Questions about simultaneous panel movement of actors.

Post by losemarins »

Hi

okay. I'll look forward to it.
losemarins
Posts: 19
Joined: Tue Feb 23, 2021 10:39 pm

Re: Questions about simultaneous panel movement of actors.

Post by losemarins »

Hi Tony, the day you promised has passed. I'm still waiting for you.
User avatar
Tony Li
Posts: 22039
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions about simultaneous panel movement of actors.

Post by Tony Li »

Hi,

We're in different time zones, and I'm typing the reply right now. I took a little longer because I wanted to record a video of what the scene looks like:



I set up the animations to set the SpineGraphics' SkeletonGraphic.color.rgb values.

Here is the example scene:

DS_SpineExampleShowingPortraits_2021-06-11.unitypackage

I also updated the Spine integration to improve the way it triggers the "Show" animation:

DS_SpineSupport_2021-06-11.unitypackage

I tested clicking through the conversation very fast, and it appears to work fine.
losemarins
Posts: 19
Joined: Tue Feb 23, 2021 10:39 pm

Re: Questions about simultaneous panel movement of actors.

Post by losemarins »

Tony, thank you for your reply.
I'm sorry I didn't think of our time difference.
I've applied everything you gave me, but there's still a problem.
The problem arises when a [panel=x] is used on nodes just before moving panels of two or more actors simultaneously.
I'll tell you how to recreate it from the example you gave me.

1. Add a new panel and register it as the 4th panel.(panel index = 3)
2. Change the contents of the node(Dialogue Text:NPC 1 speaking) to "[panel=3]NPC 1 speaking"
3. During the course of the conversation, NPC1 is forever lost and invisible.

And another problem is that, as you can see in the video, when the actors change places, they don't look natural and blinks their own colors. Because of this, my game may be considered a low-grade game.
User avatar
Tony Li
Posts: 22039
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions about simultaneous panel movement of actors.

Post by Tony Li »

Hi,

I'll address both of those and send you an updated scene.
User avatar
Tony Li
Posts: 22039
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions about simultaneous panel movement of actors.

Post by Tony Li »

Hi,

I wrote a sequencer command to make it simpler for you to set up. I was going to include it in the example scene, but I like the way it works so I added it to the Spine integration:

DS_SpineSupport_2021-06-12.unitypackage

Here is the example scene:

DS_SpineExampleShowingPortraits_2021-06-12.unitypackage

The scene is named 'Spine Example Portraits Simpler'.

It uses a new sequencer command called SpineActor():


SpineActor(actorName, panel# | hide)

Shows a Spine actor portrait in a specific panel, or hide the portrait.

For example, the first node of the conversation is:

spineSimpler.png
spineSimpler.png (54.38 KiB) Viewed 573 times

You can see that this makes the conversation shorter, too. (Fewer nodes.) I hope this will make it easier for you to write conversations.

To use it, add a 'Spine Portrait Manager' component to the Dialogue Manager.

You do NOT need to use SpineDialogueUI or SpineSubtitlePanel. You can use a regular StandardDialogueUI.

You also do not need to set SetPortrait() or [panel=#]. You have complete manual control using SpineActor(). You can also show/hide as many actors as you want in the same node. You don't have to use multiple nodes like the previous example.

Using SpineActor(), the characters' SpineGraphics stay in their original canvases. They do not move into the dialogue UI. You can adjust the layering by setting the canvases' Sort Orders. I set the SpineGraphics canvases to Sort Order 0 and the Dialogue Manager's canvas to Sort Order 1 so it will show on top of the SpineGraphics.

If you have any questions about setting it up, please let me know.
losemarins
Posts: 19
Joined: Tue Feb 23, 2021 10:39 pm

Re: Questions about simultaneous panel movement of actors.

Post by losemarins »

Thank you, Tony.
I haven't tested everything but it seems to work well except for a few problems.
I modified some of the code (SpinePortraitManager.cs).
The reason for the modification is that if the actor moves to another panel and moves back to the previous panel, it will not work normally.

This is the code part I modified.

private void MoveSpineActorToPanel(SpineDialogueActor spineDialogueActor, int panelIndex)
{
if (spineDialogueActor == null) return;
if (spineDialogueActor.spineGameObject == null) return;
var rt = spineDialogueActor.spineGameObject.GetComponent<RectTransform>();
if (rt == null) return;
var panel = GetPanel(panelIndex);
if (panel == null) return;
if (panel.panelState == UIPanel.PanelState.Closed) panel.Open();
var panelRT = panel.GetComponent<RectTransform>();
rt.pivot = panelRT.pivot;
rt.anchoredPosition = panelRT.anchoredPosition;
rt.anchorMax = panelRT.anchorMax;
rt.anchorMin = panelRT.anchorMin;
rt.sizeDelta = panelRT.sizeDelta;
actors[spineDialogueActor] = panelIndex;
}

If there is any other problem, I will ask you again here. Have a nice day.
User avatar
Tony Li
Posts: 22039
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions about simultaneous panel movement of actors.

Post by Tony Li »

Hi,

Thank you. Yes, that was a bug. I've updated the package for DS version 2.2.18.
Post Reply