K3
August 2, 2024, 10:53am
1
Original Discord Post by etinesaego | 2024-08-02 10:53:47
Hello!
Here’s what I would like to do:
-I want to create a scenario where the player has multiple canvases that have different themes on them (cats, dogs, etc).
when the player presses a button on one of the scenes (eg cat or dog), a string of text is sent to the Convai UI akin to “tell me about cats”
the NPC then proceeds to talk about the subject without having the player speak or type the question.
notes-
this is in MR on Quest 3
Unity 2022.3.12f1
VR template installed
XR Rig adapted
THank you!
K3
August 2, 2024, 11:35am
2
Reply by etinesaego | 2024-08-02 11:35:19
Im noticing that maybe the VR chat and the text-based input chat might be different. If the VR chat is only looking for audio input, then I dont have access (I think, please correct me) to the text input feature. Please advise
K3
August 3, 2024, 2:17pm
3
Reply by k3kalinix | 2024-08-03 14:17:23
Hello <@1101428836916264993>,
K3
August 3, 2024, 2:19pm
4
Reply by k3kalinix | 2024-08-03 14:19:09
In the Convai NPC component, you can use the SendTextDataAsync method.
Since it is a Core SDK component, it doesn’t matter if you are using VR or a different platform.
K3
August 4, 2024, 4:48pm
5
Reply by etinesaego | 2024-08-04 16:48:20
ok will try this tomorrow and see. thanks for the help
K3
August 4, 2024, 5:41pm
6
Reply by etinesaego | 2024-08-04 17:41:13
so you’re saying the message goes right to the server and not to the tmp input field?
K3
August 4, 2024, 6:49pm
7
Reply by k3kalinix | 2024-08-04 18:49:40
Yes
K3
August 5, 2024, 8:55am
8
Reply by etinesaego | 2024-08-05 08:55:55
ok I’ll give it a go and see what i can come up with. will be back
K3
August 5, 2024, 10:12am
9
Reply by etinesaego | 2024-08-05 10:12:49
do I need to have all the awaits from the try catch included?
K3
August 5, 2024, 10:25am
10
Reply by k3kalinix | 2024-08-05 10:25:06
add await
K3
August 5, 2024, 10:35am
11
Reply by etinesaego | 2024-08-05 10:35:07
await on its or await particular features?
K3
August 5, 2024, 10:35am
12
Reply by k3kalinix | 2024-08-05 10:35:44
what do you mean
K3
August 5, 2024, 10:37am
13
Reply by etinesaego | 2024-08-05 10:37:30
await ConvaiGRPCAPI.Instance.SendTextData(_client, text, characterID,
_isActionActive, _isLipSyncActive, ActionConfig, FaceModel);
K3
August 5, 2024, 10:38am
14
Reply by k3kalinix | 2024-08-05 10:38:37
Why do you use grpcapi?
K3
August 5, 2024, 10:43am
15
Reply by etinesaego | 2024-08-05 10:43:23
tbh i have no idea just that it breaks the script if i take it out
K3
August 5, 2024, 10:43am
16
Reply by k3kalinix | 2024-08-05 10:43:54
Just use ConvaiNPC
K3
August 5, 2024, 10:49am
17
Reply by etinesaego | 2024-08-05 10:49:50
ok here’s the script I was trying
K3
August 5, 2024, 10:50am
18
Reply by etinesaego | 2024-08-05 10:50:48
using UnityEngine;
using System;
using System.Threading.Tasks;
public class npcText : MonoBehaviour
{
private ConvaiService.ConvaiServiceClient _client;
private void Start()
{
SendTextDataAsync("Tell me about the hub");
}
public async void SendTextDataAsync(string text)
{
try
{
var response = await _client.SendTextAsync(new TextRequest { Text = text });
Debug.Log("Message sent: " + response.ResponseMessage);
}
catch (Exception ex)
{
Debug.LogError("Failed to send message: " + ex.Message);
}
}
}
K3
August 5, 2024, 10:51am
19
Reply by k3kalinix | 2024-08-05 10:51:26
Why did you create a new method?
K3
August 5, 2024, 10:52am
20
Reply by k3kalinix | 2024-08-05 10:52:02
Just use ConvaiNPC’s SendTextDataAsync method.