godotengine / godot-demo-projects

Demonstration and Template Projects
https://godotengine.org
MIT License
5.65k stars 1.58k forks source link

loading_serialization/serialization demo #963

Closed ghutchi1 closed 10 months ago

ghutchi1 commented 11 months ago

Hi, the following project files need updating for 4.1, this is after the automatic attempt to make it work when you first load it up in 4.1.

in Gui.gd line 5 - var file = File.new() needs to be changed to var file = FileAccess.open(SAVE_PATH, FileAccess.READ_WRITE) line 7 - $SaveLoad/LoadConfigFile.disabled = not file.file_exists(ProjectSettings.globalize_path("user://save_config_file.ini")) changed to $SaveLoad/LoadConfigFile.disabled = not FileAccess.file_exists(ProjectSettings.globalize_path("user://save_config_file.ini")) line 8 - $SaveLoad/LoadJSON.disabled = not file.file_exists(ProjectSettings.globalize_path("user://save_json.json")) changed to $SaveLoad/LoadJSON.disabled = not FileAccess.file_exists(ProjectSettings.globalize_path("user://save_json.json"))

in save_load_json.gd line 17 - var file = File.new() changed to var file = FileAccess.open(SAVE_PATH, FileAccess.WRITE) line 43 - var file = File.new() changed to var file = FileAccess.open(SAVE_PATH, FileAccess.READ)

There may be better ways to do this, but this is what worked for me.

gui - gd.txt [save_load_json - gd.txt](https://github.com/godotengine/godot-demo-projects/files/12696575/save_load_json.-.gd.tx

Calinou commented 11 months ago

The demo here should already work in 4.1 (and 4.2.dev5), I've tested it last week: https://github.com/godotengine/godot-demo-projects/tree/master/loading/serialization

Demos on the asset library haven't been updated yet – they are still designed for 3.5.x.

Calinou commented 10 months ago

Closing due to lack of response. Please comment if you can still reproduce this bug on the latest Godot version.