A couple of notes about this come to mind. I noticed that you had trouble with setting a global variable to the user-input room number, and just set it to a static 99 instead. This can be done by coercing the string value into a numerical value by using the system expression int() or float().
Thanks! I feel like an idiot now, i really should have known this as i did do some java in school, and we did exactly this to convert ints to strings, or strings to ints.
Also, I noted that a 100-room dungeon ends up creating around 5,200 wall tiles and 15,300 ground tiles, then reduces the number of wall tiles to 400-700 or so after destroying the ones that overlap ground tiles. This leaves a lot of 'stacked' ground tiles that are unnecessary. It also may need two passes to remove all of the extra walls, since it's doing all of that in a single tick, and Construct only updates such changes at the end of the tick.
Again, i have no idea how i didn't think of all those excess ground tiles stacking up .
I would probably avoid creating all of the extra tiles by using the system condition object overlaps point to test of a tile already exists at the current drawing location. Putting the wall and ground tile objects together into a family (say, 'blue') would simplify things. Then the drawing part could be done something like so (in pseudocode):
if (wall tile):
if (family blue does not overlap drawing location):
draw wall tile
if (ground tile):
if (wall tile overlaps drawing location):
destroy wall tile
if (family blue does not overlap drawing location):
draw ground tile[/code:1n57v74v]
That assumes that the wall tiles will be destroyed instantly, and the next check will not see a 'blue' there afterward. I'm not sure if that's the case, but otherwise one could add another 'draw ground tile' after the 'destroy wall tile', I guess.
I really like this idea, a lot, but i wonder if it would make the dungeon a lot slower to generate? Since it will be checking for an overlap every time it tries to create an object? I'm probably totally wrong, and I'm going to give this a try right now .
Also, just for fun i decided to change the second function, instead of setting the room pos to a random wall tile, i set it to a random ground tile and it seems to work much better this way.