Block Replacer Window

The purpose of this tool is to search for a pattern of tiles, combined of a 8×8 grid, and replace these tiles with a user defined pattern. It consists of three windows.

Search for tiles

In this section we define the pattern that we wish to search for. Wherever a tile is white (no contents) acts as a wildcard and is always true.

You have several ways of filling the tile places. The primary way is by selecting a tile in the Tile Palette Window and click on a tile position just as you would work when tiling. The other ways involve using the buttons on the window.

  • Clear all: Clears all tiles.
  • Copy from Replace Tab: Copies the tiles currently on the Replace With tab.
  • Copy from current map: Copies the first 8×8 grid of your current view in Theater Window.
  • Clear tool: When selected, clicking (or click and drag for a region) will result in clearing the selected tiles.
  • Paste tool: This button is enabled when you have copied a tile in memory (from the context menu in Theater Window) and will paste the tile on the position you click.
  • Search and Replace: Starts the search and replace procedure.
  • Close: Closes the window.

The directional buttons below move all the tiles. If a tile is moved out of the 8×8 grid, is deleted.

TipThe way this tool searches for pattern is this. It goes through all the tiles in the theater and for each tile, it assumes that, that tile is the lower left corner of a 8×8 region. Then it checks seven tiles left and above it, and if can match the pattern, returns it as a result and replaces it with the contents of the Replace with tab.

This way, the position of a tile in the 8×8 grid is important, as a white tile just means any tile and not any tile or no tile. Furthermore, keep in mind that when a replacement is made, the tool when it continues it search (e.g. on the next row of tiles), will see the new values that previous replacement put there and not the original. So some patterns may produce some undesirable results, especially if they are too general.

Replace with

This section has the same functionality as the Search for tiles section. The only difference is that instead of having a Copy from Replace Tab button, it has a Copy from Search tab button.


After a Search and replace action, we can see our results in this tab. The logic is simple. Initially, all replaces are made and everything is checked. If you want to undo a replacement, just uncheck the desired result on the list. Double clicking on the list will get you to the result's position in Theater Window.

You can check or uncheck the Select all checkbox to select or deselect all the results, or use the Select every button to select every x results (where x is the value you put in the textbox. Moreover you can push the Random button to have a random selection of results.

At the bottom you can define if you want the result areas to be visible on both the Theater Window and Theater Preview Window and what color the outlines will be drawn with.

CautionYou can undo the results only until a new search is made from this tool. After a new search, the results you had selected before the search are permanent without the ability to undo.
manuals/terraineditor/reference/temain/block_replacer_window.txt ยท Last modified: 07/12/2013 11:47 (external edit)
GNU Free Documentation License 1.3
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0