Avoid bark to trigger when another bark is still visible

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fmonroy
Posts: 2
Joined: Fri Jul 03, 2020 5:37 pm

Avoid bark to trigger when another bark is still visible

Post by fmonroy »

Hello guys,

I've setup an actor to Bark On Trigger Enter, I made it to bark a random Bark using the RandomizeNextEntry() method. The problem is, every time I leave the trigger and walked in again, the bark triggers even if another bark is still showing.

Is there a way to avoid displaying a Bark if another Bark is still visible?

EDIT: Sorry to make it a bit more complicated, but, if possible, is it possible to do what I'm asking but for the same actor only? I'm imagining situations where multiple actors can bark and it should be possible to jump from one trigger to the other, triggering once for each of them.

Thank you.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Avoid bark to trigger when another bark is still visible

Post by Tony Li »

Add a Timed Event component to the Dialogue System Trigger GameObject. In addition to the Bark action, add an OnExecute action that does two things:

1. Disables the Dialogue System Trigger, and
2. Calls the Timed Event's StartTimer.

Configure the Timed Event's OnTimeReached() event to re-enable the Dialogue System Trigger.

Example:

barkDisableTime.png
barkDisableTime.png (74.71 KiB) Viewed 229 times

Side note: If you wanted the opposite behavior -- to hide one bark as soon as another one starts -- you could use Bark Group Member components. In DemoScene2, the enemies are all Bark Group Members so only one of them can bark at a time.
fmonroy
Posts: 2
Joined: Fri Jul 03, 2020 5:37 pm

Re: Avoid bark to trigger when another bark is still visible

Post by fmonroy »

Thanks Tony, it worked like a charm!
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Avoid bark to trigger when another bark is still visible

Post by Tony Li »

Great! Glad to help.
Post Reply