- Orientations and Directions
First number is Main Index, second number is Orientation and the third number is Sub index.
There are 19 Orientation indexes.
Orientation 0 – Floors
Orientation 1 – Left Wall
Orientation 2 – Right Wall
Orientation 3 – Right part of north corner wall
Orientation 4 – Left part of north corner wall
Orientation 5 – Left end wall
Orientation 6 – Right end wall
Orientation 7 – South corner wall
Orientation 8 – Left wall with door
Orientation 9 – Right wall with door
Orientation 10, 11 – Special Tiles
Orientation 12 – Pillars, columns and standalone objects.
Orientation 13 - Shadows
Orientation 14 – Trees
Orientation 15 – Roofs
Orientation 16 - Lower walls equivalent to Orientation 1
Orientation 17 – Lower walls equivalent to Orientation 2
Orientation 18 – Lower walls equivalent to Orientation 3&4
Orientation 19 – Lower walls equivalent to Orientation 7
There is one more very important index: Direction. Paul found 5 Direction indexes and he states that they do nothing. However, I found 9 indexes and I found out its purpose.
Direction does not categorize the tile and it doesn’t show up in DS1 editor. It decides how the light will affect the tile. This is very important when you want your new tile to look good. Direction works together with Orientation. You must always use the appropriate Direction index with its respective Orientation index. Here’s the list of all Direction and their respective Orientation indexes.
|Direction 1||Orientation 1, 5, 8|
|Direction 2||Orientation 2, 6, 9|
|Direction 3||Orientation 0, 3, 4, 12, 14|
|Direction 4||Orientation 7|
|Direction 5||Orientation 15|
|Direction 6||Orientation 16|
|Direction 7||Orientation 17|
|Direction 8||Orientation 18|
|Direction 9||Orientation 19|
Here is a demonstration how some of D2's buildings are set up. I was doing this primarily for myself, but later decided to share it with everyone. This would be help you understand how to set-up elements if you decide to make new architecture. After analyzing and studying these examples I learned a lot and want to share it with you. I didn't make all D2's buildings, because these demonstrate basic and interesting set-ups.
3.Special Tiles, Roofs and PopPads
Have you ever wondered why do the Death Knight Statues in River of Flame turn their heads when you walk next to them? Is it hardcoded behaviour? Animated objects? Dark magic? - No. It's the same mechanism that makes the Act 1 Cottage's roof disappear. This is done with the help of special tiles - they remove one layer of wall and reveal the other. In case of Death Knight statues - there are 2 statues on top of each other. When you walk up to a statue, one disappears and the other appears. Yes, it's that simple
Special Tiles are the tiles that are present in the "Special" section in Ds1 Editor. They do various things. Here is the list of what they do.
#00-46, #82, #83 Vis (tiles that allow you to go from one area to another)
#47-74 Area (tiles that remove walls and roofs)
#75 Town Entry
#76 Map Entry
#77 Town Entry 2
#78 Corpse Location
#79 Teleport Location
We will talk about Special Tiles #47-74 in more detail. But first we need to understand what roofs are.
What are roofs?
Roofs are actually floor tiles with Direction index 5 and Orientation index 15. Roofs must be placed higher up the Y axis, above the ground. For this reason there is “roof_y = ” line in tileset’s .ini file. Usually it’s “roof_y = 80” but there are other values as well, for example 160, 240, 320, 400 etc (always 80 pixels up).
How to make roofs disappear?
A pair of Special Tiles defines the area that will be removed. Two identical Special tiles must be placed to form a square or a rectangular shape over the area that you want to remove. As you can see in the examples below, if you place the special tiles like this the red border shows the area that will be removed. From now on let’s call these shapes – “Pads”.
In Lvlprest.txt there are two columns that have connection to this.
Pops – The number of Pads (shapes) you use in a .ds1. For example Act 1 Cottage uses 2 pads and Act 1 Countess Tower uses 1 pad.
PopPads –the size of the trigger pad in relation to the area defined by the special tile. It's an offset in sub-tiles.
PopPads does not change the area which will be removed. It determines where the game will trigger the pad. If you use value = 0 – the pad will be triggered exactly how the shape is drawn (the red borders). If you for example use positive value = 3, the trigger pad will increase in 3 subtiles (blue borders). If you use negative value = -3, the trigger pad will decrease in 3 subtiles (green borders).
Please notice that the trigger pad will only increase in two directions – South and East. So this image means that when you walk over the blue or green line, the red border square will disappear.
If you want to make custom removable roofs, keep in mind one very important thing: each Special Tile will only work with a specific Main Index. For example if you look at Act1 Cottage roof, the roof tiles have Main Index 46 and Special tiles #59 and #62 are used. It means that these two Special tiles will not work with other Main indexes. And if Special tile removes Roofs and Walls together (like in # 47 in Act 4 Town), those Roofs and Walls must have the same Main Index. So, if you look at Act 4 Town Roofs and Walls that are removed have Main Index 2 and the Walls that are not removed have Main Index 4. More about Special Tiles below.
Almost everything we knew about Special Tiles until this time was wrong to some extent. Our knowledge was based on two assumptions taken from the only thread on the forum:
1. Special Tiles only work in a specific act (special tiles from act 4 don’t work in act 1).
2. Special tiles remove a specific layer of walls and/or roofs.
Both of these assumptions turned out to be false. Acts and layers don’t matter. Any special tile can be used in any act and remove any layer. The only thing that matters is the Main Index. Special Tiles check only the Main Index of the tiles the are placed in the area.
One of the everlasting problems for modders was to place two houses next to each other and have their roofs removed separately. Is this possible? – Yes. Not only two, you can have up to four separately removable areas at the same time.
In the DS1 Editor, Special Tiles #47-74 are categorized by their Main Index – 8, 9, 10, 12, 13, 16 and 20.
All these tiles are divided into four groups:
1. Group 1 – Special Tiles with Main Index 8, 9 an 10
2. Group 2 – Special Tiles with Main Index 12, 13
3. Group 3 – Special Tiles with Main Index 16
4. Group 4 - Special Tiles with Main Index 20
So, how do we know what Main Index does a single Special Tile remove? Now, what really interesting is that the Special Tile’s Sub-Index equals the Main Index of the tiles that it removes. For example, Special Tile #47’s Sub-Index is 2. It means that Special Tile #47 will remove all the tiles that have Main Index 2. Special Tile #48 will remove tiles with Main Index 7. Special Tile #49 will remove tiles with Main Index 8 etc. Now, look at Special Tiles #54, #60 and #63 – they have the same Sub-Index. It means that they will remove the same tiles with Main Index 23. Why do we need three Special Tiles with the same function? The answer is: to be able to draw shapes that are not possible with just one Special Tile. With these three tiles you can draw very complicated shapes for your custom roofs These three Special tiles belong to one Group, so it means they will remove everything together.
But now look at Special Tiles #66 and #74. They also have Sub-Index of 23! But they belong to different groups (#54, #60 and #63 from Group 1, #66 from Group 2, #74 from Group 4). It means that they will remove the tiles separately.
But remember: don’t use Special Tiles with the same Main Index together (for example #47 and #48). You will encounter bugs.
So, basically, if you use tiles from 4 different groups, you can have 4 removable areas at the same time. You just need to set the appropriate Main Index for your tiles and use their respective Special Tiles.
In the table below you can find all information about Special Tiles #47-74.
|Group||Main Index||№ of Special Tiles||Removes Main Index|