Is there a way to turn a map created in the preview, into events?

I’m kind of thinking in advance of a next project.

Let’s say you design an individual map out of many (say 50), in the preview, using tilemaps.

Rather than having to manually create events to have this map recreated when the player selects a level, would there be a way to have this automatically done by Gdevelop?

Is there a way to turn a map created in the preview, into events?

yes there is! (i don’t know about tilemaps specifically)

you simply have to

  • iterate through each objects of the group
  • put their info in an array
  • convert this array into JSON string
  • save that string to storage (you now have the map made at runtime saved to gdevelop storage)

to load it

  • load the JSON from storage
  • parse JSON to scene/global variable
  • then iterate through the array to create corresponding objects

this method is detailed here: https://www.youtube.com/watch?v=9ReOBFoSD3g

I’ll watch it, but doesn’t that just mean manually inserting the positions of every tile?

i never used tilemaps, so someone else should back up what i say

Oh wow, I actually did just watch it, I do see what you’re saying. That would actually work. The issue would just be shipping the saved data with the actual game.

simply put it into a txt file instead of storage

Yeah I see what you’re saying. Never thought of it that way. At least I know there’s a way that’s potentially much easier. Thanks BTW

You could also create the tilemaps in seperate external layouts and then add the desired layout when needed.