maktoobgar/scene_manager

VSCode crash on _ready() but fine if run from Godot

Closed this issue · 2 comments

Great addon. Thank you for taking the time to develop it and make it available to all.

For some reason (my fault no doubt), I can use the addon without an issue within Godot, that is, I can run some test project and it works as expected. Specifically, this means that the first _ready() to be called is in the script of the main scene, e.g., Start.gd

However, when I run the same code from VSCode the first _ready() to be called is in this addon's script scene_manager.gd which leads to a crash. If the addon is removed, the test project runs as expected.

The crash (in case it matters) is in _get_scene_key_by_value(...) because the path returned by get_tree().current_scene.scene_file_path in _set_current_scene() is a full Windows path, e.g., C:\TestProject\Start.tscn instead of the type of paths the scenes dictionary contains, e.g., res://Start.tscn

Please let me know if you need more information.

Thanks again.

Hello,
Thanks for opening an issue, it helps the addon to serve the OS community better.
I need some more information about the problem and confirmation about the scenario:

So it seems like you are using windows. (I'm on Ubuntu and never before tested the addon on Windows but to be fair, never had to)
You have an example project and installed the addon on it and then ran the project and the code is crashing when it runs _get_scene_key_by_value function, right?

The information that I need are:

  1. A full log on the crash. (at least the message of the crash)
  2. The line number and the file that the crash happens on it.

Not a great English expert here but I hope I made my case clear. 😅
And at the end, sorry for being so late to respond. I just didn't have much time.

No worries.

Since I could not use your addon, I wrote my own, so I have no idea anymore about the problem with yours (beyond what I said above).

AFAIC, this ticket can be closed.