saving and loading
A game i'm making needs to save a grid of things. I think i can use the assets tab with a text file, but i do not know how to do it. Can i get an example that creates a file if it isn't there and can write and reat to it. Where the writing should replace the text file.
Can i get an example of that?
storage.set( name , value )
storage.get( name )
Value can be virtually anything, including objects, lists, etc.
It's unique for every user, so no worries for save data being available to others.
can i get it so it is global variables that i can save to and load from?
yes, you can load virtually anything into it. Just make sure to create fallback values if it cannot find a save.
the thing im looking for is a text file i can store level data that will not change, so i make thae game, then design the levels. then save to the text file.
When sombody plays it it will read the text file and load the levels
not indivual saving
Here's the code API:
https://microstudio.dev/documentation/API-cheatsheet/
Near the bottom there are tabs for saving and loading files (its titled file API, wont be hard to find), I do not know if microstudio works with text files in that way, but if it can, you can use the code found there. Though it sounds like it would be easier if you had the levels on a select screen, given that it sounds like you just want to make more levels whenever and its MUCH simpler update the game via microstudio instead of asking people if you can download files onto their computers (I dont know if they would like that very much).
If you want to store static level data in a project, create a JSON or plaintext asset and use the generated code snippet to load the file. You can create a plugin for the level editor, as they can modify project assets.