Bark response system

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
cassbaygames
Posts: 2
Joined: Sat Jul 12, 2025 8:30 pm

Bark response system

Post by cassbaygames »

I'm trying to develop an "insult system" (A little bit Monkey Island inspired) where an NPC barks an insult at the player. The player has a window of time to press an input to "retort". I want to be able to have specific "retort" lines triggered that relate to the original insult.

I'm using a conversation for the barks, so I can choose a random bark from a list of valid ones based on game conditions. Ideally I'd like to just add appropriate "retorts" as child nodes to the original insults. But I need to work out how to store the original node, and then get the next valid child node for a separate bark event.

Can you describe a way to achieve this? Would I need to do something bespoke like store the original insult ID and then directly get the child's ID?
User avatar
Tony Li
Posts: 23421
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark response system

Post by Tony Li »

Hi,

You probably don't need to do anything custom for that. Here's a simple example:

DS_RetortExample_2025-07-12.unitypackage

It looks like this:
retorts.png
retorts.png (26.5 KiB) Viewed 159 times

I used these steps to set up the scene:

1. Wrote a conversation (intended to be an interactive conversation, not a bark) that has two NPC insults followed by player responses:
retortConversation.png
retortConversation.png (38.63 KiB) Viewed 159 times
I ticked conversation properties > Override Display Settings > Input Settings and set a Response Timeout value.

2. Added a capsule for the NPC. Gave it a Usable, Dialogue Actor (pointing to a child overhead bubble subtitle panel), and Dialogue System Trigger that starts the conversation.

3. Added a Selector to the Main Camera that can select Usables at the mouse position.

I just used the Basic Standard Dialogue UI's response menu, but you could use a different dialogue UI that assigns specific inputs to each response button, like this: (instructions)

Image
cassbaygames
Posts: 2
Joined: Sat Jul 12, 2025 8:30 pm

Re: Bark response system

Post by cassbaygames »

Hi Tony, thanks so much for your reply.

Unfortunately I haven't managed to communicate what I'm trying to do properly. I will try again as this solution isn't what I am after.

I don't want to enter a conversation, what I'm trying to do is just with barks. The original insult is a bark, and I want the player to have the option to simply press a dedicated key that will respond with another bark.

Here is a video of what I currently have:

In the example the NPC randomly decides to bark an insult: "Is that a mop?"
Then the players presses a key to trigger an insult back: "You call that a weapon..."

Right now these are pulling from different conversations to select the subtitle for each bark. I want the player's "retort" to be related to the original insult. Ideally I would simply write the retorts as child nodes of the original insults. But because this is not a conversation interaction and only in barks.

Image

I would like to be able to remember the last node that was barked by an enemy (original insult node), and then if the player triggers a bark in time, jump to a valid child node of that original insult node. This way I could simply create a conversation that had original insult nodes, and then relevant retorts as children beneath those.
User avatar
Tony Li
Posts: 23421
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark response system

Post by Tony Li »

Hi,

Sure, you can do that. If you're using barks, add a script with an OnBarkLine(Subtitle) method to the Dialogue Manager. In this method, record the dialogue entry. Example:

Code: Select all

private DialogueEntry lastBarkedEntry;

void OnBarkLine(Subtitle subtitle) => lastBarkedEntry = subtitle.dialogueEntry;
When you want to bark a retort that's linked from the last barked entry:

Code: Select all

void Retort()
{
    // Get the first entry linked from the bark:
    var retortEntry = DialogueManager.masterDatabase.GetDialogueEntry(lastBarkedEntry.outgoingLinks[0]);
    var conversationTitle = DialogueManager.masterDatabase.GetConversation(retortEntry.conversationID).Title;
    
    // Then bark it back:
    DialogueManager.Bark(conversationTitle, player, npc, retortEntry.id);
}
Post Reply