Page 1 of 1

Priority for multiple valid dialogue nodes?

Posted: Wed Jun 14, 2023 10:11 pm
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!

Re: Priority for multiple valid dialogue nodes?

Posted: Thu Jun 15, 2023 9:23 am
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 165 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 165 times

Re: Priority for multiple valid dialogue nodes?

Posted: Thu Jun 15, 2023 11:43 am
by rawktron
Oh wow! That's perfect and super clean. Thanks so much. I did not know about that behaviour.

Re: Priority for multiple valid dialogue nodes?

Posted: Thu Jun 15, 2023 3:05 pm
by Tony Li
Glad to help!