I’m trying to create a narrative design situation when the NPC reaches a section in the narrative design, it waits for the user to ask a question rather than trying to generate a response and talking.
Is it possible to not have an objective in a section or is there a way to make the NPC wait for a user decision. (or to stop or discard it’s response when it reaches the narrative design section?)
Hi @Tyke
Thanks so much for the reply. I tried adding convaiNPC.InterruptCharacterSpeech(); on the section start but a few words are still spoken by the NPC before it’s interrupted?
Is there a better way to use the call or another recommendation?
Cheers.
The NPC answers the question and waits for the next question.
N.B. There is no set order to how the questions can be asked so a linear flow is not the answer.
So currently I have a “waiting” section with no objective that waits for the decision questions.
Each decision leads to a section where the NPC answers. I check for when the NPC has stopped talking and when the NPC stops talking in that section I’m firing a trigger to return the NPC to the waiting section for the next question from the user.
When returning to the waiting section the NPC tries to create a response e.g. “I don’t know what event…” (that I tried to interrupt) however a few words are spoken before the interrupt kicks in.
If you have any clues on how to implement something like this I’d welcome the input.
@K3 & @Tyke,
Just a thought…
If there is a way to turn off all generated responses, perhaps I could turn off the response before the NPC reaches the “wait” narrative section and turn back on when it leaves the same section? This would essentially mute the NPC while it was waiting for the next question from the user?
Sorry Nick I haven’t no, I’m not entirely clear on what you’re trying to do tbh. As mentioned you can use interrupt speech feature to stop something being said if your ND trigger makes the avatar say something.
Hi @Tyke
Thanks for the reply.
I’ve had to put this project on hold for a few days to work on another project. However I will come back to this an try and explain the requirement better in a few days.
Unfortunately, this specific use case is not natively supported at the moment.
As you’ve identified, you can prevent the NPC from speaking by intercepting or ignoring the generated response. One workaround is to manage a custom boolean flag through your ConvaiGRPCWebAPI setup:
When the “waiting” section starts, set a boolean (e.g., canSpeak = false).
In the function where you pass AI responses to the NPC, use a conditional check: only deliver the response if canSpeak == true.
After the NPC finishes the response in any answer section (OnSectionEnd), reset canSpeak = true to allow new interactions.
This approach gives you some control over speech flow, though it requires custom implementation on your side.