Priority for multiple valid dialogue nodes?
Posted: Wed Jun 14, 2023 10:11 pm
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!
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!