Blank corruption

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

I have a save and load system in my game. It is working as intended, and when I wake up, the file is completely blank if you run it in the notepad. And it is not blank like a blank pages, if you highlight it, you can see that there is a character but is corrupted. I dont know why this happen, can someone ??

Can you post the code for saving the file? Probably the file is not saved in a text format.

Bubu | 2021-04-19 01:41

I have 2 different save system, the one is the system itself which handles settings, menu etc. and that is called collector and the other one is normal save/load which handle game progress.

func save(Name : String):
var g =
g.Project = $Project.Project
g.Practice = $Project.Practice
g.History = $Project.History
g.Output = $Project.Output
Save_collector("Main") + Name + ".tres", g)


func Load(Name: String):
var directory =
if !directory.file_exists("user://" + Name + ".tres"):
	return false
var data = load("user://" + Name + ".tres")
$Project.Project = data.Project
$Project.Practice = data.Practice
$Project.History = data.History
$Project.Output = data.Output

Collector shit

func Save_collector(type):
if type == "Main":
	var C =
	C.Main = Main_Collector
elif type == "History":
func Load_collector(type):
if type == "Main":
	var d =
	if !d.file_exists("user://MainCollector.tres"):
		return false
	var Data = load("user://MainCollector.tres")

Mrpaolosarino | 2021-04-19 01:52

I don’t use collectors so I’m not really good at spotting the problem here.

Bubu | 2021-04-19 01:56

I will dig into my save and load code and see if there are differences in your code.

Bubu | 2021-04-19 13:11