Pegging

From SRB2 Wiki
Jump to: navigation, search
This article or section should contain one or more images. Please spruce up the article by adding an image.
File:Peggingpic.png
Sonic tiptoes on a tall grass border. These borders are made possible using Lower Unpegged on its linedefs.

Pegging refers to a special texture rendering behavior for Linedef walls, where the middle texture is positioned in a certain way. Specifically, it refers to flagging a linedef with either Lower Unpegged or Upper Unpegged.

In SRB2, the middle texture is usually rendered as a "false wall", i.e., the player can pass right through it. However, the positioning of the texture is a little complicated. By default, middle textures appear on the ceiling, making for the common "walls in the sky" mistake that beginning mappers often run into. One can use Lower Unpegged to stick the middle texture to the floor, or Upper Unpegged to stick the middle texture to the ceiling (which is the same as the default behavior, but it's more elegant to set it explicitly.) Upper and Lower Unpegged are also used to make the Upper and Lower textures render from the top and bottom of the wall, respectively, rather than the other way around.

Of the two, Lower Unpegged is the more commonly used option.

Contents


How to Use

In SRB2 Doom Builder, make a map or open an existing one. Select one or more two-sided linedefs and then right-click to bring up the "Edit Linedef" dialog.

Under "Flags", one can check either Lower Unpegged or Upper Unpegged (highlighted in red) to set the effect. Here, we'll be making a tall grass border like the ones seen in Greenflower Zone, so check Lower Unpegged.

Now you need to set the correct textures. Switch to the "Sidedefs" tab. You only need to set certain textures and options for the effect to work; the others have no bearing on how it looks.

As highlighted, only the middle textures and the texture offsets (more on the latter, later) have an effect on pegging. Also, for most cases, one sets both Front and Back sidedefs to the same settings for each required setting.

Since pegging affects middle textures, set both the Front and Back middle textures to GFZGRASS. The other textures can be left as they are. For now, leave all texture offsets at 0. Here's how the dialog will look afterwards. Apply the changes by clicking "OK", and then save your map and then test it!

File:Pegging 3.png
The left screenshot shows Lower Unpegged, while the right one shows Upper Unpegged (with yellow arrow added for emphasis.) If you're following the tutorial, your map should be like the left screenshot.

One of the screenshots above should show what the result will be. Notice how if you checked Lower Unpegged, the middle GFZGRASS texture is tacked to the floor, while otherwise, it's tacked to the ceiling.

And that's it! The way to manipulate middle textures is as simple as checking "Lower Unpegged" or "Upper Unpegged". This is a very useful tool in making maps.

GFZGRASS on FOFs

One quirk of pegging is that it's not obvious how to set it for FOFs. If you try setting the target sector's linedef textures to GFZGRASS and then check "Lower Unpegged", you're probably going to get this:

instead of this:

The GFZGRASS will appear on the target sector's real floor, rather than the FOF. And setting the texture on the control sector itself doesn't work, either (and the control sector actually uses the middle texture for the FOF's walls.) The way to set up GFZGRASS on FOFs is actually by a trick, or illusion: set the texture's Y offset to the appropriate height. The GFZGRASS itself should still be set on the target sector.

The FOF's top height, in the screenshot, is 192 (above the real floor, 0), so set each texture's Y offset to 192 as well. Here's how it should look. Save your changes and then try it out! The result should be that of the second screenshot above. It looks like this above the FOF:

A side effect to this is that the ground's below texture is shifted, too, due to the Y offset. Also, the GFZGRASS can only be set on the FOF using this method, and a second middle texture can't be set on the ground itself. However, both of these side effects are usually accepted in favor of the FOF effect.

If these side effects are unwanted, there is a slightly more complicated way you can do it, using a Custom FOF. You will need to set the Upper sidedef on the backside of the control linedef to 4005, giving the properties to exist, render the sidedefs, and render both front and back sidedefs. You will have to give the GFZGRASS FOF's control sector to have the floor being the ceiling on the FOF you want GFZGRASS to appear on, and the ceiling on the GFZGRASS one should be the floor + 8.

See Also

Personal tools