Dialogue/AC Prefab Menu sort order problem.

Announcements, support questions, and discussion for the Dialogue System.
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Dialogue/AC Prefab Menu sort order problem.

Post by CodePrincess »

Good day, everyone!

In today's progress blockade, My save menu isn't responding to mouse clicks when the dialogue window is open, even
though the save menu has a higher sort order. The save menu is a prefab that's used by Adventure Creator. It does not
pause itself during dialogues or cutscenes.

Here are the screen shots of the dialogue manager and save menu:

https://www.mediafire.com/view/uzvmbul2 ... 0.png/file
https://www.mediafire.com/view/ii7keimk ... 0.png/file
https://www.mediafire.com/view/4rb5rirt ... 0.png/file

Now, the reason the dialogue panel is drawing over the save slots is that those images are actually sprites separate from the
save menu object. They have a lower draw order than the menu's buttons (which are invisible), so they don't interfere with the menu's functionality. This has to seem superfluous, but Old Moat Games' Animated gif player doesn't work on Unity UI
prefabs. They work on in-scene UI's so I'll just fix that later.

https://www.mediafire.com/view/rxismau8 ... 0.png/file

As always, thank you for any advice anybody has to offer!
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue/AC Prefab Menu sort order problem.

Post by Tony Li »

Hi!
CodePrincess wrote: Mon Sep 07, 2020 4:31 pmMy save menu isn't responding to mouse clicks when the dialogue window is open, even though the save menu has a higher sort order. The save menu is a prefab that's used by Adventure Creator. It does not pause itself during dialogues or cutscenes.
Keep an Inspector view on the EventSystem GameObject. During play, it will show what's currently selected and what it detects under the mouse cursor. It might give you a clue about what's blocking mouse cursor selection (aka mouse raycasting).

Also, while the dialogue UI is up, check the SaveMenu's Canvas. Does it have an enabled GraphicRaycaster component? This component is what does the mouse raycasting for each canvas.
CodePrincess wrote: Mon Sep 07, 2020 4:31 pmNow, the reason the dialogue panel is drawing over the save slots is that those images are actually sprites separate from the save menu object.
Are they perhaps on a higher sprite layer than the UI, even if their sort order numbers are lower?
CodePrincess wrote: Mon Sep 07, 2020 4:31 pmThis has to seem superfluous, but Old Moat Games' Animated gif player doesn't work on Unity UI prefabs. They work on in-scene UI's so I'll just fix that later.
Maybe they don't like to be instantiated from a prefab? Or they don't like to be deactivated? (AC instantiates all menus, then deactivates them until they're needed.) If the GIF player runs in a coroutine, the coroutine might stop whenever the GameObject is deactivated -- or, more accurately, when the GIF player component is disabled as part of the GameObject deactivation process. If this is the case, contact the developer to get them to update the script so it restarts the coroutine when the component is re-enabled.
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Dialogue/AC Prefab Menu sort order problem.

Post by CodePrincess »

Keep an Inspector view on the EventSystem GameObject. During play, it will show what's currently selected and what it detects under the mouse cursor. It might give you a clue about what's blocking mouse cursor selection (aka mouse raycasting).
Like this?
https://www.mediafire.com/view/ns88ydmt ... 0.png/file

It doesn't seem to respond to any of my actions.
Also, while the dialogue UI is up, check the SaveMenu's Canvas. Does it have an enabled GraphicRaycaster component? This component is what does the mouse raycasting for each canvas.
The GraphicRayCaster is active:
https://www.mediafire.com/view/iqqk87sp ... 0.png/file
Now, the reason the dialogue panel is drawing over the save slots is that those images are actually sprites separate from the save menu object.
Are they perhaps on a higher sprite layer than the UI, even if their sort order numbers are lower?
The save slot sprites are not part of a UI, and I don't know how to compare the layer orders of a sprite to the sort order
of images in an active UI's canvas.
If the GIF player runs in a coroutine, the coroutine might stop whenever the GameObject is deactivated -- or, more accurately, when the GIF player component is disabled as part of the GameObject deactivation process. If this is the case, contact the developer to get them to update the script so it restarts the coroutine when the component is re-enabled.
How can I tell if the Gif player runs in a coroutine?

Wow, it's nice having someone help me down the long path to gittin' gud. Thanks, Tony!
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue/AC Prefab Menu sort order problem.

Post by Tony Li »

CodePrincess wrote: Mon Sep 07, 2020 6:32 pm
Keep an Inspector view on the EventSystem GameObject. During play, it will show what's currently selected and what it detects under the mouse cursor. It might give you a clue about what's blocking mouse cursor selection (aka mouse raycasting).
Like this?
https://www.mediafire.com/view/ns88ydmt ... 0.png/file

It doesn't seem to respond to any of my actions.
Drag the "Event System" bar up from the bottom:
showEventSystemRuntime.png
showEventSystemRuntime.png (46.67 KiB) Viewed 896 times
CodePrincess wrote: Mon Sep 07, 2020 6:32 pm
Now, the reason the dialogue panel is drawing over the save slots is that those images are actually sprites separate from the save menu object.
Are they perhaps on a higher sprite layer than the UI, even if their sort order numbers are lower?
The save slot sprites are not part of a UI, and I don't know how to compare the layer orders of a sprite to the sort order
of images in an active UI's canvas.
This only applies if the canvas is World Space. World Space canvases and Sprite Renderers both have a Sorting Layer dropdown.

Another thought is if you're using a Screen Space - Camera canvas. In this case, make sure a camera is assigned to it.

CodePrincess wrote: Mon Sep 07, 2020 6:32 pm
If the GIF player runs in a coroutine, the coroutine might stop whenever the GameObject is deactivated -- or, more accurately, when the GIF player component is disabled as part of the GameObject deactivation process. If this is the case, contact the developer to get them to update the script so it restarts the coroutine when the component is re-enabled.
How can I tell if the Gif player runs in a coroutine?

Wow, it's nice having someone help me down the long path to gittin' gud. Thanks, Tony!
Happy to help! (Well, except I'm not sure I'm being so helpful at the moment with the menu clicking issue. Feel free to send a repro project to tony (at) pixelcrushers.com if you'd like me to take a look.)

I just remembered that I have a license for that player. I checked, and it doesn't run a coroutine.

Are you playing the GIF in a Raw Image? The GIF player sends output to a Texture2D. Raw Images use Texture2Ds; Images use Sprites.
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Dialogue/AC Prefab Menu sort order problem.

Post by CodePrincess »

Are you playing the GIF in a Raw Image? The GIF player sends output to a Texture2D. Raw Images use Texture2Ds; Images use Sprites.
That's right. I tried using a Raw Image, and while it looks good on the Scene screen, it goes white at runtime.
Feel free to send a repro project to tony (at) pixelcrushers.com if you'd like me to take a look.
....Could I maybe send you my whole project? It's not super advanced. Will you be able to make the project work without the
Adventure Creator, Dialogue System, etc. in the export package?
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue/AC Prefab Menu sort order problem.

Post by Tony Li »

If possible, please zip up the entire Assets, Packages, and ProjectSettings folders. This way I'll be able to see everything as you see it.

If that's not possible, then yes, you can export a unitypackage containing only your content, and also zip up the Packages and Project Settings folders and send them along with the unitypackage. I can import the unitypackage into a project and import the Dialogue System and Adventure Creator locally here. If you choose this route, me know what version of Unity you're using.

Either way, please send it to tony (at) pixelcrushers.com, and provide the exact steps I should follow to see the problem.
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Dialogue/AC Prefab Menu sort order problem.

Post by CodePrincess »

I sent you the whole thing. It should be in your inbox now!
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue/AC Prefab Menu sort order problem.

Post by Tony Li »

Thanks! I sent you a reply email with some follow-up questions.
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue/AC Prefab Menu sort order problem.

Post by Tony Li »

Hi,

Turns out it's not a Dialogue System-specific issue. Your TALK button runs an AC ActionListAsset named SceneMenu_Talk_OnClick. This ActionListAsset pauses gameplay. When gameplay is paused, it doesn't allow input to your save menu. You could replace the "Third Party: Dialogue System Conversation" action with some other action that also runs for a while (i.e., not instantaneous), and it would still have the same problem.

One solution is to set the SceneMenu_Talk_OnClick ActionListAsset's "When running:" dropdown to Run In Background.
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Dialogue/AC Prefab Menu sort order problem.

Post by CodePrincess »

I did not know ActionListAssets could pause gameplay! I thought that was just a menu thing! :shock:

Oh, gosh. Sorry! I'll do what you suggested. :oops:
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Post Reply