You can’t really make a script permanent, nor make a variable stay the same if you close the game, so you’re gonna have to make a save system so then you can put your variables in a file and just read that file to then set the variable you wanted to that.
I’ve watched it but he doesn’t explain how to manipulate variables. How can I change their values with code? Like his variable “health” he changes it with an other software, but how can I do with gd code?
MightyRat | 2020-06-19 12:12
Here’s another video that make a little bit more sense
i didnt actually watch the previous video beforehand, sorry about that!
This video is the tutorial I followed to make my own save system in my own game, I hope it helps you with what you want to do!
if you have any questions, I’ll be happy to help you
dustin | 2020-06-19 12:36
Ok, I copied that script, the only thing I don’t undestand is what should I write as var path
MightyRat | 2020-06-19 14:02
if you want the file to be editable when you’re play-testing the game, use “res://data.json”. but if you want it hidden for the regular user, use “user://data.json”.
the only difference is that “res://” path saves the json file in your project folder, and the “user://” path saves somewhere hidden (I dont particularly know where, but its definetly hidden from the user)