-
Notifications
You must be signed in to change notification settings - Fork 2
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
Bug/Conflict with Resource Databases Plugin #12
Comments
I my memory serves, the issue is that Godot tries to load the singletons before the rest of the scripts in some edge cases. I think it's fixable through turning the addon off and on again, and then reload the editor, it has fixed itself for me. Good that you bring it up though, it shouldn't be this way. |
Interesting. That appears to fix it once. However, if I immediately reload again it comes back. I'll see if I can figure out any workarounds. |
I think I found a fix. This looks like it's due to a cyclic reference of Log -> LogStream -> Log. In if log_level > 3 && Log.is_inside_tree() && ProjectSettings.get_setting(settings.PRINT_TREE_ON_ERROR_KEY, settings.PRINT_TREE_ON_ERROR_DEFAULT_VALUE):
#We want to access the main scene tree since this may be a custom logger that isn't in the main tree.
print("Main tree: ")
Log.get_tree().root.print_tree_pretty()
print("")#Print empty line to mark new message Where As a first attempt, I thought we could break the cyclic link with something like this (abbreviated code shown): var log_singleton = get_tree().root.get_node("Log")
if log_level > 3 && log_singleton.is_inside_tree() && ...:
# [...]
log_singleton.get_tree().root.print_tree_pretty()
# [...] Though looking at this more closely, it seems like the singleton would be in the tree because we just got it from the tree. So that seems odd. That makes me wonder if the original code was intended to be something like this? if log_level > 3 && self.is_inside_tree() && ...:
# [...]
get_tree().root.print_tree_pretty()
# [...] Removing the direct usage of the |
It was like that at one point, the problem with this implementation is that it doesn't work if the LogStream isn't in the tree. Could you check whether you have the correct singleton loaded under "Project settings"->"Autoload", there should be one called Log. Perhaps this has not been added correctly?` The editor starting process should go something like the following:
If you change |
Further testing indicates that the above issue seems to be intermittent for me. I added another couple of plugins and the issue seems to have gone away. But if I remove them it comes back. Definitely strange. I dont know what Godot's official stance on cyclic loads are. I'd probably vote to avoid them if possible. Related to this, I just stumbled upon this issue in the godot issue tracker, which looks like it applies to how this plugin installs it's autoload variable: I'm not sure yet if this contributes to the issue I'm seeing, but it does look like we should probably update the code to use |
Ok. Nevermind the part about being intermittent. Had a dirty working copy. The issue is still present with additional plugins. |
Ok, I see why the implementation is the way it is, and I don't see an easy fix for removing that cyclic dependency and preserving the existing behavior. However, testing with the |
Please let me know if you have any further issues in this regard since this is a very annoying bug! |
I bumped into a weird error when trying to add this library to a new/empty project where I had already installed the Resource Databases plugin. (Link: https://github.com/DarthPapalo666/ResourceDatabases)
See this error:
Well, that would almost look like the global
Log
autoload isn't present/enabled -- except it is. The weird part is that implicit initializer stuff.p_script->implicit_initializer
appears to be attempting to call an implicit initializer of the superclass,Node
.I've spent some hours this evening going through the source code of this plugin, the Resource Databases plugin, and the gdscript.cpp file, but I haven't found anything obvious. So I'm starting to wonder if something here exposes a bug in godot itself.
Verified on Godot 4.3-offical (windows) and Godot-4.4-dev3
Steps to reproduce:
As an experiment, if I change the following line in
log-stream.gd
:and reload the project, then the error changes to this:
Any ideas?
The text was updated successfully, but these errors were encountered: