Creating "Blueprint" for rooms



I'm working on a game, where the level gets randomly generated out of little room tpyes like cooridors, normal rooms, staircases, etc. These are all in one gamemaker room. My level generation works so far, but at the moment I just use one sprite for each room, just to see if the level generation is working. Now I want to replace this sprite with a room, build out of multiple objects, but it would be very long-winded to code each room (f.ex. saying that at pos 0,0 obj_wall gets created, at pos 0,1 another wall,...) Is there a faster way of doing this? Can I somehow save room layouts in a data-type or could I use an image, where each pixel stands for an object and the color detemines which object gets created?
Thanks in advanced!


You need to design a system of storing the layout of each room type and then creating the objects. Personally I would probably look at creating a grid to store a number that equates to an object type, then you read through the grid and create saide object at the position. Then you could have different grids to make different layouts perhaps. There was a thread about this recently, you need to search about procedural room generation.


At the moment I'm trying to get the darw_getpixel_ext() function to works, but it alsways gives me the same 32bit value.
I use the following code in the draw event:
color = draw_getpixel_ext(mouse_x,mouse_y)
But it always gives me the value of the background. I checked that the object, that has the sprite I want to check in it, gets created before the object that does the checking.
It probably has something to do with this advice given in the manual:
With this function you can get the full abgr 32bit value of any pixel that is being drawn to the current render target. This means that the results will depend on the event in which the function is called, and also on the target surface being used.
But I don't know in which function to put it or how to change the target surface.