Slope

From ZDoom Wiki
Revision as of 13:15, 29 January 2010 by Gez (talk | contribs)
Jump to navigation Jump to search

Slopes were added to ZDoom back in the 1.23 beta days. Originally the only way to create a sloped sector was with the Plane_Align special. However, new ways were added involving the use of special slope things.

181:Plane_Align

Plane_Align is fairly simple to use once you get the hang of it. It takes two arguments: floor sector and ceiling sector. For both, a value of 1 means "front sector", a value of 2 means "back sector", and a value of 0 means "none". It requires to be two-sided to work, with the back sector different from the front.

So, let's say you have two sectors adjacent to one another, one with a floor height of 64, the other with a floor height of 0 and the linedef's front side is facing the sector with a floor height of 0. If you give that line a Plane_Align special with the first argument 1 (for the front) then the sector with floor height of 0 will be sloped upwards to meet the floor with a height of 64. If you were to put in an argument of 2 instead of 1, then the sector with floor height of 64 would be sloped down to meet the sector with a height of 0. Once you get the hang of it, it's actually very simple.

The second argument works in the exact same way (1 for front, 2 for back) except the sloping is applied to the ceiling. Play around with it for a while, try to make things like arches or sloped railings next to stairs until you fully understand it.

Slope things

Once you've mastered Plane_Align you may become aware that, even though it adds a whole new dimension to Doom editing, it still has limits. For instance what if you want to slope the same sector two ways (slope it from low to high but also tilt it to the side a bit, perhaps making a pipe that goes upwards)? Or what if you have a sloped ceiling but you put a new sector within it (for a floor platform or similar)? Then there's no way to match the ceiling slope to the surrounding sector. The slope things will solve your problems.

For all following things, the first editor number correspond to a floor slope, and the second to a ceiling slope.

1500/1501 — Slope things
They are used to describe a slope. They work together with the line of the sector in which they are placed having Arg1 equal to the thing's TID number. The plane is defined with 3 points - the thing's position and the line ending vertexes at the sector's floor or ceiling height.
1504/1505 — Vertex height things
They can be used to define explicit heights at each vertex for triangular sectors. This is especially useful for terrain generation. The thing's z-position is used as the absolute height of each touching triangular sector at a vertex. These things have to be placed at the same position as the vertex they are supposed to affect. Please note that these things have no effect on sectors with more than 3 touching vertices.
9500/9501 — Line slope things
They take a single argument, a line id. These can be placed anywhere (they don't need to be in the sector you want sloped) and will slope a sector starting at the specified line id and slope the sector up or down to the thing based on its Z height.
9502/9503 — Sector tilt things
They are useful if you just want to make a simple slope without bothering with any action specials. These also take a single argument, the angle of the tilt. The first argument is relative to 90 which means no slope (90 degrees from the vertical), so the further from 90 a value is the more sloped a sector will be. The angle of the thing also determines the direction of the slope, and the floor or ceiling height will be adjusted so it passes through the thing (based on the Z height relative to the floor/ceiling height). You'll need to play around with thing positions and values a bit, but, as with Plane_Align, once you get the hang of it, it will become fairly easy to use.
9510/9511 — Slope copy things
They take one argument, a sector tag. This will easily fix the latter problem mentioned above. Simply tag a sector and then place one of these in the sector you want to copy the slope of the tagged sector and ZDoom will do the rest. Very simple, but also quite effective.

Finally

Slope things will be processed after Plane_Align slopes are set up, allowing you to further adjust slopes. Note that the sector tilt things are processed last and will override any previous slopes in their sector. Also, as with Plane_Align, slope things are only valid during level initialization and can't be spawned during play (so no dynamic slopes, sorry).

See also

Sector_Set3dFloor

External Links

Example WAD: http://www.zdoom.org/files/examples/slopes2.zip