Determine Last Node(s) of Conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
FredericoUnO
Posts: 7
Joined: Tue Sep 21, 2021 4:04 pm

Determine Last Node(s) of Conversation

Post by FredericoUnO »

Hello again, Tony,

This question should hopefully be much simpler than my last one:

Is there any way to detect when you are at a [potential] final node in a conversation, i.e. one that's either a subtitle with no children or a response menu with at least one answer that has no children? Alternatively, is there a way to determine if a node has children within OnConversationLine()?

Basically, I want to programmatically make some changes just before a conversation ends (as in, before OnConversationEnd() is called). I could do this via sequence commands/scene events in those nodes within the gui, but it'd be more convenient to have a way to do it via code rather than editing the final node(s) in the same way in every conversation.
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

Re: Determine Last Node(s) of Conversation

Post by Tony Li »

Hi,

Yes, you can check DialogueManager.currentConversationState. It has properties such as hasAnyResponses, hasPCResponses, etc., as well as the list of pcResponses and npcResponses.
Post Reply