godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.16k stars 20.21k forks source link

Script parsing fails when two scenes reference eachother #83803

Open Shadowblitz16 opened 11 months ago

Shadowblitz16 commented 11 months ago

Godot version

v4.1.2.stable.mono.official [399c9dc39]

System information

Kubuntu 22.04

Issue description

If two packed scenes reference each other gdscript parser fails with..

E 0:00:00:0350   _parse_ext_resource: res://scenes/menus/menu-options.tscn:31 - Parse Error: [ext_resource] referenced non-existent resource at: res://scenes/menus/menu-main.tscn
  <C++ Source>   scene/resources/resource_format_text.cpp:162 @ _parse_ext_resource()

image image

I suggest that PackedScenes be lazily evaluated in the same way if they were just a string path.

Steps to reproduce

Minimal reproduction project

DumbSceneBug.zip

Zireael07 commented 11 months ago

Duplicate of a multitude of cyclic reference issues

Shadowblitz16 commented 11 months ago

I am unsure if I should close this.

AThousandShips commented 11 months ago

See:

Think this matches this:

Shadowblitz16 commented 11 months ago

@AThousandShips looks like the godot team are not planning on fixing this and just are just changing the error that is triggered.

That doesn't really fix the issue. Allowing scenes that reference each other is a very important thing to have

AThousandShips commented 11 months ago

Then I'd suggest you state your opinion on those issues and tracker instead of here, as this is just one of many duplicates or tangential issues

Atlinx commented 4 months ago

Just putting it here for future reference, I had a cyclical preload statement, (https://github.com/godotengine/godot/issues/70985), but I received the error listed here (... referenced non-existent resource at ...). If anyone is also stumbling into this issue, you might have a cyclical preload, which can be fixed by changing the preload call into a load call.

vnen commented 4 months ago

This is more of a core problem than a GDScript problem. The resource loading system does not support cyclic dependencies.