All Questions


posted to: Sequencing scenes

Exported version of the game can't run

Hello! I went through the course and made a game based off its codebase. Everything went fine and the game is fully functional in-engine but when I try to export it to an .exe application, launching it results in a crash (or a black screen if it's the Debug version) - I never had this problem before and I made several small games in Godot.

This is what the Debug console tells me :
ERROR: File must be opened before use.
   At: core/bind/core_bind.cpp:2127
SCRIPT ERROR: ScenePlayer.load_scene: Trying to assign value of type 'String' to a variable of type 'Dictionary'.
          At: res://ScenePlayer.gdc:178
SCRIPT ERROR: ScenePlayer.run_scene: Invalid get index '0' (on base: 'Array').
          At: res://ScenePlayer.gdc:56

I don't understand where things could've gone wrong, as my load_scene(), _store_scene_data() and overall "scene creation" system are identical to yours.

Thanks in advance for your help!

  • Nathan Lovato replied

    I don't know what would cause that. The error suggests that the file didn't open successfully, so maybe it's you're trying to work with a file handle or a file path rather than opening the file and loading its content.

    I'd inspect the code that calls load_scene and the file you're trying to load, printing everything you can to the output console to get info from the running build: try to see if any paths change, if you get any error trying to open a file... the cause of the bug is not clear in the error you get.

  • D
    Leaf replied

    Hi! I'm sorry, I completely forgot to update this, in the meantime I reached out to a friend and they found the solution : the .scene files were not exported with the rest of the project because they weren't recognized by Godot, and I had to manually add them in the exportables in the Export settings!
    As it turned out it didn't have anything to do with the code itself...

    Thank you for your reply!

  • Nathan Lovato replied

    Good to know, thanks for the update!

  • D
    Mark_Karnowski replied

    I suspect that I will have the same problem when I export. I see that 1.scene and 2.scene don't show up in the Godot file system dock, but are clearly there when I view the game folder with my KDE file browser. Is this an expected behavior?

  • Nathan Lovato replied

    Yes, Godot doesn't look at file formats it doesn't natively support. Now that I think of it, this will be necessary for all data files you use like JSON and whatnot.