Closed gatomesa closed 1 month ago
What you're asking is pretty game implementation specific but it is kind of already possible by using DialogueManager.get_line
:
var peeked_next_line: DialogueLine = await DialogueManager.get_line(dialogue_resource, "some_title", [])
This will grab the next line at the given title/key no matter what type it is. If it is a mutation then it will return it without executing it.
Is your feature request related to a problem? Please describe. In my game, I have a system where an indicator arrow appears above any interactable object. Each interactable object uses a
DialogueResource
in which I specify dialogue lines, mutations, etc. Often, there are conditions which must be met to be able to interact with the object. A very simple example:If a certain condition is met, then interacting with the object does something (in this case, mutations are run). If the condition is not met, then interacting with the object doesn't do anything (no dialogue, no mutations). However, right now, even if nothing would happen, the arrow would still show up in my game, because I have no way to check if any mutations would be run.
Describe the solution you'd like The simplest solution to my problem would be for the plugin to provide a way to check if any mutations would be run (without running them). I think that it could be exposed as a variable in the
DialogueLine
returned byget_next_dialogue_line
. Maybe amutations
int, or an array ofString
s with the mutation names. In my particular case, even awould_run_a_mutation
bool
would be sufficient. Note that, since the purpose of this is to check if the dialogue would do anything, the variables I suggested should work even if theMutationBehaviour
isSkip
(since we don't want to do anything, just check if we should show the indicator arrow or not).Describe alternatives you've considered I could turn each object's interactivity on and off through signals and bools in my code, but things rarely are as simple as the example above. Many times I'm checking a LOT more variables to decide the flow of the conversation. I did try this, but it's become a major headache.