I need help passing dynamic information to Convai characters

Original Discord Post by _drhydra | 2024-09-22 21:54:10

I’m creating a detective game where clues about a crime are distributed to the players and Convai characters. I need these clues to be communicated to the characters so that players can interrogate them and discover which clues they possess.

I was considering using the method _convaiChatUIHandler.SendPlayerText(input); to pass the clues they hold. I also thought about using the ‘Knowledge Bank,’ but since the clues change between playthroughs, this might not be ideal. I believe using the **‘Narrative Design’ **feature wouldn’t work either, for the same reason—the clues vary between sessions.

Additionally, it wouldn’t be ideal for players to see what clues the characters received in the chat history.

Could someone recommend the best way to handle this?
:face_holding_back_tears:

Images:

Reply by k3kalinix | 2024-09-22 21:55:42

Hello <@467453703893418017> :wave:t2:,

Reply by _drhydra | 2024-09-22 21:56:49

Hello <@1023671043287699568> :wave:

Reply by k3kalinix | 2024-09-22 21:57:07

You can use message

Just try to get your NPC reference and call SendTextDataAsync

Images:

Reply by k3kalinix | 2024-09-22 21:57:23

Or you can use Narrative Design Trigger.

Images:

Reply by _drhydra | 2024-09-22 21:58:18

Okay, I’ll try that.
Thanks :heart_hands:

Reply by k3kalinix | 2024-09-22 21:58:53

Basically,
clue

Reply by _drhydra | 2024-09-22 22:01:00

Just a little question: will the characters remember the clue if I do it that way using SendTextDataAsync? And will this communication appear in the character chat?

Reply by k3kalinix | 2024-09-22 22:01:34

1- In the same session yes.
2- yes

Reply by _drhydra | 2024-09-22 22:04:01

Thank you for the response!
Is there a way to pass the clue information to the character so that it is remembered during the session, but without showing up in the chat visible to the player?
Since it’s an investigation game, I need the character to keep the clue without the player seeing the direct input in the conversation history.

Reply by k3kalinix | 2024-09-22 22:06:43

You need to customize Convai scripts. So in ChatUIHandler you can create a bool called IsClue, set it to true when you send text and it won’t show.
Set it to false when you send a normal message.

Customization is up to you. We cannot provide support on this…

Reply by _drhydra | 2024-09-22 22:09:16

Thank you so much for the guidance!
I appreciate the clarification and the suggestion to customize the Convai scripts.
I understand that the customization is on my side, and I’ll work on implementing the solution.
Your help has been really valuable. Thanks again! :wave:

Reply by k3kalinix | 2024-09-22 22:09:45

<@467453703893418017>

If you have any other questions, please do not hesitate to ask.

We would be very grateful if you could leave a comment on our store pages with your company name or the name of your project. We value your feedback and comments as they help us improve our services and products.
Asset Store: NPC AI Engine - Dialog, actions, voice and lipsync - Convai | Behavior AI | Unity Asset Store

Embedded Content:
NPC AI Engine - Dialog, actions, voice and lipsync - Convai | Behav…
Get the NPC AI Engine - Dialog, actions, voice and lipsync - Convai package from Convai and speed up your game development process. Find this & other Behavior AI options on the Unity Asset Store.
Link: NPC AI Engine - Dialog, actions, voice and lipsync - Convai | Behavior AI | Unity Asset Store

Reply by _drhydra | 2024-09-22 22:11:06

Thank you for the help!
I’ll be sure to leave a comment on the store page with my project details. Your support is much appreciated!

Reply by _drhydra | 2024-09-22 22:13:52

By the way, can you mark this as solved for me?
I can’t find the option: :dizzy_face:

Images:

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