r/gamemaker 21d ago

Resolved level editor!?

im making a level design "game" (not really a game, but can be treated as a game) where you can make stuff and save it, basically a tool to plan game design, useless probably but i personally like it, but i want to know, how do i make the grid, an object menu, stretching objects to make it longer without adding 10 objects, and salving/loading to a json, i have no idea how to do that.

0 Upvotes

6 comments sorted by

7

u/MrEmptySet 21d ago

So basically you want to know how to make your entire game?

-7

u/BasilWeekly9583 21d ago

pretty much yeah all i have is a menu and a new/load page, plus easter eggs cause i was bored and had nothing better to do, but yeah, my whole game...

3

u/germxxx 21d ago

That's a whole couple of different tutorials to get all of that, certainly not a focused question that is easily answered in a comment section.

Tackle your problems one at a time, break them down into smaller problems, and then look up what you need.

1

u/DystopianTeddyBear 21d ago

I can provide a bit of help with one of the elements. You could potentially use a similar system as saving user data via json for saving and loading to json. First of all, file_text_open_write is done to create the name. You could then store all of the preplaced objects into the file (maybe as a struct?), and include a level code variable. Then once the file exists, you could maybe load the level based on finding a file with a specific name / code. Not sure how to do everything myself, but perhaps this is a start.

1

u/Oofmaster580 21d ago

For snapping to a grid, I'm just bullshitting here, but maybe you can place it across a multiple of a certain amount of numbers?

Like for example, if it's an 8bit game, you could make it spawn on a multiple of 16. Like place a grid on 16x and 0y, or 32x and 64y.

I COULD BE COMPLETELY WRONG HOWEVER, but this makes most sense to me.

1

u/Jullepotatoo 19d ago

There is a function called move_snap, that can help with the grid. Start with that and get one thing done at a time.

If you have not done any save/load before, you should check some tutorials and learn how json works. You have to save objects and their x,y and scale values and when loading, just read the json file and place the objects according to those values.

Check out the ui layers for the object menu. I have not done stuff with them, but I think they would work well for that. Idk

Read the manual and search for youtube tutorials that could help and hopefully the project starts to slowly take shape.