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
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 compiledif 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_preloadwhich 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
preloadfunction to preload each other.Minimal reproduction project
cyclic_preload.zip