Priority for multiple valid dialogue nodes?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
rawktron
Posts: 2
Joined: Thu Aug 19, 2021 1:04 pm

Priority for multiple valid dialogue nodes?

Post by rawktron »

Hey there,
So, I was wondering -- let's say if you start a conversation with an NPC, you want them to start speaking to you about the most pressing thing based on the state of the game.

So, if you have a conversation like "TalkToBob" and it has a few starting nodes, each with their own sets of conditions, where it is possible that multiple sets of those conditions are true. Is there a way to set a priority for each of those nodes, so that if nodes A,B,C all have valid conditions, that it always selects node B say because it's set to priority 1, and the others are lower priority?

I can think of a few ways to do this (presumable the order of the nodes might dictate this? that seems a bit fragile to me) and obviously could create separate conversations for each option and then have a script that does the conditional/priority evaluation outside of Dialogue System, but it would be much nicer if it was possible to do it within the system itself?

Feels like maybe IsDialogueEntryValid is one way, but I'm don't know if you can see all the other "valid" entries to be able to evaluate whether the one being tested is the highest priority?

Maybe there's a completely better way to achieve this as well. Thanks!
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Priority for multiple valid dialogue nodes?

Post by Tony Li »

Hi,

The intended way, which makes it visible, is to set the order in the originating node's "Links To:" section:

linkOrder.png
linkOrder.png (19.51 KiB) Viewed 168 times

Nodes' conditions will be check top-to-bottom in the "Links To:" section until it finds a valid node.

You can override the order by changing a link's priority, indicated visually by a thicker arrow:

linkPriority.png
linkPriority.png (19.95 KiB) Viewed 168 times
rawktron
Posts: 2
Joined: Thu Aug 19, 2021 1:04 pm

Re: Priority for multiple valid dialogue nodes?

Post by rawktron »

Oh wow! That's perfect and super clean. Thanks so much. I did not know about that behaviour.
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Priority for multiple valid dialogue nodes?

Post by Tony Li »

Glad to help!
Post Reply