Storage problem

I am having a problem with saving/loading scene state
I have “Blocks” that you can place in a 50x50 grid, i need to save:

  1. X position of the blocks
  2. Y position of the blocks
  3. Block current animation frame (Block texture)
    I was hoping for a way to store data in variable list (if these exist, and if they do then answer please)

I can code you a little Js snippet. If all the blocks have the same object name it should be easy. Is there anything else/any object that should also be saved? What is the objects name?

I was wondering how to create arrays in GD as well


Same here!..

1 Like

The objects name is just “Blocks”, i dont think there is anything else that needs to be saved, just that.
Thank you in advance.

in this moment there isn’t arrays in GDevelop. but you can simulate its function with variable structures. you sholud learn how they work, and you have to adapt to it.


For all who wins how to use arrays use Js, if you can’t use Js then wait that somebody (maybe me :eyes:) codes an extension for it. In the meantime here are my snippets (untested just wrote out of memory) to save and load an array with all the instances x and y position and their current animation:


 function save(runtimeScene, objectName){
	let save = [];
	let objects = runtimeScene.getObjects(objectName);
	for(let object of objects){
		objData = [
		    		"name": objectName

save(runtimeScene, "Blocks");

For loading:

function load(runtimeScene){
	let save = localstorage.getItem("gameSave/grid");
	let objects = runtimeScene.getObjects(objectName);
	for(let object of objects){
	for (let o of{
		let object = runtimeScene.createObject(;


Sorry if it is not clean I wrote it quickly in an app that wasn’t thought for writing code (word mobile) and because of a bug I had to rewrite it 3 times because it deleted itself.

1 Like

If there are no more problems I will close this topic, is that ok?

An example is included with GDevelop called “Level editor”. Do exactly what you asking. Have a look.

I can see you are closing topics as soon you consider it “answered”, could it be possible to wait at least 48 hours regardless of the result of the discussion?
If there is no activity for 48 hours then close it :+1:


Thank you, this topic can be closed now.

This topic was automatically closed after 3 days. New replies are no longer allowed.