Preparing your text filesThe main .txt files you will be working with are:
Levels.txt
LvlTypes.txt
LvlPrest.txt
LvlWarp.txt
Open patch.MPQ using WinMPQ and find these files and extract to your HU/D2 folder. This will create a data folder with the files inside global>excel.
A few others you may want to use (for placing new bosses/SU's) or for testing stuff:
Monstats.txt
Monstats2.txt
MonPreset.txt
Cubemain.txt
UniqueItems.txt
You are ready to start editing files.
DT1'sA DT1 is a file that contains different tiles used by the game. You can create your own DT1 with your own tiles if you like, but I won't go into that here. Each DT1 you want to use on a map must be declared in leveltypes.txt for the level you are editing.
Example:
XXXX Level, uses leveltype 2. Only the DT1's entered in leveltypes.txt's leveltype 2 row can be used by that map.
DT1 MaskThe DT1Mask is used to tell the game what DT1's to use from its leveltypes row. You can use the DT1 calculator to find this, but i'll explain how it works and how to find it manually.
The number is a decimal reprisentation of a binary bitfilter. Sorry I can't find another way to explain it, but I'll use an example to illustrate.
You want to use leveltype X but only want to use tiles from the first, third, fourth, and tenth DT1's declared in the level type.
Open windows default calculator and set it to full scientific mode.
select the Bin (Binary) option and enter 1011000001
1 if you want to use the DT1 in that slot
0 if you dont want to use it.
so 1011000001 will enable the DT1 file in the first, third, fourth and tenth column. Easy
Now all you do is change the binary option to Dec (decimal) and that will give you your DT1 Mask.
Leveltypes.txtThis stores all the DT1 listings used by each leveltype. the fileX columns each contain a DT1, and can be enabled/disabled for each individual map via levelprest.txt and the desired DT1Mask.
In general, you won't need to edit this much unless you want to add some custom tiles. It's mostly used for reference.
Creating a new leveltypeSometimes you may want to use a combination of tiles from different leveltypes (graveyard tiles in a jungle area or something like that).
To do that, you'll need to create a new leveltype that contains a mix of jungle .DT1's and graveyard.DT1's. You can also just add a DT1 to an existing leveltype. Existing maps won't be altered because they will be using a DT1Mask that doesn't include the additional tiles.
I you really need to make a new level type. Just clone an existing row and paste it at the bottom of the file. Give it a unique ID and add your DT1's to the FileX columns for that row. Make sure you set the act to the act column you are gonna use the leveltype in.
Lvlprest.txtThis file stores the path of your actual map file. You will be editing this every time you make a new level.
The name column isn't loaded by the game, it's just for reference. The Def column is like an ID, just follow the trend and increase it by 1 for every level you add.
LevelID = ID of the level in levels.txt that should use this map.
Populate = 0/1 (no/yes)
Outdoors = 0/1 (no/yes) (Used for rain effects etc.)
FillBlanks = 1
sizeX/Y = 0 (we are adding preset maps, so this value is read from levels.txt instead)
Automap = 0/1 (no/yes)
Scan = 1
Pops = 2
PopPad = 0
Files = 1-6 (Number of variations of this map to randomly choose from)
Files1-6 = the path of your map file.
Custom/NewMap.DS1 will search for your map(Named "NewMap") in data/global/tiles/Custom.
DT1Mask = the DT1Mask calculated for the leveltype you are using. (see above)
Levels.txtThis is the guts of the levels stuff. All the other level related files are referenced here and used together to create the level. (not the map, just the level)
A quick explination of the important columns:
Name = not loaded by the game, just for reference.
ID = ID of the level, must be unique and in order.
Pal = Pallette to use. (0= act1, 4= act5)
Act = what act is it in? (0= act1, 4= act5)
QuestFlag/QuestFlagEx = how you enable quest flags. I'll post a list of the numbers for each part of each quest further down for reference.
Layer = if 2 levels share the same layer, the automap will show both levels at the same time. I'll go into this more in a minute, but in short, if you are linking to levels together like an outdoor level, you want both levels to be on the same layer so the automap will join up.
SizeX/Y = number of tiles high/wide the map is. (set this 1 higher than your actual map size).
SizeX/Y N/H = keep this the same as norm/nm since we are working with preset maps and not mazes. (mazes are badly coded and not very customisable)
OffsetX/Y = the maps very top corner position in the worldspace.
This is important and is one of the most common causes of errors. The game has a set worldspace that it can place levels on. In the worldspace, levels don't need to be next to each other to be connected, but they must not overlap.
Just check the existing offsets that are used and create a unique one that wont overlap.
Ie. If you have a 100X100 level at X1000 and Y1000 in the worldspace, and want to place another 100X100 level. The safest place to put it would be X1150 Y1000 (leaving room for the existing 100X100 map) and 50 tiles in between as a safety net. You just need to find somewhare it will go without crossing over any other levels.
Notice, you only need to change X in that example, but sometimes you may need to change both or only Y. As long as there are no overlaps you are good.Depend = LevelID of the level this map depends on for its X/Y pos.
This isn't used unless you are linking 2 levels together in a similar fassion to outdoor levels. The game places this level next to the levelID you place here. the offset columns are then used for offsets relative to the dependant levels top corner position.Randomising preset mapsWorld SpaceLinking levels with warpsLinking levels with portals(WIP)