this post was submitted on 04 Oct 2023
16 points (100.0% liked)

Godot

5840 readers
26 users here now

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

[email protected]

Credits

founded 1 year ago
MODERATORS
16
Large scenes stop opening (lemmy.blahaj.zone)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

I have had this happen with two scenes by now. These scenes consist of a large tilemap with multiple layers, a player and thats it. The scenes inherit from a LevelBase class I wrote, but that is so simple. that it can't be the problem. LevelBase just has a open_pause_menu() function and nothing else. Does anyone know why this might be happening?

EDIT: Forgot to translate the message. It says "scene file 'office.tscn' seems to be invalid or faulty."

top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 6 points 1 year ago

Version 4.1.2 just dropped, see if the problem persists there (as I'm assuming you're on 4.1.1) - https://godotengine.org/article/maintenance-release-godot-4-1-2/

If the problem persists, make a copy of your project, open that office.tscn in a text editor and try to manually remove references to other objects/nodes, saving and trying to open it in Godot, in case the culprit isn't a circular reference as Zarr pointed out.

[–] [email protected] 4 points 1 year ago (1 children)

I'd been having issues with this myself recently. I assume you're in Godot 4.1? I tracked the issue down to being cyclic references in GDScript. As an example from what you've provided, you may have LevelBase referring to the Player script, and then the Player script referring to LevelBase. This only seems to be a problem with the type hinting in GDScript like the following:

var player:PlayerClass

Removing the hinting may fix it. As for the bug, you can read some more on it here: https://github.com/godotengine/godot/issues/80877

As a side note, I've noticed that 4.1 has this issue worse than 4.0. In 4.0 it just unbinds the script from the scene, and allows you to rebind it again. But in 4.1 it causes the error message, making you unable to open the scene.

[–] [email protected] 1 points 1 year ago

I'm using the latest Dec build, but it was a problem before that.

[–] [email protected] 3 points 1 year ago

As Zarr mentioned, this seems like a cyclical dependency, I got around this issue in my project by avoiding the use of preload, specifically in scripts that would attach to an object I would also then have instanced by that script. load() seems to avoid the problem

[–] [email protected] 2 points 1 year ago

I've seen this a number of times for a lot of different reasons. How I've fixed it every time is to open the tscn file in a text editor and start messing around. Look at the references in the files, ensure the file paths are accurate, ensure the formatting of the tscn looks correct, and lastly look at the things it references and inherits also aren't corrupt.

Absolute last resort, delete references and nodes out of your scene using the text editor until it works. If you remove everything and it still doesn't work then something is wrong with the parent. You can test this quicker by recreating your scene as well and simply just inheriting from the same parent and reloading your editor.

I've had this happen because of OS whitespace differences (with git, always commit as UNIX, checkout as OS specific.), general formatting issues, case sensitivity in the path (always keep every part of your path lowercase. Never use camel case for files.), or a corrupt parent.

[–] [email protected] 1 points 1 year ago

I use Godot with .NET and this issue arises with me exclusively when I move tscn files around. I fix it by opening the broken tscn file in a text editor and I see whether it is referencing a scene that has been moved or otherwise doesn't exist.