Godot Version
4.2.2
Question
say i wanted to get only the text from line 1 of a, for example, 10 line .save file how would i go about that
4.2.2
say i wanted to get only the text from line 1 of a, for example, 10 line .save file how would i go about that
There is a get_line()
function on FileAccess
objects that you can use.
var file = FileAccess.open("user://file.save", FileAccess.READ)
var line = file.read_line() # reads first line, moves file pointer to the second
var line2 = file.read_line() # reads second line, moves fiile pointer to the third
# ... etc
file.close()