dialogic-godot / dialogic

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

Timelines won't open in the visual editor when clicked #2376

Closed KawaiiBakemono closed 1 month ago

KawaiiBakemono commented 1 month ago

The Problem

Describe the bug

Cannot open any timelines in the visual editor, new or old. Throws error:

res://addons/dialogic/Editor/TimelineEditor/timeline_editor.gd:69 - Invalid type in function 'load_timeline' in base 'MarginContainer (timeline_editor_visual.gd)'. The Object-derived class of argument 1 (Resource (DialogicTimeline)) is not a subclass of the expected argument class.

To Reproduce

Steps to reproduce the behavior:

  1. Open up the Dialogic tab
  2. Click on any timeline from your FileSystem tab / Dialogic left sidebar
  3. No timeline opens, throws error

Expected behavior

The timeline should open in the visual editor like normal.

Screenshots

image

System:

Solutions

What you tried to get the feature working:

The issue does not seem to persist when creating a brand new project, as I can open timelines without any issues. I have tried deleting all the .import files and the .godot folder to see if any of that helped, but it didn't.

Any idea to fix the issue or a link to the line of code that might be the cause for this problem:

I am currently looking at the code to see if maybe I can fix this on my own. I will update this report should I find a viable solution.

KawaiiBakemono commented 1 month ago

Okay oddly enough, all I did was poke around at the script where the function derives from in the error:

res://addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd

This is an extremely strange (and very temporary) fix, but:

Now timelines open.

However, the issue is only fixed until the project is closed and reopened, then the issue crops back up again. I can really only assume this is a quirk from me upgrading the plugin from 1.5.1 to 2.0?

Despite this, using this "workaround" isn't viable. The timeline still breaks every so often, which causes any changes I've made to it to be completely ignored.

KawaiiBakemono commented 1 month ago

Good news, I found the issue! The best part is it's not an issue with the plugin itself.

Somehow, some of the plugin's scripts had been duplicated in another folder, one of them specifically being the timeline_editor.gd script (probably just an oopsie on my part). These were most likely being pre-loaded with the rest of the plugin, causing there to be conflicts.

After deleting these, the issue went away.