[Ace] Help with modifying Random Dungeon Script

At the bottom of the post I have uploaded Saba Kan's Random Dungeon demo. I modified it so that the stairs of the first level lead to the same level. My goal is to make is so that every time the player enters the dungeon the map is recreated.

By adding the following snippet below to the script section, I am able to achieve the regeneration every time but it introduces a bug. Events are not properly erased and the new events are invisible (can still interact with them). So I don't think this is the best way unless I am forgetting to call a method or something.

I DID NOT PUT THIS IN THE DEMO



Code:
class Game_Player < Game_Character
  def perform_transfer
	if transfer?
	  set_direction(@new_direction)
	  $game_map.setup(@new_map_id)
	  $game_map.autoplay
	  moveto(@new_x, @new_y)
	  clear_transfer_info
	end
  end
end
Thanks for reading. Please help me figure out how to properly make it so that the dungeons are re-generated each time the player enters the level (even if the player is entering the same map id)

Note: Green box on the mini map = treasure chest while empty square = stairs. If you go downstairs with the snippet above the map changes but the event graphics do not match the location they are on the minimap.

Random Dungeons.zip
bumpity
What I ended up doing was make the dungeon, then copy and paste it, so there was two of the exact same ones. Then, every time they too stairs down, Variable: Depth +=1 and they would move to the other one, but I did have to change the stairs to point to the other dungeon. Then, when they go up, Variable: Depth -=1 and they would move to the other, unless the Depth =0, then they would port to the entrance.

NOTE: Hope this is not Necro

Original thread: https://forums.rpgmakerweb.com/threads/ace-help-with-modifying-random-dungeon-script.2886/