# How to create NPCs that copy text verbatim(TTS)

**URL:** <https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922>\
**Category:** Unreal Engine Plugin\
**Tags:** question, unreal-engine\
**Created:** [December 23, 2023, 10:45pm UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922 "2023-12-23T22:45:36Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [December 23, 2023, 10:45pm UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/1 "2023-12-23T22:45:36Z")

</div>

**Original Discord Post by qqqo\_92491 | 2023-12-23 22:45:36**

How can I get an NPC to speak back to me the same text I’ve spoken or typed? I’d like to know if there is a way to type any text into a widget and have it output a voice and facial expression accordingly. Is there a way to do TTS like this directly with Blueprint settings?\<@&1163218672580575372\>

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [December 23, 2023, 10:49pm UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/2 "2023-12-23T22:49:55Z")

</div>

**Reply by k3kalinix | 2023-12-23 22:49:55**

Hello \<@1138879756113293334\>, Welcome to Convai Community!  
As I understand you are using Unreal Engine, let me tag the \<@&1163218672580575372\>. They will help you as soon as possible.

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [December 23, 2023, 11:11pm UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/3 "2023-12-23T23:11:17Z")

</div>

**Replying to k3kalinix’s Message**

> **Reply by k3kalinix | 2023-12-23 22:49:55**  
> Hello \<@1138879756113293334\>, Welcome to Convai Community!  
> As I understand you are using Unreal Engine, let me tag the \<@&1163218672580575372\>. They will help you as soon as possible.

**Reply by qqqo\_92491 | 2023-12-23 23:11:17**

Thank you.

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [December 25, 2023, 3:14am UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/4 "2023-12-25T03:14:37Z")

</div>

**Reply by freezfast | 2023-12-25 03:14:37**

Hi \<@1138879756113293334\>, you can use the `Text To Speech` function. However, it would not get any facial expressions/lipsync only audio, please find the docs for it here:

> **[Text To Speech | Documentation](https://docs.convai.com/api-docs/plugins-and-integrations/unreal-engine/blueprints-reference/text-to-speech)**

If you would like audio with facial expression and such we recommend using the `Invoke Speech` function, here is a quick guide on how to use it

> **[Event-Aware Convai Characters | Documentation](https://docs.convai.com/api-docs/plugins-and-integrations/unreal-engine/guides/event-aware-convai-characters)**
>
> This document explains how to make characters respond to events happening in their surroundings with a small example.

You can simply use a trigger message similar to this `Please say the following "<Put your text here>"` and the character will speak it out

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [December 26, 2023, 10:41pm UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/5 "2023-12-26T22:41:25Z")

</div>

**Replying to freezfast’s Message**

> **Reply by freezfast | 2023-12-25 03:14:37**  
> Hi \<@1138879756113293334\>, you can use the `Text To Speech` function. However, it would not get any facial expressions/lipsync only audio, please find the docs for it here:  
> [Text To Speech | Documentation](https://docs.convai.com/api-docs/plugins-and-integrations/unreal-engine/blueprints-reference/text-to-speech)

If you would like audio with facial expression and such we recommend using the `Invoke Speech` function, here is a quick guide on how to use it

> **[Event-Aware Convai Characters | Documentation](https://docs.convai.com/api-docs/plugins-and-integrations/unreal-engine/guides/event-aware-convai-characters)**
>
> This document explains how to make characters respond to events happening in their surroundings with a small example.

You can simply use a trigger message similar to this `Please say the following "<Put your text here>"` and the character will speak it out

**Reply by qqqo\_92491 | 2023-12-26 22:41:25**

Thank you, is the above operation possible in Korean?

Also, I followed the instructions at [Event-Aware Convai Characters | Documentation](https://docs.convai.com/api-docs/plugins-and-integrations/unreal-engine/guides/event-aware-convai-characters), but I can’t seem to read the trigger message at all. Is there a complete blueprint I can refer to?

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [December 27, 2023, 12:17am UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/6 "2023-12-27T00:17:40Z")

</div>

**Replying to qqqo\_92491’s Message**

> **Reply by qqqo\_92491 | 2023-12-26 22:41:25**  
> Thank you, is the above operation possible in Korean?

Also, I followed the instructions at [Event-Aware Convai Characters | Documentation](https://docs.convai.com/api-docs/plugins-and-integrations/unreal-engine/guides/event-aware-convai-characters), but I can’t seem to read the trigger message at all. Is there a complete blueprint I can refer to?

**Reply by freezfast | 2023-12-27 00:17:40**

Hi \<@1138879756113293334\>, what is the trigger message you are sending? we can try to tune it a little

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [December 27, 2023, 12:20am UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/7 "2023-12-27T00:20:04Z")

</div>

**Reply by freezfast | 2023-12-27 00:20:04**

Yes it is possible in Korean

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [December 27, 2023, 1:01pm UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/8 "2023-12-27T13:01:32Z")

</div>

**Replying to freezfast’s Message**

> **Reply by freezfast | 2023-12-27 00:17:40**  
> Hi \<@1138879756113293334\>, what is the trigger message you are sending? we can try to tune it a little

**Reply by qqqo\_92491 | 2023-12-27 13:01:32**

I ran it as shown, but I get the error below. What can I do to fix this?

“”"  
Blueprint runtime error: “Attempting to read the Chatbot property, accessed None”. Node: Invoke Speech Graph: EventGraph Function: Execute Ubergraph Convai Base Player Blueprint: ConvaiBasePlayer  
“”"

**Images:**

 ![image.png](https://canada1.discourse-cdn.com/flex004/uploads/convai/original/2X/5/577663a489d61016b72d0c7de7259099fbaab731.png)

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [December 27, 2023, 2:25pm UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/9 "2023-12-27T14:25:05Z")

</div>

**Reply by freezfast | 2023-12-27 14:25:05**

The Chatbot variable is none, make sure to use the chatbot component on the character blueprint not the player

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [January 2, 2024, 12:35am UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/10 "2024-01-02T00:35:47Z")

</div>

**Replying to freezfast’s Message**

> **Reply by freezfast | 2023-12-27 14:25:05**  
> The Chatbot variable is none, make sure to use the chatbot component on the character blueprint not the player

**Reply by qqqo\_92491 | 2024-01-02 00:35:47**

I’m not sure what the Chatbot component of the Character Blueprint is, I’ve tried several times and I’m not getting the target set correctly, could you give me a more detailed example or explanation? I’m new to Unreal Engine, so maybe I’m not understanding it well enough.

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [January 2, 2024, 1:07am UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/11 "2024-01-02T01:07:18Z")

</div>

**Replying to qqqo\_92491’s Message**

> **Reply by qqqo\_92491 | 2024-01-02 00:35:47**  
> I’m not sure what the Chatbot component of the Character Blueprint is, I’ve tried several times and I’m not getting the target set correctly, could you give me a more detailed example or explanation? I’m new to Unreal Engine, so maybe I’m not understanding it well enough.

**Reply by freezfast | 2024-01-02 01:07:18**

No worries, you can do it like so, basically, get a reference to your character and inside it is the `ConvaiChatbotComponent` that you want to use, yo ucan of course use a keyboard button to trigger it, or you can use any kind of other logic for example when the player distance from the character is less than x meters or so

**Images:**

 ![image.png](https://canada1.discourse-cdn.com/flex004/uploads/convai/original/2X/9/95e5c05ad2b630452ff9fd34c1858c201cb1e6fd.png)

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [January 3, 2024, 11:21pm UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/12 "2024-01-03T23:21:54Z")

</div>

**Reply by amapesing | 2024-01-03 23:21:54**

have you tried using triggers and the narrative design? I have been using it to generate exact monologues up to 2-3 minutes.

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [January 4, 2024, 1:53am UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/13 "2024-01-04T01:53:26Z")

</div>

**Replying to amapesing’s Message**

> **Reply by amapesing | 2024-01-03 23:21:54**  
> have you tried using triggers and the narrative design? I have been using it to generate exact monologues up to 2-3 minutes.

**Reply by freezfast | 2024-01-04 01:53:26**

That’s a really good advice as well.  
cc: \<@808164597050638367\> can we get a few steps on setting triggers from narrative design?

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [January 7, 2024, 7:13pm UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/14 "2024-01-07T19:13:34Z")

</div>

**Replying to amapesing’s Message**

> **Reply by amapesing | 2024-01-03 23:21:54**  
> have you tried using triggers and the narrative design? I have been using it to generate exact monologues up to 2-3 minutes.

**Reply by qqqo\_92491 | 2024-01-07 19:13:34**

Thank you. I hadn’t thought to modify the trigger message, but thanks for the heads up on how to do that.

---

<div class="post-metadata">

**Author:** ![K3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.convai.com/k3/32/2611_2.png) [@K3](https://forum.convai.com/u/K3)\
**Post date:** [November 25, 2024, 12:15pm UTC](https://forum.convai.com/t/how-to-create-npcs-that-copy-text-verbatim-tts/922/15 "2024-11-25T12:15:19Z")

</div>

This conversation happened on the Convai Discord Server, so this post will be closed.
