real-ezTheDev / GodotEzDialoguePlugin

MIT License
109 stars 10 forks source link

End of dialogue is only allowed to run once? #11

Closed Aelux5216 closed 4 months ago

Aelux5216 commented 4 months ago

image

In the setup above on the start node I have specified based on a state value being true false which branch it should take, one will show some text and then go straight to the end, the other will go through various one choice dialogues and also reach an end. I have it setup so it goes along the longer branch first and when it triggers endofdialogue I have it setup to change that state value to false meaning when I run start_dialogue again with the same values it will take the shorter path. It prints out the correct line but then never triggers endofdialogue when using the basic .next(0), and the only one with multiple choices is the very first start node, the end node just having the word End but it triggers endofdialogue once it reaches that and doesn't show that text anyway which is as expected.

Any idea how to allow it to trigger endofdialogue more than once? or is going back in a branch not supported? would I just have to have different dialogue.jsons for every route that isn't a direct branch?

real-ezTheDev commented 4 months ago

Hi @Aelux5216 thanks for using the plugin and asking a question here.

I'm trying to better understand.. So I understand that you have..

some_variable = true

then in the start node, you have conditional branch so that if some_variable is true, go text 1 text 2 then end otherwise, go directly to end

then you have a function that listens to end_of_dialogue_reached signal provided by the EzDialogueReader, where you are setting some_variable to false. So the next time the dialogue is run again, it can always goes directly to end node from the start.

PROBLEM You are seeing is: When you do .next(0) right before end node, the end_of_dialogue_reached is not triggered.

There might be a bug with end_of_dialogue_reached signal emitting correctly. I'll look into this to fix it

MEANWHILE, you can do the same thing by implementing a custom signal instead. so, in your end node you can have a line that says:

signal(endofdialogue)

and implement this custom signal to set the variable instead of waiting on end_of_dialogue_reached signal. I'll update this ticket when the end_of_dialogue_reached is fixed.

real-ezTheDev commented 4 months ago

Hi! I "deprecated" end_of_dialogue_reached signal. The new change is made so that there is a new "boolean" property called "eod_reached" in DialogueResponse emitted by response_generated signal.

You can now check if the response.eod_reached is true, then set your variable based on that value.

Thanks.

Aelux5216 commented 4 months ago

Thank you so much for the speedy workaround and fix, much appreciated :)