Save objects to a string and load them

I am making a web game in which you build an island. Because it is a web game, I can’t use the gdevelop save feauture, so I wonder if there is a way to store all the objects’ position into a copyable string that when pasted loads all the objects in their correct positions.

As a heads up, web games can still save using the “storage” actions.

The logic to use them is mostly the same. Check out the main gdevelop youtube channel for the Advanced save/load video, which steps through using it.

I know it, but I want to do the thing I describe for another project.

Right now you can copy something from game and paste it somewhere
Same as you can get broker ID or whatever it is called for multiplayer games
And give it to other users so they can connect to it

So copy paste is possible

Now question is does formatting across copy/paste would be preserved
Cause you could copy whatever but all spaces/new lines/tabs or whatever else in formatting of how it is done in variable or json
THIS would be then only thing that matters
Cause as i remember for starters even few objects generate wall of text when saved
Because how it is formatted
And on top of that would formatting preserve?
Like for example here on forums
You can copy this exact line
“Yo There”
And paste it to text object
And it should display Yo There in your game but it won’t
Because forums changes formatting and you need to replace double quotes " " in gdevelop
By simply rewriting them
IDK why maybe forum formatting changes it to double single quoutes?
Or whatever else but simply it will not work

And on top of that comes question of
How much data can you have copied to clipboard at once?
Cause i believe there was also limit to it

So technically it should be possible
But it will depend on various factors i mentioned above

You are not answering my question. Basically, what I want is to read values from an specific symbol to another and extract them to store them as variables. Is that possible?

You will not be able to “create files” on mobile or web, no. You haven’t explained your use case on why you would need to instead of using the native storage functions, but:

You could maybe convert a structure variable to a json string (using the ToJSON expressions), have a text input object displayed, then set the text input object’s text to the value of that ToJSON. People can highlight and copy the text from there to whatever they wanted.

Then you could do the same, but in reverse (have someone paste their JSON they copied earlier into a text input box, and then click a load button which then stores it in a temporary string variable), and then use the “Load JSON into variable from text” and point it at the temp string variable.

As long as you’re following the best practices around save/load (all of your data variables are a child of a parent structure variable), you should be able to load and save all of the variables once (by just using the parent structure).

You are not asking anything i did not answer
You ask can you store object position to copyable string then paste it so it can be loaded to create all objects

And i did answer exactly that
TECHNICALLY you can make string which you can copy
TECHNICALLY you can paste into into same or another instance of game

BUT problem is will the formatting be preserved or not
AND how long string it would produce cause i think there is limit to how much you can hold in clipboard

Even if you could hold 10k objects worth of string
This still does not answer question will formatting be preserved
IDK how formatting change or does change at all after you copy it between different devices or even systems or even same system with different device
OR even worse if it would change trough however you send it
For example simple text file could change formatting or sending it via wahtsapp could change formatting even discord could change formatting and most likely will since it goes crazy over all signs like " * - ~ | and so go on
IF you can provide perfectly formatted string of what you get out of your game to another user then it should 100% work
BUT problem is HOW you gonna send it to not break formatting
At this point IDK if what you would get from your game would not break formatting if it was copied to android clipboard

Simple example of it would be
You can copy my whole message and paste it on idk google translate
It will be exact same text
It will have spaces in exact same spots
But will font be the same?
What if i do THIS
Will it be preserved or will google translate break formatting?

That is the issue here