nathanhoad / godot_dialogue_manager

A powerful nonlinear dialogue system for Godot
MIT License
2.04k stars 161 forks source link

DialogueEnded event handler doesn't seem to always fire #603

Closed fish-good closed 2 months ago

fish-good commented 2 months ago

Describe the bug Hi, I'm running into an issue that seems to only affect some machines and not others - basically, the DialogueEnded signal seems to not fire on certain machines (the same game build will emit the signal on some computers but not others). I'm thinking it's most likely some configuration issue I've made on my side, but wanted to check if this is something that can happen based on how the DialogueManager is instantiated. I'm using the C# wrapper and I have a dialogue file (dialogue0.dialogue) like this:

# Tutorial sequence

~ start

# Comment 1
Character1: some text
Character2: some other text

=> END

~ post

# comment 2
Character1: some more text
Character2: some more other text

=> END

And I'm calling the manager in another file like this:

    private Resource dialogue = GD.Load<Resource>("res://dialogue/dialogue0.dialogue");
    public override void _Ready() {
        DialogueManager.DialogueEnded += HandleDialogueEnd;
        StartDialogue();
    }

    private void StartDialogue() {
        GD.Print("Dialogue triggered.");
        DialogueManager.ShowDialogueBalloon(dialogue, "start");
    }

    private void HandleDialogueEnd(Resource dialogueResource) {
        GD.Print("Dialogue complete.");
        DialogueManager.DialogueEnded -= HandleDialogueEnd;
        SceneManager.Instance.FadeToScene(SceneName.Level0);
    }

And what I'm seeing in the error logs from players is that "Dialogue complete" is not appearing, yet they are able to go through the first "start" dialogue sequence until it ends. The result is that the game is stuck after the dialogue window closes because the conversation ended but the signal doesn't seem to fire. Could this be a consequence of how I'm connecting to the dialogue end event handler? Or maybe a whitespace issue? Any suggestions or feedback are appreciated, thanks!

Affected version

Expected behavior I would expect the signal emission to be the same on all machines for the same game build

Other things I've tried

Screenshots If applicable, add screenshots to help explain your problem. Try to include as much detail as possible.

nathanhoad commented 2 months ago

Would you be able to provide a tiny example project that demonstrates the issue?

fish-good commented 2 months ago

Can do, in the next day or so I'll try to replicate this in a new small project

fish-good commented 2 months ago

Ha, in typical fashion, after creating an empty project with the same dialogue and logic, the event is firing correctly. There must be some interaction/faulty configuration in my main project that is causing the issue. I'll try to hunt it down and let you know if I find anything interesting. In the mean time, I'll close the issue since it must be on my end and I can't reproduce in a new project.