(Click Here for Bark Video Tutorial)
Interactive conversations usually have a back-and-forth flow, where the actor says a line, then the conversant says a line, and so on.
Barks, on the other hand, are one-off lines of dialogue that don't involve a player response menu or any back-and-forth. They're typically spoken by an NPC for atmosphere (e.g., "Nice weather today"). Barks can also give the player an idea of an NPC's internal state (e.g., "I'm reloading. Cover me!"). If you haven't added a bark conversation to your dialogue database yet, read about Bark Conversations.
Barks don't use the dialogue UI. Instead, barks are played through a GameObject, which the Dialogue System calls a speaker or barker. Usually this is an NPC, and the bark appears as text over the NPC's head and/or as audio played through the NPC's audio source. A component on the NPC called a "bark UI" handles this.
By setting Conditions on the bark conversation's dialogue entries, barks can be aware of the current game state. For example, Sergeant Graves in the Feature Demo only communicates through barks. He barks different lines depending on the current state of the "Assassinate the Emperor" quest.
The simplest way to make an actor bark is to call:
DialogueManager.Bark("conversationTitle", speaker);
or use the equivalent visual scripting action. (Or use DialogueManager.BarkString() to bark a text string instead of looking up the bark line in a conversation.)
However, the Dialogue System provides components that make it easy to trigger barks other ways, such as on a timed interval or when the player targets and "uses" an NPC.
This page explains how to set up those components.
In addition, you can also play barks using Timeline Support.
The NPC Setup Wizard (Window > Dialogue System > Wizards > NPC Setup Wizard) can step you through configuring an NPC to bark when triggered and/or on a timed basis. The sections below provide more details on how barks work and how they're displayed.
To display barks, the Dialogue System uses a component that implements the PixelCrushers.DialogueSystem.IBarkUI interface, such as Unity UI Bark UI, the legacy Unity GUI Bark UI, and NGUI Bark UI Component. The bark UI component can display floating text above the NPC's head, write the text to a chat window, etc., depending on the particular implementation.
More information: Bark UI
A Bark Trigger makes the NPC bark when a specified trigger condition occurs, such as when the scene starts, when the NPC is enabled or used, or on a dialogue event such as the end of a conversation.
To make the NPC greet the player with a bark when used, set Trigger to OnUse and add a Usable component to the NPC.
Note that the NPC will not bark if you're using Bark Priority Values and the NPC is currently barking a higher priority line.
More information: Bark Trigger
The Bark On Idle component makes the NPC bark on a regular interval (for example, every 5-10 seconds).
Bark On Idle can give your NPCs a lot of life, since they will say things on their own without being prompted by the player.
If you only want the NPC to bark when the player is nearby, add a Range Trigger.
Note that the NPC will not bark if you're using Bark Priority Values and the NPC is currently barking a higher priority line.
More information: Bark On Idle
The Bark On Dialogue Event component makes the NPC bark when the NPC is notified of a dialogue event such as the start or end of a conversation, bark, or sequence.
Note that the NPC will not bark if you're using Bark Priority Values and the NPC is currently barking a higher priority line.
More information: Bark On Dialogue Event
If you want only one barker in a group to show bark text at time, configure them as Bark Group Members by adding a Bark Group Member component to each. When one member of the group barks, the others will hide any active barks.
More information: Bark Group Member
<< How to Start Conversations | Bark UI >>