gdquest-demos/godot-open-rpg

DialogueCombatPawn loops dialogue if Enter key is pressed

rcjsuen opened this issue · 1 comments

I'm submitting a...

  • Bug report.
  • Feature request.

Bug report

If the Enter key is used to advance the dialogue with DialogueCombatPawn, it will cycle forever.

What is the current behavior?
After "Done" the dialogue will go back to "Next" instead of going into combat.

What is the expected behavior?
After "Done" we should enter combat.

Tell us the steps to reproduce the bug, and if possible share a minimal demo of the problem.

  1. Start the game.
  2. Move east to the arrow directly east of the player.
  3. The exclamation mark hover will appear when the player is next toDialogueCombatPawn.
  4. Hit Enter to start the dialogue.
  5. Repeatedly hit Enter to notice that the dialogue just loops now.

Located the bug in PawnInteractive.gd.

if event.is_action_pressed("ui_accept") and dialogue_balloon.visible: triggers every time you press ui_accept (but only for keyboard inputs, not clicks).

Adding set_process_unhandled_input(false) at the end of the if statement fixes it, but it doesn't allow you to interact with the map event again which probably isn't the desired outcome.

What is weird is that the process is checking for dialogue_balloon.visible but it isn't visible as far as I can see so it should fail.

EDIT:

I'm wrong on that. The dialogue_balloon and the quest_bubble are not the same thing.

EDIT 2:

Okay I'm getting closer. In the start_interaction() function we have the for action in actions loop.

When it does the StartCombat action it never exits back to the start_interaction() for some reason.

EDIT 3:

Okay, I think I tracked it down to when the local_map gets removed before a battle starts. When it gets readded, the yield function is no longer waiting to be processed.

That's not directly tied to this problem, but it is causing a bug when I tried to handle the start_interaction() with a state.

I think I'm done trying to figure this out though.