Erase/clear output layer before automapping

I have automapping setup and when I press CTRL-M it creates the output layer correctly.

However, when I then edit the tilemap to remove some unwanted tiles, and then press CTRL-M again it overlays the new version over the top of the old output layer.
This results in phantom blocks remaining on the output layer.

I can go to the output layer, select CTRL-A followed by the delete key to clear the layer and then it creates the output correctly when I press CTRL-M.

This is obviously very clunky to have to do this for every refresh - is there a way to automatically have the output layer start from scratch every time I press CTRL-M

You can use the DeleteTiles map property to automatically clear the input region before applying the output.

If that’s not enough (e.g. if you need to clear areas that might not get output to), you can create a rule that clears the layer. input_TargetLayer: MatchType Ignore tile, output_TargetLayer: MatchType Empty tile. Have that run before all your other rules and it’ll clear TargetLayer of all tiles.

Ah perfect - just tried it and it works.

Thanks for sorting out this head-scratcher for me

1 Like

Just to confirm - I already had the DeleteTiles property set so I needed to add the new rule

You should not need DeleteTiles any more. That property is mainly a holdover from pre-1.9 Automapping where it was the only way for Automapping to erase tiles, though it’s still useful in a few situations. Now, you should generally use the MatchType Empty tile to delete tiles.

Thanks, I’ve unselected it