Skip to content

Instantly share code, notes, and snippets.

@YeOldeDM
Created February 5, 2016 03:19
Show Gist options
  • Save YeOldeDM/880d1d1d676d0071b484 to your computer and use it in GitHub Desktop.
Save YeOldeDM/880d1d1d676d0071b484 to your computer and use it in GitHub Desktop.
#Make sure our file exists:
if not saveGame.file_exists('res://saves/savegame.sav'):
print("no savegame found!")
return
#Dict to hold json lines
var loadNodes = {}
#Open file to Read
saveGame.open('res://saves/savegame.sav', File.READ)
#Go through file lines and append each line to loadNodes
while (!saveGame.eof_reached()):
loadNodes.parse_json(saveGame.get_line())
prints("LOADING DICTS: ",loadNodes.keys(),'\n')
### DONE GETTING DATA. NOW RESTORE THE GAME MODULES ###
saveGame.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment