#Saving
1 messages · Page 1 of 1 (latest)
Save to disk: https://docs.godotengine.org/en/stable/tutorials/io/saving_games.html
And instead of an explicit "save button", just make a save() function and call it after every checkbutton change, etc.
Introduction: Save games can be complicated. For example, it may be desirable to store information from multiple objects across multiple levels. Advanced save game systems should allow for addition...
Does that work if i'm making something specifically for android?
res://saving_test.gd:3 - Parse Error: Function "get_tree()" not found in base self.
Also I'm getting this error
Should work fine yes, just make sure you use the user:// directory. You can read more on the dir stuff here.
This page explains how file paths work inside Godot projects. You will learn how to access paths in your projects using the res:// and user:// notations, and where Godot stores project and editor f...
`Thanks.
So for making the dictionary, what would I put as the value? Would I make a toggled signal, then put a var in there?
the value of the whatever thing you are storing..
if its a check/unchecked button, that sounds like a bool to me
but how do i pass the bool into the save function
You could create a dictionary with your values (like a bunch of bools) in there
check the saving tutorial, the first part is Serializing
going from a collection of variables into a single dictionary
instead of stuff like damage and attack, you'll be storing your bools
var save_dict = {
"filename" : get_scene_file_path(),
"parent" : get_parent().get_path(),
"alda1" : _on_savetest_toggled(1),
}
return save_dict
```
... is this right
If those are the things you want to save, yes
But with it being _on_savetest_toggled(1) wouldn't it just save it as always being on then instead of on/off
I have no idea what your _on_savetest_toggled() is, I figured it's just a test function.
Normally when it comes to vars & bools, you'd have something like this: var my_bool : bool = false
And later somekind of function to set it to the actual value instead of the default false, something like this: my_bool = #whatever your function/code/logic is
And then in your saving dictionary, you can do:
"amazing" : my_bool