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.
SCRIPT ERROR: ScenePlayer.load_scene: Trying to assign value of type 'String' to a variable of type 'Dictionary'.
SCRIPT ERROR: ScenePlayer.run_scene: Invalid get index '0' (on base: 'Array').
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!
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.
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!