So how can I make a dynamic map? I thought of two ideas. The 1st idea is to start with a completely open map, all floor. And then you dynamically build paths. The 2nd idea is a more controlled version of the 1st and that is what I went with. You specify all possible paths in the map and you tell the game which areas of the map you want to "link" to. The requirement is that the finished map must link all places you specify without making any extra paths to do it. It will use a subset of the paths you specify from the map layout and just enough of them to link the rooms, no dead ends. After the paths are done, it spawns invisible walls, wall textures and calls setAutomapTile() to close off paths not used for the run.
So I got it working. In doing this I can truly say I know LUA now. I am a C++ and Java guy and was brand new to LUA and modding until now. LUA is a very different animal to say the least.
Below are screen shots of the map layout (it can be almost any layout you want). Note how there are far too many open paths than you would want in-game. Then I show two different "runs" of what the game actually chose. You will notice that in my map I have 5 2x2 rooms and 4 exits. The maze randomizer MUST link all of these to work.


