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

Scenes unable to be opened upon cylic preload() in script #78128

Closed
Tracked by #80877
FireCatMagic opened this issue Jun 12, 2023 · 10 comments
Closed
Tracked by #80877

Scenes unable to be opened upon cylic preload() in script #78128

FireCatMagic opened this issue Jun 12, 2023 · 10 comments

Comments

@FireCatMagic
Copy link

FireCatMagic commented Jun 12, 2023

Godot version

4.1 beta1

System information

Godot v4.1.beta1 - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 750 Ti (NVIDIA; 31.0.15.1694) - 12th Gen Intel(R) Core(TM) i5-12400F (12 Threads)

Issue description

Update: I had a cylic preload in my script that prevented the file from being opened.
preload("res://Client/Scenes/GUI/Interface/Interface.tscn").instantiate()

Seemingly randomly, several of my scene files have failed to open with the following message in the console:
image

Oddly enough, after giving up on one of my old scenes that had corrupted, I tried to reopen it a few days later and it was working fine again despite displaying the "scene is invalid/corrupt" message.
Despite displaying as corrupted, the scene is still loaded into my game through and instance and works just fine, I just can't access it in editor.

Steps to reproduce

According to my version control, I haven't updated the scene at all even though it worked earlier.
Today I edited the script that scene contained, saved it, and later came back and the scene couldn't be opened any more.

Minimal reproduction project

n/a

@mrjustaguy
Copy link
Contributor

seems like something is going on in cache..

@KoBeWi
Copy link
Member

KoBeWi commented Jun 12, 2023

nc == 0 error means there are no nodes. Can you send an example corrupted scene?

@dalexeev
Copy link
Member

According to my version control, I haven't updated the scene at all even though it worked earlier.
Today I edited the script that scene contained, saved it, and later came back and the scene couldn't be opened any more.

Can you attach the corrupted scene? If it hasn't changed, perhaps this is due to cyclic preload(). See #74253 (comment).

@FireCatMagic
Copy link
Author

nc == 0 error means there are no nodes. Can you send an example corrupted scene?

Here!
Scene.zip

@FireCatMagic
Copy link
Author

seems like something is going on in cache..

I deleted my .godot folder, but the scene remains corrupted

@dalexeev
Copy link
Member

The file is not corrupted. Probably the problem is the one I wrote above or similar. Try replacing preload() in your scripts with load(), restart the editor and try opening the scene again.

@FireCatMagic FireCatMagic changed the title Scenes randomly corrupting Scenes unable to be opened upon cylic preload() in script Jun 12, 2023
@FireCatMagic
Copy link
Author

The file is not corrupted. Probably the problem is the one I wrote above or similar. Try replacing preload() in your scripts with load(), restart the editor and try opening the scene again.

This was it. I changed the post title, but if this is a duplicate you can close it.

@dalexeev
Copy link
Member

CC @adamscott

@adamscott
Copy link
Member

I would close this issue as duplicate of #70985.

@PLyczkowski
Copy link

Here's what working for me to fix this error: close editor, search in the .editor folder for all files containing the corrupted scene's name (they are going to be name something like your_scene_name.tscn-editstate-2e5312b3e75d2338868814f479b1feeb.cfg), delete them, restart editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants