[Solved] A "fallback" condition for responses

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
tomb
Posts: 19
Joined: Fri Sep 30, 2022 8:23 am

[Solved] A "fallback" condition for responses

Post by tomb »

Hi Tony

Sometimes I'm working on responses which deal with several different outcomes. For example with two variables, A and B, it is easy enough check both variable states in the conditions for each response:
  • A == true AND B == false
  • A == false AND B == true
  • A == true OR B == true
  • A == true AND B == true
  • A == false AND B == false
When I add a third (or more!) variable the list of possible conditions quickly expands as I'm not only checking for the condition I want, but also making sure other responses exclude those conditions. For example:
  • A == true AND B == false AND C = true
  • A == false AND B == true AND D = false
  • A == true OR B == true OR C = false
  • A == true AND B == true AND D = true
  • A == false AND B == false AND C = true
In these situations it becomes harder to make sure I'm catching all the cases to make sure at least one response will be displayed for the player.

I was wondering if there is a way to set a condition equivalent to "Show this response if there are no other valid responses at this point in the conversation". This way I can set up a set of complex conditions for responses then, if none of them match for that player, they would see this other response.

This "fallback" condition would help me not have to worry about making sure the complex conditions always have a valid response.

This would be different from a response with no conditions at all, as I'd only want it displayed if none of the conditions for the other responses are matched rather than it being always displayed as an option.

Thank you

Tom
Last edited by tomb on Tue Jun 04, 2024 9:18 am, edited 1 time in total.
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: A "fallback" condition for responses

Post by Tony Li »

Hi,

If you're talking about NPC dialogue entries that the NPC would respond to the player with, then yes. You don't even need to use priority levels. If you make the fallback node the last one in the "Links To" list, it will use this one if none of the previous nodes' Conditions are true:

fallback.png
fallback.png (36.54 KiB) Viewed 347 times

This is because the NPC will use the first entry in the "Links To" list whose Conditions are true.


If it's for player response menus, then you can't rely on this because the Dialogue System will show all nodes whose Conditions are true. However, in this case you can priorities. A simple example:

priority1.png
priority1.png (45.25 KiB) Viewed 347 times

For more complex conditions, you can use group nodes to simplify each node's individual Conditions:

priority2.png
priority2.png (77.2 KiB) Viewed 347 times
tomb
Posts: 19
Joined: Fri Sep 30, 2022 8:23 am

Re: A "fallback" condition for responses

Post by tomb »

Hi Tony

I was using this for player response menus so it was priorities that I was missing!

This is going to be extremely useful - thank you so much!

For your group node examples, this is a setup I have been using to reduce the individual conditions. It was making me think about the "group" checkbox - is that something I should use in these situations? I normally set a "Continue()" sequence on the node. Is there any difference between ticking group vs adding the Continue?

Thanks

Tom
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: A "fallback" condition for responses

Post by Tony Li »

Yes. Use the Group checkbox in these cases.

Group nodes act like gated passthroughs. If the Conditions are true, evaluation passes straight through to the group node's children.

A regular node with Continue(), on the other hand, stops at the regular node and "shows" it. Since the node's Sequence is Continue(), it immediately moves on to its children.
tomb
Posts: 19
Joined: Fri Sep 30, 2022 8:23 am

Re: A "fallback" condition for responses

Post by tomb »

Okay great - thanks for the explanation!
Post Reply