OnConversation events?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

OnConversation events?

Post by NotVeryProfessional »

Hey everyone,

I've recently bought the Dialogue System and am integrating it into my game.

I'd like to blur the background whenever a dialog is active. Right now I've attached a simple script to the Dialog Panel that triggers on OnEnabled and OnDisabled but if I want to use Warmup, that breaks the logic (it triggers the script).

So I was wondering if there's something like OnConversationStart and OnConversationEnd events? I couldn't find anything in the manual.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversation events?

Post by Tony Li »

Hi,

Thanks for using the Dialogue System!

If you import the patch available on the Dialogue System Extras page (inside the "Updated for 2.2.13" foldout), your script can check if DialogueSystemController.isWarmingUp is true. If it's true, then don't do the blur.

Example:

Code: Select all

using PixelCrushers.DialogueSystem;
...
void OnEnable() // Added to Dialogue Panel.
{
    if (DialogueSystemController.isWarmingUp)
    {
        // Don't blur. We're just warming up, not doing a real conversation.
    }
    else
    {
        // (Your code here to blur the background.)
    }
}

Side note: Another option some devs use is to assign a dedicated camera (or camera prefab) to the Dialogue Manager's Camera & Cutscene Settings > Sequencer Camera. The Dialogue System will use this camera during conversations. Then they put post processing effects on it, such as a strong Depth of Field that blurs distant parts of the scene while keeping the conversing characters in focus.
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

Re: OnConversation events?

Post by NotVeryProfessional »

That last is an interesting idea.

DOF won't work in my specific case because I have a largely 2D game and need to blur UI images, not 3D scenes. But I might be able to adapt the idea in another way.
Post Reply