Merging maps by ColJack
This tutorial describes how to "merge" two levels of two separate maps together.
It is useful if you have a map and want to add caves for example, but don't want to go through the hassle of building them from scratch.. It involves the use of a text editor, and lots of patience, you have been warned..
I have been informed by Red! ( of Red!'s mapper keys fame.. ) that you can save text maps by pressing ALT-P. If you prefer you can do this rather than the long winded way I describe below..
First, you will need to edit the mapper2.cfg file located in the mapper directory, and set the line that reads "save_text_maps=0" to "save_text_maps=1"
Run the mapper, and load the first map you want to merge..
Make sure the map is on the level you want ( ie the first maps of towns generally go on level 1, which the game counts as elevation 0, and the second map goes on level 2 and so on.. ).
Then blank the unused levels by going to Tools-->*Clear Map Level* ( don't worry, it only blanks the map level you are on, so make sure you are on the unused / unwanted levels and not the one you want to keep..
"save as" a temporary name, then "save" it again to create the text file..( it should say "xxx.map" saved followed by "xxx.map--text saved" )
Next open the second map you want to merge..
If the level you want to merge is on the first level, go to Tools-->Copy Map Elev, and copy the level to level 2 ( or 3 if you want to add it to a map that already has 2 levels. )
Again, "blank" the unused / unwanted levels.
"save as" a temporary name ( different from the first temporary name ), and then "save" again to create the text file..
Now close the Mapper and go to the data\maps directory in your game directory.
Open the first temporary text file you made and do a search for "elev: 1" or "elev: 2" depending on whether you are merging the second map to the second or third levels ( remembering that elevation 1 is mapper level 2 and so on.. ) You might find it at the top of a list of numbers like this..
square_elev: 1
sq: 65537 grid000 grid000 sq: 65537 grid000 grid000 sq: 65537 grid000 grid000 sq: 65537 grid000 grid000 sq: 65537 grid000 grid000 sq: 65537 grid000 grid000 sq: 65537 grid000 grid000
and so on..
Or you might not find it at all.. ( if your other map levels are blanked, then only the list for elev: 0 will be in the file..)
If you do find it, your other map levels were not blanked.. so open the mapper again and blank them as explained higher up..
Next open the second temporary text file you made, and again do a search for "elev: 1" or "elev: 2" This time you should find it ( providing you copied the map to level 2 in the mapper like you were told to.. ).
Highlight everything below ( and including ) the "square elev: 1" down to where the list ends and it says..
>>>>>>>>>>: SCRIPTS <<<<<<<<<<
SCRS:
scr_num: 0
scr_num: 0
scr_num: 0
scr_num: 0
scr_num: 0
>>>>>>>>>>: OBJECTS <<<<<<<<<<
OBJECTS BEGIN
[OBJECT BEGIN]
Copy and paste this to the first text file in the same place.. ( ie below the end of the existing list, but before the part shown above. )
Go back to the second text file and select all of the object defines ( there should only be the objects for the second ( or third depending.. ) level.) from just below where it says "OBJECTS BEGIN" to just above where it says "OBJECTS END"
IMPORTANT!! note the difference.. not "[OBJECT BEGIN]" but "OBJECTS BEGIN"
Copy and paste these to the first text file after just before the existing "OBJECTS END"
Save the file as the name you want you map to be.
Delete ( or move to another folder ) the temporary files..
Open the mapper, and go to "Tools-->Rebuild ALL Maps".
The mapper will then re-build the map's from the text files ( which is why you deleted the temporary files else the mapper would re-build them too. ).
There may be a few defects with the map as the object defines are supposed to be in tile number order, so each elevation should be mixed up with the others in the list, but it works this way with only a few minor glitches, such as wall sections being a tile or two out of line..
Correct the defects and save the map... The mapper should save a new text file for the map..
If you don't want text versions of all the maps you save, edit the line in the mapper2.cfg back to what it was..