Opacity Panel Activation

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Opacity Panel Activation

Post by Alatriste »

Hi Tony

I'm using an OpacityPane when there is a dialogue playing, so the background is dimmed and the portraits have more visibility on the screen. However, I'm finding a little issue that I don't know whether I can solve. The opacity panel should only be visible while there is a conversation with actors using panel 0 or 2.

The panel has to be always enabled while the conversation is running, even when they are not the ones talking. So far I get it working until here. The problem comes when the conversation ends and the player actor using panel 1 talks or play some single line of another conversation (like describing an object). In this case, the Opacity Panel is still enabled but it should be disabled, as there are not any other actors involved in the conversation.

Therefore I'm trying to find a way to make the Opacity Panel only visible while there is a conversation with other actors that are using panels 0 or 2. If not actors are involved in the conversation, the Opacity Panel must be off. Only panel 0 and 2 are referencing the Opacity Panel.
Attachments
UI_Panel.jpg
UI_Panel.jpg (172.09 KiB) Viewed 1190 times
User avatar
Tony Li
Posts: 21055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Opacity Panel Activation

Post by Tony Li »

Hi,

Instead of assign Opacity Panel to the StandardUISubtitlePanel's Panel field, what if you use the OnFocus() and OnUnfocus() events to activate and deactivate it?
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Re: Opacity Panel Activation

Post by Alatriste »

Hi Tony,

I'll try to implement your idea this evening, but while I was reading it, I thought that wouldn't that create a weird blinking effect if I have 3 characters in the same conversation?

The way I understood your solution this might happen:

Actor Panel 0 talks: OpacityPanel On
Actor Panel 0 stops talking: OpacityPanel Off
<blinking effect here>
Actor Panel 1 talks: OpacityPanel On
Actor Panel 1 stops talking: OpacityPanel Off

I'm probably missing something.
User avatar
Tony Li
Posts: 21055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Opacity Panel Activation

Post by Tony Li »

Hi,

I think I understand better now. Please tell me if I am correct:

- You want to show the opaque panel only for specific conversations. (For example, conversations that do not involve actor 1.)

- You want to either show or hide the opaque panel for the entire duration of the conversation. The panel will never turn on/off in the middle of a conversation.

Is that correct? If so, please let me know. I can post a short script to do that. It will be the simplest way.
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Re: Opacity Panel Activation

Post by Alatriste »

- You want to show the opaque panel only for specific conversations. (For example, conversations that do not involve actor 1.)

- You want to either show or hide the opaque panel for the entire duration of the conversation. The panel will never turn on/off in the middle of a conversation.
That's right! It's basically something I'd like to add to my VN as sometimes I notice is difficult to focus on the characters' portraits when the background has many objects or colors. For that, I apply the opacity layer to the background, so I dimmed it.

The only exception I have where I wouldn't like to activate the opacity Panel is when the player is giving a description of an object in the screen, so there are not more actors involved in the conversation, only the player.

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

Re: Opacity Panel Activation

Post by Tony Li »

Is the rule below correct?

- If the conversation only involves the Player actor, do not show the opaque panel.

- Otherwise, always show the opaque panel.
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Re: Opacity Panel Activation

Post by Alatriste »

- If the conversation only involves the Player actor, do not show the opaque panel.

- Otherwise, always show the opaque panel.
Yes.
But there should be a way to ignore the rule and don't apply the opacity, just in case in some particular case we don't it. (like when we play a conversation that doesn't use portraits because the characters are already included in the background.) I think it would be enough with a sequencer command to enable or disable at the beginning of the conversation.

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

Re: Opacity Panel Activation

Post by Tony Li »

In that case, why don't you use the SetActive() sequencer command to activate the Opaque Panel at the beginning of every conversation except conversions involving the Player?

To hide the Opaque Panel at the end, you can add a Dialogue System Events to the Dialogue Manager. Configure the OnConversationEnd() event to deactivate it.
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Re: Opacity Panel Activation

Post by Alatriste »

Good solution! I never used the Dialogue System Events so I never thought about this simple solution.

Thanks Tony! 8-)
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Re: Opacity Panel Activation

Post by Alatriste »

I'm getting this weird error when I press the Key to cancel the subtitle:

"Failed to call function OnConversationLineCancelled of class DialogueSystemEvents"

Failed to call function OnConversationLineCancelled of class DialogueSystemEvents
Calling function OnConversationLineCancelled with no parameters but the function requires 1.
UnityEngine.Component:BroadcastMessage(String, Object, SendMessageOptions)
PixelCrushers.DialogueSystem.ConversationView:OnCancelSubtitle() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:356)
PixelCrushers.DialogueSystem.ConversationView:Update() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/MVC/View/View/ConversationView.cs:90)
Attachments
DS_Error.jpg
DS_Error.jpg (121.75 KiB) Viewed 1169 times
Post Reply