Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialogic does not raise the signal 'timeline_ended' #2049

Closed
Wildos opened this issue Jan 25, 2024 · 6 comments · Fixed by #2056
Closed

Dialogic does not raise the signal 'timeline_ended' #2049

Wildos opened this issue Jan 25, 2024 · 6 comments · Fixed by #2056
Labels
Bug 🐞 Something isn't working Needs testing More feedback/testing would be good

Comments

@Wildos
Copy link

Wildos commented Jan 25, 2024

The problem

Describe the bug
The signal "timeline_ended" is not raised when the dialog reach the end.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
I tried to react to the end of a timeline but the function connected to the signal is not executed

Screenshots
/

System (please complete the following information):

  • OS: Linux 6.7.1
  • Godot Version: Master v4.3.dev.custom_build.4b6ad3498
  • Dialogic Version: Main & 2.0 alpha 12

I tried adding a 'End' flow instruction to force the end of the timeline but without success

Timeline code:

bill: Hello world
[end_timeline]

Script code:

extends Node

func _ready() -> void:
	start_dialog()


func start_dialog():
	Dialogic.timeline_ended.connect(_on_timeline_ended)
	Dialogic.start("mod_timeline")

func _on_timeline_ended():
	Dialogic.timeline_ended.disconnect(_on_timeline_ended)
	print("_on_timeline_ended")

the "bill" character is a new character with the name 'bill' no modification made

Additional informations:
I investigated lightly and it seem the reason the signal is not raised is because the function "handle_event" from 'DialogicGameHandler' is never called with an 'event_index' equal or superior than the size of 'current_timeline_events'.
It seem that the function "handle_next_event" is not called after the event is finished

@Jowan-Spooner
Copy link
Collaborator

Hmm... I think there has to be something else to this. It works for me with godot 4.2.1 and alpha 13 WIP.

@Jowan-Spooner Jowan-Spooner added Bug 🐞 Something isn't working Needs testing More feedback/testing would be good labels Jan 26, 2024
@Wildos
Copy link
Author

Wildos commented Jan 26, 2024

I tried on godot 4.2.1 and I confirm that the signal is properly raised. (I tried godot 4.2.1 and dialogic alpha 12)
I will do more test to see if I can understand what cause the issue on godot master

@Wildos
Copy link
Author

Wildos commented Jan 26, 2024

I have found the behaviour change that seem to cause the issue:
In event_text.gd, in the function _execute, on the line for i in split_regex.search_all(final_text): godot 4.2.1 return 1 match ["Hello World"] while godot master return 2 matches ["Hello World", ""]
It may be because of the modification to the search_all function (godotengine/godot#85783)

@Wildos
Copy link
Author

Wildos commented Jan 26, 2024

I was able to fix the issue by altering the regex to: ((\[n\]|\[n\+\])?((?!(\[n\]|\[n\+\]))(.|\n))+) (Replace the last '*' with a '+' to prevent empty match) (It then worked both in godot 4.2.1 and godot master)
I don't have the necessary hindsight to know if this would cause any issue with the rest of the plugin so I will let someone more instructed on the plugin inner working test and fix the issue.

@Jowan-Spooner
Copy link
Collaborator

@Wildos Thank you so much, this looks like a great find. I've not been using 4.3 yet so I didn't notice, but that sounds like the problem indeed. I have to look at the regex and it's use myself before being certain it doesn't cause other problems, but I'm sure you've made this way less of a hassle then it would've been otherwise.

@Invertex
Copy link
Contributor

Great finding the solution!
This issue also breaks the Default Style/VN Style, it won't progress to next text nodes.

Jowan-Spooner added a commit to Jowan-Spooner/dialogic that referenced this issue Jan 29, 2024
Jowan-Spooner added a commit that referenced this issue Jan 29, 2024
* Fix regex for 4.3 (#2049)

* Clean visual timeline editor regions. Mark as changed on duplication

* Fix #1910
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Something isn't working Needs testing More feedback/testing would be good
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants