To start the map editor for Dragon Hunt, either run the file Map_Editor, or run python map_editor.py from the code directory.

Once the map editor is started, you will see a simple map on the left-hand side, and some tiles on the right. This is the main view of the map editor. To change the current tile, click on one of the tiles to the right, (the border of the tile will turn red, and the filename of the tile will be displayed to the lower-right) then click on the portion of the map you want to change. The rest of this file describes the various menu options.

File (f)


The items in this menu are fairly self-explanatory. Still, there may be a few suprises in here.

New


Creates a new map, using the current values for background, border, and size.

Rename


Change the name to save the map under. This does not actually save the map.

Load (l)


Displays a list of all maps in the currently selected module. Upon selection, loads the map. Note that doing this closes your current map without saving.

Save (s)


Saves the map. Note that there is no confirmation dialog.

Quit (Esc)


Exits the editor. Make sure to save first.

Tileset (t)


The contents of this menu depend on the tiles in the current module. The first entry, default, lists all the tiles in the images/tiles/ directory. The rest of the entries list the subdirectories of that directory.

By clicking on an entry, the tiles in that directory will be placed to the right side of the editor window, to allow them to be placed in the map.

Map Settings (m)


This menu allows editing various settings of the map. Be careful in here, as it is quite possible to clear a map.

Map Mode


This controls the behaviour that occurs upon clicking the map. A setting chosen from here will remain in effect until another setting is chosen
  • Replace Tile (default, F1): This will cause the base tile that was clicked on to be replaced by the new tile. Note that tiles added by the next option will remain even after the base tile was replaced.
  • Add Tile (transparency, F2): This allows multiple tiles to be layered; it is meant to work with partially transparent tiles. (In the tile display, transparency is indicated by the color black.)
  • Reset Tile (clear to background, F3): This setting does not care which tile is selected, but clears the clicked-on tile to whatever is set as the background tile. It is useful to remove tiles added using "Add Tile"
  • Adjust walkable status (F4): After chosing this, all tiles in the map will have a white or a black box in the middle. If the box is white, then the tile can be moved over by the player. If the box is black, then the player will treat it like a wall. By clicking on the tile, the walkable status will be changed from on to off or back again. Note that by using the "if" command or a few other tricks, it is possible to get a tile without a box at all. This is nothing to worry about.
  • Edit Onload/Edit Action (F5, F6): After choosing this, all tiles that have scripting will have a black and white box in the middle. (Large box for onload, little box with a dot in the middle for action.) Clicking on a tile will then allow you to create or edit the scripting commands for that tile. (Either onload or action, depending on your choice. Note that, first, you can click on any tile (not just the marked ones) and edit the scripting. The marks are just for convenience. Secondly, the file scripting.txt contains the information on the actual scripting commands that can be entered. Thirdly, if the envirnmental variable DH_EDITOR or EDITOR is set, the map editor will use that program to edit the scripting. (DH_EDITOR overrides EDITOR.)
  • Add Overtile (transparency, F7): This is similar to Add Tile, but the added tiles will be displayed over the player. You can see this effect in the town, when you travel behind a roof.
  • Copy Tile (F8):This copies all information about a tile to another space. This is useful when placing tiles that involve heavy scripting. To use, enter Copy Tile mode, shift-click on the tile to be copied, then click wherever you want it to be copied. To copy a different tile, shift-click on a different tile.
  • Map Size


    This menu allows you to resize the map, to allow larger maps. The various 15x15 (and similar) entries are shortcuts for chooseing "Custom Map Size..." and entering a width and height of 15 (or whatever). After selecting the new size, the editor will ask if you want to reset the border and background. If you have already started building the map, then you want to choose "no".

    There is no arbitrary limit to the size of levels, but performance issues may come into play. Check the performance of anything significantly above 40x40.

    Background and Border


    These are a shortcut to changing either all of the interior tiles, or all of the border tiles of a map. Note that using either of these clears a portion of the map.

    Edit Monsters


    This brings up a window where you can specify what monsters can attack the player in the level. Enter one monster per line, chosen from monsters.txt. For example:
    Crawler
    Slime
    Cave Bear

    Battle Background


    Specify which background is displayed in a battle. This must be a file in images/backgrounds/.

    Grid (g)


    Toggles the map grid. It either removes or replaces the one-pixel black border between tiles on the map. Having the border helps with positioning tiles; not having the border helps with making sure the map looks good.

    Other


    The editor_xsize, editor_ysize, and editor_tilesize entries in settings.txt can affect the size of the editor.

    Shortcuts:


    Esc is a shortcut for Quit.
    f is a shortcut for File.
    t is a shortcut for Tileset.
    m is a shortcut for Map Settings.
    g is a shortcut for Grid.
    s is a shortcut for Save.
    l is a shortcut for Load.
    1,2,3...0,-,=,\,!,@,#..._,+,| switch between the various tilesets. You can access the first 26 tilesets this way; the first 13 through 1-\, and the second 13 with the shift key.
    F1-F8 switch between the map modes. (Replace, Add, Reset, Walkable, Onload, Action, Add Over, and Copy Tile)