Trying to puzzle my way through creating a Save System at the moment. Basically all the important information in my game is saved through Global Variables, most of it characters and items that have been unlocked. I’m having trouble figuring out how to store the information using the ‘write/read a value’ system, particularly the read part where it only lets me apply the information to Scene Variables, not Global.
My first question is what exactly do I need to put in each of the fields for the ‘write/read a value’ command, and my second question is is there an easier way to store a lot of Global Variables as opposed to a separate command for each one?
Is this quick tutorial on saving at all helpful?
my problem is that gd stores variables in local storage, so when i open the game in an other computer or cel, doesnt load the variables stored in local storage of the browser at the other computer
how can i do this?
You need a way to transfer variables between two computers. This is a bit more complicated. You would need a web server, and use requests. On the web server side, you would need to write a PHP script to handle the data and keep it in a database (simpler) or a node.js script (slightly more work).
In case you want to transfer the HTML5 game between computers and run it locally, you may better off if you wrap your HTML5 game in to a native executable.
You can do just that with NW.js
NW.js is basically a (Chromium based) browser that runs any indes.html that you copy in to the binary folder next to nw.exe. You can also package your game and the .exe in to one executable.
In case you are trying to share information between computers such as high score, as kalel mentioned you going to need a web server, there is a tutorial on the wiki how to do it:
wiki.compilgames.net/doku.php/gd … highscores
In case you want to create an online multiplayer game, that is require to use Web sockets but it is not available in GDevelop yet.