Skip to content
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

GDScript 2.0: Cannot preload cyclic const script references #58181

Closed
SaracenOne opened this issue Feb 16, 2022 · 0 comments · Fixed by #67714
Closed

GDScript 2.0: Cannot preload cyclic const script references #58181

SaracenOne opened this issue Feb 16, 2022 · 0 comments · Fixed by #67714

Comments

@SaracenOne
Copy link
Member

SaracenOne commented Feb 16, 2022

Godot version

b3507ab

System information

Windows 10, Vulkan, Intel® Core™ i7-8700K, Nvidia GTX 1080 (471.11)

Issue description

Scripts can preload other scripts with the 'preload' keyword, however, they will fail with the error Constant value uses script from "%s" which is loaded but not compiled if trying to preload a script which itself has preload keywords for the script which is loading, meaning it cannot resolve this cyclic dependency.

There are TODO messages in the GDScriptAnalyzer::reduce_preload which seem to hint at a strategy to support cyclic preloads, but it is unclear how this should be accomplished in the current GDScript framework. Requesting information from @vnen on the best way to potentially resolve this.

Steps to reproduce

Simply create two scripts which use the preload function to preload each other.

Minimal reproduction project

cyclic_preload.zip

@SaracenOne SaracenOne changed the title Cannot preload cyclic const script references [4.x] GDScript 2.0: Cannot preload cyclic const script references Feb 16, 2022
@akien-mga akien-mga added the bug label Feb 16, 2022
@akien-mga akien-mga added this to the 4.0 milestone Feb 16, 2022
bitbrain referenced this issue in bitbrain/beehave Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment