dialogic-godot / dialogic

💬 Create Dialogs, Visual Novels, RPGs, and manage Characters with Godot to create your Game!
https://dialogic.pro
MIT License
4k stars 239 forks source link

Timelines will save over each other #2381

Closed Trriggered closed 1 month ago

Trriggered commented 2 months ago

Describe the bug If you click between different timelines fast then one timeline will show up as that timeline for example if I have timeline A and B; and I switch between them fast then timeline A will become timeline B, if you reload the project it's not an issue but if you save then it'll save timeline A as B

To Reproduce Steps to reproduce the behavior: Just spam click between them this is the fastest way I am able to recreate it (not that I spam between timelines)

Expected behavior Timeline A to show Timeline A and Timeline B to show B

System (please complete the following information):

Solutions

just reload don't save

AtlaStar commented 1 month ago

Also exists in Alpha 15 on Windows 10.

Relevant error messages when this occurs

 res://addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd:162 - Invalid access to property or key 'ready' on a base object of type 'null instance'.
  res://addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd:139 - Invalid type in function 'create_end_branch_event' in base 'MarginContainer (timeline_editor_visual.gd)'. The Object-derived class of argument 2 (previously freed) is not a subclass of the expected argument class.

This luckily doesn't appear to actually be a critical bug, as I tested saving everything and this does not actually overwrite anything in this case, it simply won't change out the loaded timeline from memory in the visual editor.

Trriggered commented 1 month ago

Also exists in Alpha 15 on Windows 10.

Relevant error messages when this occurs

 res://addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd:162 - Invalid access to property or key 'ready' on a base object of type 'null instance'.
  res://addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd:139 - Invalid type in function 'create_end_branch_event' in base 'MarginContainer (timeline_editor_visual.gd)'. The Object-derived class of argument 2 (previously freed) is not a subclass of the expected argument class.

This luckily doesn't appear to actually be a critical bug, as I tested saving everything and this does not actually overwrite anything in this case, it simply won't change out the loaded timeline from memory in the visual editor.

it might only be a critical bug for linux or the one I have Ubuntu which is 22.04 since it happened twice to me on two separate occasions

AtlaStar commented 1 month ago

I guess what I mean by it not being a critical bug is that it likely isn't going to ever overwrite your timelines; it might appear that way in engine, but from my testing it appears that the issue is just the user interface having issues reflecting that you've selected a new file

Trriggered commented 1 month ago

oh that's interesting my two timelines were overwritten no matter what I tried, maybe I missed something cause I would reload the project, quit and not save, even turned my pc on and off lol. I'm still new to this so I probably missed something

AtlaStar commented 1 month ago

It is still possible that the behavior is different on linux and more of an issue. The big thing I have ran into is that sometimes the parser enters into a bad state, and if you try to update the timeline via the visual editor, you get errors for trying to access a null instance.

Once that happens, on Windows machines at least, clicking on different timelines looks like all the timelines are being overwritten, but if you save and close nothing changes to the timeline files. It also doesn't seem like the whole plugin is crashing, just the visual editor.

Rapidly switching tabs causes something to happen that triggers a null instance access because the editor view node ceases to exist for some reason so the ready signal can't be waited for. That is at least what I have been able to deduce thus far.

Invertex commented 1 month ago

Hey, can you try this fix I made and see if it helps ya'll? https://github.com/Invertex/dialogic/tree/fix-timeline-window-content-mismatch-bug

This bug is extremely hard for me to reproduce on my system, so I can't easily verify if it fixes the problem for sure. But I couldn't seem to get it to happen after these small changes, so hopefully it does fix it. Let me know and then I can PR it.

zaknafean commented 1 month ago

Can't recreate this at all unfortunately. We are gonna assume that Invertex's fix addresses it for now, but feel free to reopen this if you hit it again after patching.