I broke pickup.tscn while inheriting from it

error_koala

Here's what I think happened

  • I created a new inherited scene from Pickup.tscn
  • I accidentaly remaned Pickup.tscn to PickupSpeed.tscn when I thought I was renaming the root node (which I later realized I didn't even need to do)
  • I renamed the root node to PickupSpeed
  • I saved the scene, before realizing what had happened

Opening the scene gives this message:

  • Alert! Unexpected end of file 'PickupSpeed.tscn'

Renaming it back to Pickup.tscn didn't help.

So any idea if I can undo this? Undo didn't help, I tried.

Debugger info for some insight:

--- Debugging process started ---
Godot Engine v3.5.stable.official.991bb6ac7 - https://godotengine.org
OpenGL ES 3.0 Renderer: Mesa Intel(R) HD Graphics 4000 (IVB GT2)
Async. shader compilation: OFF
 
--- Debugging process stopped ---
Switch Scene Tab
Rename Node
 Cannot open file 'res://ObstacleCourse_Part2/pickups/Pickup.tscn'.
 Failed loading resource: res://ObstacleCourse_Part2/pickups/Pickup.tscn. Make sure resources have been imported by opening the project in the editor at least once.
Undo: Rename Node
Nothing to undo.
Nothing to undo.
Nothing to undo.
Switch Scene Tab
 Invalid scene: root node PickupSpeed in an instance, but there's no base scene.
 Invalid scene: root node PickupSpeed in an instance, but there's no base scene.
 scene/resources/packed_scene.cpp:143 - Condition "!node" is true. Returned: nullptr
 editor/editor_data.cpp:612 - Condition "!new_scene" is true. Returned: false
Switch Scene Tab
Switch Scene Tab
 Invalid scene: root node PickupSpeed in an instance, but there's no base scene.
Switch Scene Tab
 Invalid scene: root node PickupSpeed in an instance, but there's no base scene.

  • Nathan Lovato replied

    Unfortunately, this is not something you can undo. You will need to redownload the course files and grab a fresh copy of the start file, or if you have a completed projects on your computer, you can use that.

    Normally with the steps you took, the file shouldn't have gone corrupt. It's unfortunate that it did. This is not an engine bug I am aware of, but engine bugs in saving files is definitely something that can happen with any big game engine.

    1 love
  • error_koala replied
    ok I'll probably just delete this scene and then recreate it.

    Is the only real way to prepare for file corruption just keeping your backups in check? I mean in some more crucial project where this sort of bug would mean a huge amount of work.
  • error_koala replied

    It seems it also broke the PickupGhost.tscn even though I didn't even touch that file when this happened. So I have to redo that as well.

    So can a file break other files if they inherit from it? Are the inherited scenes just modified copies of the scene and any changes written to the original scene will be written in the inheriting scenes as well? Seems like a pretty vulnerable system if that's the case.

  • Nathan Lovato replied

    Inherited scenes, like inherited scripts, add to the thing they inherit from. So an inherited scene refers to the parent scene and describes what's different about it: added nodes, changed properties... It lists differences with the parent scene.

    You unfortunately had something go corrupt, but it's not an issue that's supposed to happen, or that happens often.

    Also, with experience, as scene files are plain text files, you can actually open them in a text editor to see what's going on in the data and fix things manually if you need to, by changing the text data in the file. Paired with a version control system (mentioned as a reply to your other thread), this gives you a good security in the rare cases where things end up corrupted or lost (which can unfortunately happen with any software).

    1 love