Ask here your questions to get help using GDevelop.
By hmsdel91
#53139 hi, i wanna know how to save the progress of the game i made???, i mean, i want to add a save game option to my game..

and the other question is.. is there a way to use .txt files?? thanks
User avatar
By Lizard-13
#53140 You have to use the actions to save/load data, in the "Storage" section. You can save numeric values and strings :)
In native games, you save the data in XML files. In HTML5, the data is saved in the browser storage.

Note that there is an action and an expression to convert a structure to a JSON string and vice versa, it saves a lot of time since it lets you to save and load entire structures as strings ;)
By hmsdel91
#53143 hi, i read something like that..but i cant understand everything..i go to the store section right?, then i go to write a text, and here comes my problem... what archive do i need? what is group, and what should i put on text??...
and how can i acces to the file i want to read later?

i'm on html5...
User avatar
By Lizard-13
what archive do i need?

The file where you want to save the data, for example, some games has the saved user data in a folder inside the game path (it is easier).
In HTML5, it doesn't matter a lot, put a nice filename and you are ready.

what is group?

The group system lets you to structure the file. For example, save the username in the group "main/user/username", the final structure should be something like (in XML):
Code: Select all<main>
        <username texte="Lizard" />

what should i put on text?

The text (or value with the action to store values) that you want to store ;)

I have two screenshots that show how to debug the storage system.
With this event:
storage_example0.png (8.49 KiB) Viewed 3603 times

I get this result:
storage_example1.png (19.88 KiB) Viewed 3603 times

Note: The text object has been updated correctly.
You can check the file in the debugger (Firefox here, but surely every modern browser can do it, I had to active the storage viewer in the debugger options to be able to use it).
User avatar
By Ousaf
#53169 How can javascript read and write txt file. that's not possible. Only it can read and write browser provided storage??
User avatar
By legion-_of-doom
The save function in HTML5 games uses the webbrowser webstorage to store the data.

Because i'm curious.. Where does it put it in Android or IOS apps? Can games save there progress in apps?
Sorry if it's a silly question. I didn't know :3