Page 1 of 2

Opacity Panel Activation

Posted: Mon Oct 29, 2018 3:04 pm
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.

Re: Opacity Panel Activation

Posted: Mon Oct 29, 2018 4:05 pm
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?

Re: Opacity Panel Activation

Posted: Wed Oct 31, 2018 4:28 am
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.

Re: Opacity Panel Activation

Posted: Wed Oct 31, 2018 9:23 am
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.

Re: Opacity Panel Activation

Posted: Wed Oct 31, 2018 11:36 am
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!

Re: Opacity Panel Activation

Posted: Wed Oct 31, 2018 2:03 pm
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.

Re: Opacity Panel Activation

Posted: Wed Oct 31, 2018 6:13 pm
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!

Re: Opacity Panel Activation

Posted: Wed Oct 31, 2018 8:21 pm
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.

Re: Opacity Panel Activation

Posted: Thu Nov 01, 2018 3:57 am
by Alatriste
Good solution! I never used the Dialogue System Events so I never thought about this simple solution.

Thanks Tony! 8-)

Re: Opacity Panel Activation

Posted: Thu Nov 01, 2018 4:26 am
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)