-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Regression due to GDScript cache changes for preload in Godot 4.3 dev 4+ #90362
Comments
A breakpoint on the error path in
It's actually not cyclic, 2 scripts need to preload the same scene for this to occur |
MRP: The full set of conditions seem to be that a scene is loaded (the main scene in the mrp), whose script preloads another scene, which has a reference to another scene that preloads it, different from the first |
|
I can reproduce the issue in latest
|
The GDScript analyzer should probably avoid the I wonder how to solve this. If there was a way to get the type and script attached without having to actually load the resource, we could solve this case. I don't think there's any facility for that yet. It could be done only if all resource loaders had a function to return this information. |
I realize even that won't be enough. Imagine a scenario like this: When loading Even if we delay loading This issue is actually expected behavior considering we don't support dependency cycles between resources. So the work around is using |
Tested versions
(Stop caching packed scenes in GDScript cache (on preload) #85501)
System information
Windows 11
Issue description
It looks like the change in #85501, included in Godot 4.3 dev 4 may have some side effects.
With this change included, starting W4 Game's Planet Crashers demo fails with a compilation error in weapon_drop.gd:
Note that the source line for the error is
-1
, and that this script is attached to a scene that getspreload()
ed here.Changing that
preload()
toload()
fixes the error. Even when moved to the top of the file, the scene can't bepreload()
ed:const drop_scene := preload("res://items/weapon_drop.tscn")
at the top fails with the same error.gdscript.cpp:2769
seems to point to the script attached to thepreload()
ed scene not being found in the GDScript cache. Reverting the above PR locally seems to fix this. Also see #85081.Steps to reproduce
Load the above mentioned project with the linked change included. The error is output to console.
Starting the project from the editor results in the same error.
Note that later commits of the Planet Crasher's demo work around this error, so use 3f07e50ed09 to test.
Minimal reproduction project (MRP)
MRP by Jordyfel
Not really minimal:
Planet Crashers repository
Direct link to ZIP file
Note that this is a multiplayer project and may open network connections to W4 Games servers.
The text was updated successfully, but these errors were encountered: