Godot killed code twice

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Krippi

Hey,

So it has already happened to me twice that when I wanted to start and edit my project, my Main.gd had something else in it than the code I wrote.
Thereupon Godot stops loading the scene and says he cannot read it, which is understandable.

So this is the third time that I have to rewrite my complete code from the game.

Example of the Main.gd now:

[gd_resource type="Environment" load_steps=2 format=2]

[sub_resource type="ProceduralSky" id=1]

[resource]
background_mode = 2
background_sky = SubResource( 1 )
                                                                                                                                                                                                                                                                                                                                                          
window/size/width=500
window/size/height=880
window/size/resizable=false
window/size/borderless=true
window/handheld/orientation="portrait"
window/stretch/mode="2d"
window/stretch/aspect="expand"

[input]

ui_select={
"deadzone": 0.5,
"events": [     Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
,     Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null)
 ]
}

[rendering]

And your question is… ?

From your description alone it’s impossible to tell if that’s caused by a bug or you did something else wrong. If you can reproduce what’s happening, you can report a bug. If not, you should at least start using any type of version control (like e.g. git) to regularly save your project: there always is the possibility of bugs in any software.

njamster | 2020-07-15 13:08