I_need_player_pos You likely want to look at JSON. You can store everything from strings for scene files (great for loading the last room) or variables for stats or an array for inventory. Then you store all that in a dictionary and load it when needed.
Godot Official Docs - JSON Save System
But you would build a global object, like a data handler then give it some basic functions for saving/loading.
Example:
var _playerHealth = 100
var _playerBullets = 10
var _currentScene = ###insert file name in quotations here
var _saveDatabase = {} ## empty array for holding your data
func _save_data_update(): ## fill the dictionary (your save database)
_saveDatabase = {
"playerHealth" : _playerHealth,
"playerBullets" : _playerBullets,
"currentScene": get_tree().current_scene.filename
}
## then we store that data
func _save_function(): ## json data save function
var _myFile = File.new()
_myFile.open(_GAMESAVE, File.WRITE)
_save_data_update() ## MAKE SURE TO USE THE UPDATE FUNCTION while you save!!!
_myFile.store_line(to_json(_saveDatabase))
_myFile.close()
## and we can load it with another function when needed and we update our stats
func _load_function(): ## json data load function
var _saveFile = File.new()
_saveFile.open(_GAMESAVE,File.READ)
var _text = _saveFile.get_as_text()
_saveData = parse_json(_text)
_currentScene = str(_saveDatabase.currentScene)
_playerHealth = _saveDatabase.playerHealth
_playerBullets = _saveDatabase.playerBullets
Just be certain to build some error handling in if there is no file to load or - even easier - build your logic to not show a load function if there's no save.