Only show response-button, if at least one child's condition is true
Posted: Mon Sep 28, 2020 4:12 pm
So, how do I do that? Give a node a condition that makes it only be considered valid, if at least one child's condition is true. We have something similar for a particular conversation's START-node (DialogueManager.ConversationHasValidEntry(title)). I understand why it doesn't feel right to have this kind of condition, because then if this node has a Script-entry that sets some of the variables used in the conditions of the children, those Script-entries won't be executed during the check, and thus the checks become more and more erroneous the deeper you go, especially into quests which change their states a lot.
A 1-layer deep check, though, is very useful and easy to maintain, so can I do this kind of Condition somehow?
I've been looking into the Lua-functions, but I don't see any hint of having access to the current node or its children. Making a C# function also sounds like a great idea, until you realize you can only send simple datatypes. Do I have to make a custom C# function which I send the node-ID to and somehow look up its conversation and find its children or what?
Or should I do this by overriding the ShowResponseButtons() and do the ignoring there? Seems like a weird place to put that concern. I'd much rather that I could put it as a Condition.
This is again to try to combat the need for a massive Condition on a root-menu response-node called "Quests", to only make it show (be valid) if there are quests available (children/links with valid conditions).
A 1-layer deep check, though, is very useful and easy to maintain, so can I do this kind of Condition somehow?
I've been looking into the Lua-functions, but I don't see any hint of having access to the current node or its children. Making a C# function also sounds like a great idea, until you realize you can only send simple datatypes. Do I have to make a custom C# function which I send the node-ID to and somehow look up its conversation and find its children or what?
Or should I do this by overriding the ShowResponseButtons() and do the ignoring there? Seems like a weird place to put that concern. I'd much rather that I could put it as a Condition.
This is again to try to combat the need for a massive Condition on a root-menu response-node called "Quests", to only make it show (be valid) if there are quests available (children/links with valid conditions).