How to compare user's transcription with NPC's transcription?

Original Discord Post by irecap | 2024-10-04 15:59:08

Hello! I am trying to develop a system in Unreal Engine where the user must repeat some numbers which are told by a CONVAI NPC, and if the repeated number is correct, then Unrel shall turn up the volume, while the repeated number is incorrect, then Unrel shall turn down the volume. This means that I have to compare what the NPC says with what the user says, but here I am a bit stuck. I followed this tutorial https://www.youtube.com/watch?v=Up0Ria9PaFI&t=380s and I managed to get both the NPC’s and the user’s transcriptions but now I don’t know how to compare them in order to make some event happen.
Thank you in advance if you can help me find a solution!!

Embedded Content:
Add Live Transcriptions and Events for AI NPCs in Unreal Engine | C…
After having set up conversation capabilities for your AI Characters in Unreal Engine 5, we dive into Part 2 of this tutorial series where we set up the Convai UE plugin for live AI transcriptions and events.

Full Playlist here: https://www.youtube.com/playlist?list=PLn_7tCx0ChiogfggG1AVo6IkELQSLt6o3

Tutorial Project: https://drive.google.com/
Link: https://www.youtube.com/watch?v=Up0Ria9PaFI&start=380

Reply by k3kalinix | 2024-10-08 20:34:25

Hello <@1197530502672961728>,

Reply by k3kalinix | 2024-10-08 20:37:06

Here you need to compare the number said by the NPC with the number said by the user. You can use regex. This requires more coding knowledge. You can search the internet or get support from AI.

Reply by irecap | 2024-10-17 11:39:15

Thank you <@1023671043287699568>! I was able to install and use REGEX: I can properly compare 2 strings but the problem is that it works only for the first 2 strings and then it stops working. I mean, once one comparison has been made, then no more comparisons are performed. How can I fix this issue?

Reply by k3kalinix | 2024-10-17 17:03:55

You probably made a mistake in the code. I suggest you debug with Print String.

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