Extracting Chat/Conversation At Runtime

Reply by coltonix. | 2024-09-26 22:10:34

So I created the Transfer class in the first screenshot. How do I obtain the string text data without modifying the Convai’s script?

Images:


Reply by k3kalinix | 2024-09-26 22:12:31

Hmm, i think you can Invoke an event

Reply by coltonix. | 2024-09-26 22:16:17

Thanks! I’ll check how to do it and come back again later!

Reply by k3kalinix | 2024-09-26 22:21:05

I will be offline.

Reply by coltonix. | 2024-09-26 22:22:52

I just checked. I feel like creating an event will have to involve adding codes to the Convai’s scripts. How would you approach it without modifying any Convai script?

Reply by k3kalinix | 2024-09-26 22:29:14

I can’t say anything right now. But an event wont be an issue.

Reply by coltonix. | 2024-09-26 22:48:40

Can we also extract the player’s chat input from ConvaiPlayerDataSO? If we can, what function can we use?

Images:

Reply by k3kalinix | 2024-09-27 10:45:03

No this is different thing.

Reply by coltonix. | 2024-09-27 15:33:51

Thanks. So here’s my implementation of the event. I had to modify ConvaiChatUIHandler.cs.
From the console, I can see that it also collects the text when the player is not finished talking. But during the game, the chat window seems to know to display the final finished version of the player’s speech. So how do I not collect the unfinished texts but only the finished ones?

Images:



Reply by coltonix. | 2024-10-01 15:49:08

Hi <@1023671043287699568> :wave:

Reply by k3kalinix | 2024-10-01 15:49:34

Hello’

Reply by coltonix. | 2024-10-01 15:50:52

Could you take a look at my prev message please? I would really love to find out how I can get all the finished texts

Reply by coltonix. | 2024-10-01 16:12:43

Appreciate it! :heart:

Reply by k3kalinix | 2024-10-01 16:14:28

if(!String.IsNullOrEmpty(text))
{
  OnTextSent?.Invoke(text);
}

Reply by coltonix. | 2024-10-01 16:17:49

But as is shown in the console screenshot above, “text” is not null or empty even when the it contains the incomplete string

Reply by k3kalinix | 2024-10-01 16:27:07

would be good to add.

Reply by k3kalinix | 2024-10-01 16:28:04

It works as expected.

Reply by k3kalinix | 2024-10-01 16:28:15

ChatText = text

Reply by coltonix. | 2024-10-01 16:33:55

Thanks! Let me give it a try real quick :slightly_smiling_face:

Reply by k3kalinix | 2024-10-01 16:34:43

This is how it works. STT sends messages piece by piece.