Notice 1: You should say file.close() after ur done using file Notice 2: It's better to save it to user:// instead of res:// Notice 3: It's better to save the data as a dictionary instead of a plain integer variable, so you can group it together as one because calling get_var() will move the pointer up Notice 4: Someone mentioned that it's even better to save using custom resources but idk how to do that and dictionary seemed to work fine
get_var() does not get the variable like parameter. You don't need to put the variable like parameter. It just returns the first variable founded, the the second... You returned the variables that you stored beacuse you called it in order as you declared.
@@sorsx Sure, if you use get_var() many times you will get the next variable in row. If you have 3 variables stored, you will get the third variable if you call the function three times, not by putting the number three as parameter. The situation of the video is coincidence because he called the variable the same number of times as variables stored.
Thank you so much for this tutorial, it is way more helpful then the other ones which just blast me with code, and expects me to understand. I really appreciate it.
thx man i need that i been look for some one to show how to save vars and load them you was the best one i found i love all your video's your videos help a lot over my first year of using godot 4 so thx all your vids are amazing thx for all your work
i've been struggling with this issue for a week on end. it's stumped me more than any other coding issue i can recall. i felt demotivated to work on my game, more than i have in a long time, all because of the stupid saving and loading. this video completely fixed it in 4 minutes.
i am so sorry to hear youve been have issues with that so long, im just glad to hear the video was able to help! If you ever need anything then feel free to let me know!
@@dev-worm Have you made a video about the topic "How to make Ai enemies?" ++ How to save the options like savibg buttons activation or slider percent?
Thanks for this! Came just in time for my game! I'm using it to save position of generated tiles so the level loads the same when it can load random levels!
Thank you so much for this! I started learning Godot a few days ago and this is a huge help. Quick question; would it be possible to save and load two different types of data separately? Many survival games save characters and maps separately, for instance. It seems like it would be possible, but I'm not entirely sure and don't want to dig myself into a hole.
thanks! Yes of course its possible but I'm not exactly sure how ill beable to explain it over text.. so maybe I can look into creating a more advanced save and loading tutorial
@@dev-worm That would be great. Almost all tutorials on Godot are simple which has its place but how about an advanced concept to save for example in the game I'm making: Using Godots tilemap saving only the tiles changed from the original map. There's 39 towns on the map each a class with tons of variables including a population in an array in the town class from another class which has all the per person stats which in itself has more arrays for their memory. Simply put: Array of 39 towns: each town has an array of up to 100 individual people and each of those people have some arrays for their memory. It's all held in a singleton(global) with duct tape. Kinda tired of stumbling around figuring all this stuff out myself and making a video about it. Please pity us and help? I have cookies. That I baked. And accidently swapped the sugar for baking soda. Nobody wants them so they're all yours for an advanced video on the concepts of saving a mess like this.
Okay I've sort of figured this out. The important thing to note is one has to extrapolate the data they want saved, then reconstruct it on load. In the above case I created a dictionary called thisTown and another dictionary called thisPerson (no memory arrays tried yet). Then with a for loop for # of towns and another for loop for # of people in said town filled in the variables in the dictionaries from the town arrays. The save_var writes 1 variable at a time appending the next save_var under that. In notepad the file was the dictionaries with keys but gibbrish variables. The get_var() is boolean in 4.1.1 so file.get_var() not file.get_var(Variable1) . The first get_var() got the town dictionary back with all variables and the second get_var() the first person of said town ready to repopulate the town arrays. One can check for EOF, cursor position and other junk (use the docs) As an abide: Doing a file.close() closes the file and re-opening, adding another save_var appends that variable to the end of the file. There is no option in FileAccess to delete the file; however, Using FileAccess.READ_WRITE from docs: 'Opens the file for read and write operations. Does not truncate the file. The cursor is positioned at the beginning of the file.' IE writes over the file. Just tried all this out for the heck of it so probably simpler ways but like the tiny file-size and it can use encryption.
Thanks for the video, I'm just getting into saving/loading and will try this approach tomorrow. Side question, at 1:37 you show the _process function and at least as far as I can tell, this function is quite inefficient, no? Wouldn't it be better to access and update the text label only in the pressed functions when the buttons are clicked? That's how I've been doing it in my project but perhaps your way is better for some reason I'm not seeing. Thanks.
in my game there are situations where the value changes from other functions too so it makes sense for the value to be updated by process and not by button press and since process is fast enough it seems efficient to me but your way is still good if your values can only change by button press. why would it be inefficient though? (i'm still learning too)
@@dr.sleaseball441 process is called every single frame, i.e. it is called *often*. For a single thing like this it probably won't have too much impact, but if you keep adding things to _process that could/should be called more rarely/elsewhere, you will eventually run into a problem where too much stuff is trying to execute via _process and run into a performance issue.
@@dr.sleaseball441 Time to learn signals and singletons! Keep the number you want displayed in a singleton (basically, its somehow set up in the 'Autoloader' tab in the project settings), then give everything that interacts with the number a signal to increase the value, which then also tells the label to get notified.
I feel like a spoiled kid for even asking this, but I would have loved to be able to copy/paste from your code directly to my project. It's probably not very important for this tutorial, but maybe consider it for future tutorials? Anyway great work! Thank you so much
I just started working on that problem myself and found a solution. In my setup the save and load functions are in a global script, and in that script I set a player_position variable. In the Player scene I set that Global.player_position variable I made to position (yeah, just Global.player_position = position) in my _physics_update function in my Player scene's script. This makes save work with player_position in your save function. Finally I put position = Global.player_position in the _ready function. This sets your position from the loaded data.
I have been having this problem where my variable values get confused with other variables. Is there a fix to this other than deleting the original save file?
Thank you very much this video is really easy to follow but i have a little problem i wanna save and load array variable but when i do a load func it's say can't convert array to bool i wanna make scoreboard for event and i need array to collect player name and score
the first time im leaving a comment for a game dev tutorial, because it really helped me with storing variables for my game, thank you so much for this tutorial!
does this work with global variables (variables stored on a global script) but does that mean the save and load must be in the same global script or can it save and load from other scripts from other nodes?
when i do that exact code i get the error : Invalid type in function get_var in base 'FileAccess' cannot convert argument 1 from nil to bool can someone assist me here
Very nice tutorial. Concerning the save path, it must always start by "user://..." ? Does this path will be correct for all players if my game is in production ?
user:// is a special path that is different based on OS that is writeable by the user account running the program. say in windows its nested in the appdata folder.
i tried this, you don't need to type the variable name in get_var() ,it doesn't do anything when you call get_var() it offloads the variable in the order that they were saved // I have save 2 variable to the file data1 = 123 data2 = 456 func load_data(): if FileAccess.file_exists(filepath): print("file exists") var file = FileAccess.open(filepath, FileAccess.READ) print(file.get_var()) //will print out the first variable saved // data1(123) print(file.get_var()) //will print out the second variable saved // data2(456)
How do you do it with arrays? This seems to only work with normal variables. For instance I have a array var level_flags = [1,5,3,4] How do I save that cuz It always gives an error.
Question: If i add a new variable later on, this code doesn't make it write the new variable to the existing file and the old file has to be deleted to fix the issue, how do i fix this? EDIT: I fixed it by using this on my singleton; var UserSettings = "user://UserData.save" var default_game_data = { "xp": 69, "somethingsomething": true, } var game_data = {} func _ready(): load_data() var file = FileAccess.open(UserSettings, FileAccess.READ,) if FileAccess.file_exists(UserSettings): game_data = file.get_var() print("FILE EXISTS") file.close() for key in default_game_data.keys(): print(key) if not game_data.has(key): game_data[key] = default_game_data[key] print(key, " added") file = FileAccess.open(UserSettings, FileAccess.WRITE) file.store_var(game_data) file.close()
I have this setup to save the highscore of the player, it works fine when I run the game inside Godot, but when I export the game, it crashes when it tries to save, do you have any idea why that might happen? Your videos have been very helpful, thanks!
why complicate with inventory? inventory already has to live as a data structure somewhere while youre playing the game, just save that, structure and all, like, wut
Great tutorial but quick question. When I add new variables to be saved on an old save file I get an error and I have to delete my data to fix the error. Is there a way to not have to delete my data every update I make to my game? I don’t want people having to delete their data just to play a new version. I am using global variables if that’s an issue
Personally, after loading saves, I immediately add a check for a null value, and if so, the variable gets its original value (though I’m not sure if this is an effective way, but still)
Does godot create a file in the directory when saving data? or it the file created internally which technically won't be human readable? (need to know for a project)
it will be readable, you can encrypt it, instead of FileAccess.open(path, FileAccess.WRITE/READ), you do FileAccess.open_encrypted_with_pass(path, FileAccess.WRITE/READ, "password")
@@dev-worm fixed last issue but now when ran it says "Invalid type in function 'get_var' in base 'FileAccess'. Cannot convert argument 1 from String to bool."
hey THANKS HEAPS, im currently playing around with the FileAcess stuff , I am able to check weather a save file exists and use store_var and get_var to save and load, however when I altar the script and add new variables to save and load it causes an error on load cause those variables dont exist. im trying to find a way to check if the variable im trying to fetch with get_var() currently has data to retreive is this possible does anyone know?
your method works fine and actually helped me learn save load faster. So thank you for that. But I'll prefer directories like this , var data={some_string:"phrase", some_int:2}. This is much easier to understand.@@dev-worm
You can't go to the more complex ones without knowing the very basic. Although yeah, it's quite obvious that you'll save/load it from a file. It's just… about how you do it on GDScript 🤔 Then he provided/said examples on how you can use it. Which are udeas that'll likely not thinked of by new devs.
@@dev-worm I was saying . I tried to do the same code you did. But I have a problem entering the variable and extracting it. The file does not allow me to enter the variable. Note: I am using Godot 4.2. Does the method work on this version?
Notice 1: You should say file.close() after ur done using file
Notice 2: It's better to save it to user:// instead of res://
Notice 3: It's better to save the data as a dictionary instead of a plain integer variable, so you can group it together as one because calling get_var() will move the pointer up
Notice 4: Someone mentioned that it's even better to save using custom resources but idk how to do that and dictionary seemed to work fine
can you elaborate on the second point?, where does user:// save the file in? and why is it better that way?
@@parvjain21 project -> open user data folder
@@parvjain21 I would also like to know
@@Its_Kioh i would also like to know
@@lu34z I would also like to know
get_var() does not get the variable like parameter. You don't need to put the variable like parameter. It just returns the first variable founded, the the second...
You returned the variables that you stored beacuse you called it in order as you declared.
Thanks. I was scratching my head at that one. xD
So you only need to call get_var() without specifying the variable in the parenthesis specifically?
@@dominicballinger6536 Yes, because the parameter of get_var() does other thing.
@@jorgedavidcoronadoalonso I didnt understand can you please explain it simply?
@@sorsx Sure, if you use get_var() many times you will get the next variable in row. If you have 3 variables stored, you will get the third variable if you call the function three times, not by putting the number three as parameter. The situation of the video is coincidence because he called the variable the same number of times as variables stored.
That's what I wanted for a long time. Thanks!
glad i could help!
Bro can we save whole sene
@@dev-worm can we save the whole scene just what like @MdTahsinMazhar-qr7uw said?
love the step by step process and how clear you were
Short, simple, and actually works! 10/10, 5 stars, would code again
awesome I am so happy to hear that! thank you!!
Thank you so much for this tutorial, it is way more helpful then the other ones which just blast me with code, and expects me to understand. I really appreciate it.
so happy to hear!
@@dev-worm hey can you make a video fixing any errors people have
Always excited to see your next video!
means the world to me!
Exactly when you feel lost hes here to save you thank you man
aw I am so glad it was helpful!! thank you so much, if you ever need anything feel free to let me know!
thx man i need that i been look for some one to show how to save vars and load them you was the best one i found i love all your video's your videos help a lot over my first year of using godot 4 so thx all your vids are amazing thx for all your work
so glad to hear that!! thank you!! and if you ever need anything just let me know!
i've been struggling with this issue for a week on end. it's stumped me more than any other coding issue i can recall. i felt demotivated to work on my game, more than i have in a long time, all because of the stupid saving and loading.
this video completely fixed it in 4 minutes.
i am so sorry to hear youve been have issues with that so long, im just glad to hear the video was able to help! If you ever need anything then feel free to let me know!
Hi bro, I'm from Russia. thanks for a very good and fast guide, although it seemed to me a little dirty in the code, but THANKS for everything else!!!
Кек
Thanks man, For me who is making only arcade games, Its important to know something new.
glad i could help!
Thank you so much. This was WAY easier than the one on Godot's website.
Glad it helped!
Beautiful tutorial, simple, clear and concrete. Thank you so much!
so glad to hear that!
Finally you uploaded it. Iwas waited it from along along time❤❤❤
glad i could help ❤️
Thank you so much broo ,i appreciate your efforts,i was waiting for this. it's very helpful ❤❤❤
i'm already starting to see how this could help me out, thanks for the guide.
hope it can help!! thank you!!
Thanks you! I am made the cliker game, and you are very help me!
I am so happy to hear that!!
Thank you so much! I really need a save & load system for my game because it's going to have a lot of levels
i am glad to hear!! I hope it was able to help! Update me on how the project goes!
Thank you so much, This is the only way that actually worked for me thank you ❤❤❤
I am so happy to hear that!!
@@dev-worm Have you made a video about the topic "How to make Ai enemies?" ++ How to save the options like savibg buttons activation or slider percent?
@@dev-worm+ I subbed
the user:// thing is really cool
thanks! great vid 🎉🎉
glad to hear it helped!
Exactly what i needed! indeed useful
Thank you, I wasn't even aware of store_var and get_var for files. Very helpful!
glad I could help!!
bro you are such a life saver,i wish all the good for you
glad to hear that!! thanks!! wishing the best for you too brother!
Thanks for this! Came just in time for my game! I'm using it to save position of generated tiles so the level loads the same when it can load random levels!
so amazing to hear!! hope everything comes together correctly!
thank you so much for this video u saved my life
i am so happy to hear that!! thank you!
Thanks for this W tutorial, easy and fast implemention!
glad to hear! thanks!
Thank you so much for this! I started learning Godot a few days ago and this is a huge help.
Quick question; would it be possible to save and load two different types of data separately? Many survival games save characters and maps separately, for instance. It seems like it would be possible, but I'm not entirely sure and don't want to dig myself into a hole.
thanks! Yes of course its possible but I'm not exactly sure how ill beable to explain it over text.. so maybe I can look into creating a more advanced save and loading tutorial
@@dev-worm That would be great. Almost all tutorials on Godot are simple which has its place but how about an advanced concept to save for example in the game I'm making: Using Godots tilemap saving only the tiles changed from the original map.
There's 39 towns on the map each a class with tons of variables including a population in an array in the town class from another class which has all the per person stats which in itself has more arrays for their memory.
Simply put: Array of 39 towns: each town has an array of up to 100 individual people and each of those people have some arrays for their memory. It's all held in a singleton(global) with duct tape. Kinda tired of stumbling around figuring all this stuff out myself and making a video about it.
Please pity us and help? I have cookies. That I baked. And accidently swapped the sugar for baking soda. Nobody wants them so they're all yours for an advanced video on the concepts of saving a mess like this.
Okay I've sort of figured this out. The important thing to note is one has to extrapolate the data they want saved, then reconstruct it on load.
In the above case I created a dictionary called thisTown and another dictionary called thisPerson (no memory arrays tried yet). Then with a for loop for # of towns and another for loop for # of people in said town filled in the variables in the dictionaries from the town arrays. The save_var writes 1 variable at a time appending the next save_var under that. In notepad the file was the dictionaries with keys but gibbrish variables. The get_var() is boolean in 4.1.1 so file.get_var() not file.get_var(Variable1) . The first get_var() got the town dictionary back with all variables and the second get_var() the first person of said town ready to repopulate the town arrays. One can check for EOF, cursor position and other junk (use the docs)
As an abide: Doing a file.close() closes the file and re-opening, adding another save_var appends that variable to the end of the file. There is no option in FileAccess to delete the file; however, Using FileAccess.READ_WRITE from docs: 'Opens the file for read and write operations. Does not truncate the file. The cursor is positioned at the beginning of the file.' IE writes over the file. Just tried all this out for the heck of it so probably simpler ways but like the tiny file-size and it can use encryption.
simple and easy, thanks a lot
This was simple and great
Damn this is easy to understand and simple
so happy to hear that! I hope it is able to help!
you are just so good, you've saved my ass a ton of times
Thanks for the video, I'm just getting into saving/loading and will try this approach tomorrow.
Side question, at 1:37 you show the _process function and at least as far as I can tell, this function is quite inefficient, no?
Wouldn't it be better to access and update the text label only in the pressed functions when the buttons are clicked? That's how I've been doing it in my project but perhaps your way is better for some reason I'm not seeing. Thanks.
in my game there are situations where the value changes from other functions too so it makes sense for the value to be updated by process and not by button press and since process is fast enough it seems efficient to me but your way is still good if your values can only change by button press. why would it be inefficient though? (i'm still learning too)
@@dr.sleaseball441 process is called every single frame, i.e. it is called *often*. For a single thing like this it probably won't have too much impact, but if you keep adding things to _process that could/should be called more rarely/elsewhere, you will eventually run into a problem where too much stuff is trying to execute via _process and run into a performance issue.
@@Kusnierr I see, you are right.
@@dr.sleaseball441 Time to learn signals and singletons! Keep the number you want displayed in a singleton (basically, its somehow set up in the 'Autoloader' tab in the project settings), then give everything that interacts with the number a signal to increase the value, which then also tells the label to get notified.
@@Marius2Rocker i heard of singletons before but never actually tried to learn what it does, so guess it's time to learn that.
Thanks you so much you help me a lot.
I feel like a spoiled kid for even asking this, but I would have loved to be able to copy/paste from your code directly to my project. It's probably not very important for this tutorial, but maybe consider it for future tutorials? Anyway great work! Thank you so much
thats a good idea, Ill most likely start posting a GitHub link in the description so you'd beable to copy and paste it!!
Have this error to me Invalid type in function 'get_var' in base 'FileAccess'. Cannot convert argument 1 from Nil to bool.
thanks man this video comes right on time for my project !! how could I apply that for a player's position upon changing scenes tho ?
I just started working on that problem myself and found a solution. In my setup the save and load functions are in a global script, and in that script I set a player_position variable. In the Player scene I set that Global.player_position variable I made to position (yeah, just Global.player_position = position) in my _physics_update function in my Player scene's script. This makes save work with player_position in your save function. Finally I put position = Global.player_position in the _ready function. This sets your position from the loaded data.
I have been having this problem where my variable values get confused with other variables. Is there a fix to this other than deleting the original save file?
very helpful! thx
glad I could help!
Best Channel
aw thanks!! means the world! glad it helped!
Thank you so much, that helped me a lot. Does it still work if I upload the game and run it on a mobile phone?
yes!! it should still work!! if you are having any errors just let me know!
I love explaining
I will definitely use this in the furture!
so happy to hear that!
Thank You Friend! Have a nice coding :)
subscribed, thank you
thank you so much!! it means the world!! I am glad it was able to help!
Thank you very much this video is really easy to follow but i have a little problem
i wanna save and load array variable but when i do a load func it's say can't convert array to bool
i wanna make scoreboard for event and i need array to collect player name and score
With this method can you save entire objects of a class, such as with color and texture data loaded for that class?
Hello! Question, does this need to have each variables in order or we can load them at whatever order without it bugging?
it should allow you to do it in whatever order you want!!
Thanks.
of course! thank you!
Thanks, but where can I find the file?
the first time im leaving a comment for a game dev tutorial, because it really helped me with storing variables for my game, thank you so much for this tutorial!
does this work with global variables (variables stored on a global script) but does that mean the save and load must be in the same global script or can it save and load from other scripts from other nodes?
I thank fuckin' GOD for you, man
thank you!
of course anytime! thank you!
Still works in Godot 4.3!
great, really simple to apply. Is it possible to implement it for a browser game?
the user:// path should work for html5 exports as it will be stored on a virtual filesystem via indexeddb
when i do that exact code i get the error :
Invalid type in function get_var in base 'FileAccess' cannot convert argument 1 from nil to bool
can someone assist me here
same :(
@@gamedevomnitry replacing store_var with store_line that fixed it for me
Very nice tutorial. Concerning the save path, it must always start by "user://..." ? Does this path will be correct for all players if my game is in production ?
yes, user:// works for anyone.
user:// is a special path that is different based on OS that is writeable by the user account running the program. say in windows its nested in the appdata folder.
Please make a tutorial/tips for World Environment
THANK YOU
anytime!
Thank you
Can you make tutorial about local multiplayer in one computer like game fireboy and watergirl
How do i create the file? I did exactly like the video but just says that there is no file, witch type of file should be in the filepath?
Does it work for GODOT 3.5.2? Sorry for asking (I know the title clearly says "4")
But how do I save his position the numbers work but I haven't figured out how to save things like the world or player position
how would i load the data from different scene like a title screen rather than in the options menu?
you would have to have it stored within a global script, and pull that data from in each scene from that global script. I hope that helps a little
How can I save inventory data and load the same on startup??
i tried this, you don't need to type the variable name in get_var() ,it doesn't do anything
when you call get_var() it offloads the variable in the order that they were saved
// I have save 2 variable to the file
data1 = 123
data2 = 456
func load_data():
if FileAccess.file_exists(filepath):
print("file exists")
var file = FileAccess.open(filepath, FileAccess.READ)
print(file.get_var()) //will print out the first variable saved // data1(123)
print(file.get_var()) //will print out the second variable saved // data2(456)
I have a question, how do I do if I want to save the player's position?
does this avoid the problem that using the Resources node/type had that allowed people to run arbitrary code?
Maybe u can try to check the resource hash and type and if it doesn't match u just free the malicious resource
How do you do it with arrays?
This seems to only work with normal variables. For instance I have a array var level_flags = [1,5,3,4] How do I save that cuz It always gives an error.
Question: If i add a new variable later on, this code doesn't make it write the new variable to the existing file and the old file has to be deleted to fix the issue, how do i fix this?
EDIT: I fixed it by using this on my singleton;
var UserSettings = "user://UserData.save"
var default_game_data = {
"xp": 69,
"somethingsomething": true,
}
var game_data = {}
func _ready():
load_data()
var file = FileAccess.open(UserSettings, FileAccess.READ,)
if FileAccess.file_exists(UserSettings):
game_data = file.get_var()
print("FILE EXISTS")
file.close()
for key in default_game_data.keys():
print(key)
if not game_data.has(key):
game_data[key] = default_game_data[key]
print(key, " added")
file = FileAccess.open(UserSettings, FileAccess.WRITE)
file.store_var(game_data)
file.close()
How do I save booleans and other things? It always throws an error like this: Cannot convert argument 1 from String to bool
Everytime i get an Error can't use store_var on a null instance Something Like that
I want to save player position x , y and all of player visibility and it dose not work can you help me plz??
I have this setup to save the highscore of the player, it works fine when I run the game inside Godot, but when I export the game, it crashes when it tries to save, do you have any idea why that might happen? Your videos have been very helpful, thanks!
you have to make sure in your script that your creating a new script and not just trying to add/change variables in a script that doesn't exist
It works on windows when I export it but not on macOS. Any ideas?
why complicate with inventory? inventory already has to live as a data structure somewhere while youre playing the game, just save that, structure and all, like, wut
My variables get confused whit other
For me I’m trying to save a score which is a text as a variable and it won’t work saying can not convert text to bool
did you statically create the variable as only being a bool value??
Great tutorial but quick question. When I add new variables to be saved on an old save file I get an error and I have to delete my data to fix the error. Is there a way to not have to delete my data every update I make to my game? I don’t want people having to delete their data just to play a new version. I am using global variables if that’s an issue
Personally, after loading saves, I immediately add a check for a null value, and if so, the variable gets its original value (though I’m not sure if this is an effective way, but still)
Does godot create a file in the directory when saving data? or it the file created internally which technically won't be human readable? (need to know for a project)
it will be readable, you can encrypt it, instead of FileAccess.open(path, FileAccess.WRITE/READ), you do FileAccess.open_encrypted_with_pass(path, FileAccess.WRITE/READ, "password")
What if it's a string, or True/false value, Does it still work?
yes it should work. let me know if you have any errors with it!
@@dev-worm it says for get_var() it can only be a boolean not a string
@@dev-worm fixed last issue but now when ran it says "Invalid type in function 'get_var' in base 'FileAccess'. Cannot convert argument 1 from String to bool."
hey THANKS HEAPS, im currently playing around with the FileAcess stuff , I am able to check weather a save file exists and use store_var and get_var to save and load, however when I altar the script and add new variables to save and load it causes an error on load cause those variables dont exist. im trying to find a way to check if the variable im trying to fetch with get_var() currently has data to retreive is this possible does anyone know?
what about strings ? how to save those ?
the same way!
your method works fine and actually helped me learn save load faster. So thank you for that. But I'll prefer directories like this , var data={some_string:"phrase", some_int:2}. This is much easier to understand.@@dev-worm
Can this work for mobile games
Finally
Apparently this method doesn't work with variables that are strings.
Yes, it doesn't work with strings as far as I've tried
How to encrypt the data to be save
is it working for android ?
when i save 2 variables its work but when i save 3 there are a problem
really? hm.. it shouldnt do that.. is there any error
@@dev-worm i found the solution i delete the save file and its work
happy to hear that!!
thanks@@dev-worm
Dude saving manually 3 vars in a system that probably will contain thousands of them. What is even that tutorial
It is old, I have an updated tutorial that involved saving with resources so that'll be way better. sorry about that
Hey, at least it's good for noobs like me who would probably only use it for high scores
@@dominicballinger6536literally what I’m here for 😂
You can't go to the more complex ones without knowing the very basic.
Although yeah, it's quite obvious that you'll save/load it from a file.
It's just… about how you do it on GDScript 🤔
Then he provided/said examples on how you can use it.
Which are udeas that'll likely not thinked of by new devs.
i have problem in function save
whats the issue?
@@dev-worm I was saying . I tried to do the same code you did. But I have a problem entering the variable and extracting it. The file does not allow me to enter the variable. Note: I am using Godot 4.2. Does the method work on this version?
Go dot 🎉
why ".save"?
doesnt seem to work
it says null instance how to fix
at which area are you getting that error? that most likely means a variable isn't being set to a value somewhere before trying to be saved!
@@dev-worm mvm
Does this work in mobile?
NO Dictionary