This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

So I'm just testing out saving, I have a project where there are multiple levels and you have to answer question to unlock the next level. For example

(I made a global script which had the variables)
var Q1 = null
var Q2 = null

(gamescript)
func process(delta):
if Global.Q1 == 4:
get
node("Next").disable = false #Allowes you to proceed to the next level

(Levelmenuscript)
func process(delta):
if Global.Q1 == 4:
get
node("L2").disable.false #this is the level menu and unlocks the next levels

SO THE quesion is how do i store the information thats in global file into a seprate file because when ever i leave the game an

go back into it the level locks its self again.

Godot version 3.8
in Engine by (12 points)

1 Answer

–1 vote

You can look into saving and loading data. Here's a quick ~3min video on how you can use JSON files to save and load data for the game:
https://www.youtube.com/watch?v=L9Zekkb4ZXc

Here's a more detailed video:
https://www.youtube.com/watch?v=9nT_EiDXjJY

You can also just search on YouTube or Google to find more resources. There are tons of useful articles and videos on the matter.

Finally, I also recommend you to checkout the documentation page for the File class and the JSON class.

by (182 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.