Anomalies with narrativ tree

Hi! While running a generic section of the narrative tree some times, not always, the NPC doesn’t finish saying what is written between the speak tags. Sometimes it says the whole sentence, other times it just says the beginning and then stops. For example the phrase “hello welcome to this tour” the NPC just says “hello welcome in”. Other times, however, the narrative section is called but the NPC does not say the default sentence, it remains silent.

Hello @lizzicorleo,

Could you please share the Character ID?

yes the character id is e890b0fe-2a8d-11f0-a4be-42010a7be01d. In convai web seems to be fluid, in Unity not always.

How do you trigger sections in Unity?

by code, i use this:

if(convaiNPC.TryGetComponent(out NarrativeDesignTrigger narrativeDesignTrigger))
{
//Optional message parameter if you want to send some message while invoking
//the trigger
string message = “Player has collected enough resources”;
narrativeDesignTrigger.InvokeSelectedTrigger(message);
}

I connect the narrative tree trigger to a collider, and call up the collider connected to the narrative tree trigger via code

No, this is wrong. This way you don’t use ND. Do you want to trigger any section or do you want to use a custom message from Unity.

I want to trigger any section, and i use this for example:

if (cubo.TryGetComponent(out NarrativeDesignTrigger narrativeDesignTrigger))
{
narrativeDesignTrigger.InvokeSelectedTrigger();

}

if I use this the trigger is called and also the section. if I use this the trigger is called and so is the section, but the Npc doesn’t always say the whole sentence. Some times it does some times it doesn’t

Yes, this way ND Sections will work.

can editing the isTalking section for animations cause a problem?

if (cubo.TryGetComponent(out NarrativeDesignTrigger narrativeDesignTrigger))
{
narrativeDesignTrigger.InvokeSpeech("<speak> This is a Test Message! </speak>");

}

Could you please try this?

1 Like

This is a Test Message! in quotes “ …. “ otherwise it’s error

What do you mean?

Yes, true. Try this.

it doesn’t say the test message but the sentence I set in the narrative tree. the fact that I disable the collider after invokeSelectedTrigger() out the if, can imply on the proper functioning of the 'narrative tree ?

don’t worry thank you, you have been very kind, I must have used some complicated logic in the game that maybe gives problems to the narrative tree, I have to check better. Just a question if I want to block the NPC’s speech via code what can I call ? I found the method : public void InterruptCharacterSpeech()
{
_grpcAPI.InterruptCharacterSpeech(this);
}

but when called it generates red error, that is, it warns that the client has blocked the call to the server. something like this

Yes, you can use it. This is not an error, it is just a debugging message.

Because you’re probably triggering the ND Section.