IV. MapEditor


The mapedit tool allows you to create and edit individual maps (.map files) in your adventure. All maps you create must be indexed by your maplist.txt file which is included in the adventure pdb (see Adventure PDB section).

The mapeditor is a pretty sophisticated program. Originally developed for Dragon Bane I, many features were added for supporting the Dragon Bane II engine. The program should be very reliable and the user interface is fairly optimized as it has been continuously improved since it was first written in 1997 as it was used to create the adventures included in Dragon Bane I and II.

To edit an existing map, simply select it when prompted for the map name. New maps can be created by running the mapeditor, going to the directory that you want, and typing in the name of the map. The mapeditor will ask you for the starting dimensions of the map (you may change this later). A new map will be opened with generic brick walls around the border. If the map does not fit on your current screen, you will get an error, and you will have to make the font that the mapeditor window uses smaller. To do this, go to the "Map Editor" item in the start menu, or find mapedit.exe in the install directory and right click. Select "Properties" then go to the font tab and select a smaller font.

There are two main sections to the mapeditor: features for editing the map, and features for editing optional "programs" that may be stored for individual special squares.

Mapeditor usage:

Understanding The Screen:

Creating Walls
Editing Special Instructions:


When it is desired that a square in a map do more than just look like whatever wall is placed there, you will need to add special script instructions to tell the Dragon Bane II engine how to behave for that square. There are two scripts (optional) for each square. The first script is executed only when the player steps onto that square (or bumps into it if the square is blocking). This script can then perform many actions based on this player movement. The second script is the display script. This script is executed any time the screen is redrawn, and the wall is in the player's view. This script is mostly used for changing the look of the wall based on runtime parameters, but has other more complex uses too.

State Bits, Variables, Timers, and Toggles.

Using stats variables, timers, and toggles, you can create an interactive world. You can make a disappearing wall that is only gone for a single move. You can make a tree that grows bigger, you can create a complex door lock, and much, much more.

Motion Script

The motion script is executed only when the player steps onto the square containing the script (or bumps into it if the wall is blocking). This script is used for giving treasure, pressing buttons, triggering traps, exiting to a new map, and many other uses.

Display Script

The display script is executed each time the screen is redraw and the wall is visible. This section of the script can be used to change the look of a wall based on conditions. For example, after you pick up a treasure chest, you need to have the wall display a blank square instead of a treasure square


In this example, we have a wall with an inlet and a chest in it. The chest contains a robe. If the player bumps into the wall, the script will attempt to give the player the robe in the chest. If the player has room in his characters' inventory, the robe is taken and the wall changes to become an inlet with no chest in it. If the player does not have room, the game switches to Party View and displays a graphic with a treasure chest and a message saying your party does not have enough room for the object.

MOTION SCRIPT                            DISPLAY SCRIPT

01: JUMP IF SET 019 007                  01: JUMP IF CLEAR 019 003
02: GIVE OBJECT 0209 006                 02: DISPLAY WALL 041
03: MESSAGE 003 0124                     03: END
04: SET STATE 19
06: MESSAGE 003 0125
07: END

Let's look at the lines of the motion script.

Now lets look at the display sript.