Godot 4 Save & Load Tutorial PART 1

preview_player
Показать описание
Quick tutorial on saving and loading in Godot 4!
Рекомендации по теме
Комментарии
Автор

Thanks so much for this - I did have to dig in the comments to find the way to convert the dictionary back to ingame variables, but this tutorial finally helped me implement a save system that tracks your fastest time on a level. Such a relief after HOURS of frustration trying to follow other tutorials!

Swinkly_
Автор

THANK YOU SO MUCH I LOOKED ON LIKE 10 TUTORIALS AND THIS ONE FINALLY WORKED

roboninja
Автор

Shortcut, when you want to get to the user:// folder you can just go to Project -> Open user data folder

mikatomik
Автор

yet another task resolved by this channel. after release i will send you 5% of my revenue (three bucks). god bless ya

forestgreen
Автор

Would be fun if you could also make a save and load filed where everything is encrypted so that no one can change the values of the save filed.

jeffj
Автор

VERY THANKS TO YOU. You don't teach us how to load the specific value but I did it.

jshmaxer
Автор

this video help a lot in a pinch. Thanks a bunch.

just one question though. You defined a variable called parse_result, but didn't seem to use it.

what am I missing?

dastanghaedrahmati
Автор

Quick question, I've watched both Part 1 and 2 and everything is working fine, I just don't understand why we need to define the parse_result if we never use it?

BattIeBear
Автор

I did eveything just as you said, and it doesnt write to the file

OLink
Автор

Does this work if you intend to have your game playable on browser?

praetosstuff
Автор

Thank you so much! This helped a bunch!

FuGyz
Автор

im a little confused on how to get the data thats loaded to be the values of my variables again, how can i do this?

Turtilla
Автор

Is it possible to do this with Global variables? I have Global variables set to certain values at the start of the game. When I save them, it updates in the file. When I try loading the file after saving it, it defaults back to the original values. It's definitely running the load_game code (used print to test it) but the values default to the default global values.

When I try to print the node data, it says <null> instead.

eddmower
Автор

Gwizz, thank you! Could one use a Resource file (.tres) to save and load from? Storing the Resource file in the user:// directory for all persistend data? How would that look like instead of using JSON? All the best to you!

UU
Автор

how do i get the result of "node_data" on another function?

FrizyOficial
Автор

Awesome.
What do you think the issue could be if the console shows the data working correctly but even when loaded it does not effect the game itself? E.G Unlocked levels display that 2 are unlocked but in game only 1 is unlocked

mikes_renders
Автор

Was wondering if there is a to implement this into a pressed button, and be able to call information from a generated source.

DarkshiftGaming
Автор

Note to everyone trying to get this to work: The files now end on .dat, not .save . It confused me for a good while until i looked up the error. (Code still works if you just change the ending in the code)

Nishisaki
Автор

Can you do a Part 2, where you save variables from two different nodes? I understand the basics, but I can't make it work with different nodes :')

derschildertyp
Автор

When I run the script, there is an error message "Invalid type in function 'parse' in base 'JSON'. Cannot convert argument 1 from int to String." and shows the error is in the line "var parse_result = json.parse(json_string)". I have followed the steps according to the video. I am using version 4.1.1.

Does anyone know what needs to be done?

anonimblackspirit