Egg Capsule tutorial

From SRB2 Wiki
Jump to: navigation, search

An Egg Capsule is part of almost every official boss level. It rises from the ground once the boss is defeated, and opens up and releases animals once the button is pressed. Egg Capsules are created with use of the reserved tags 680, 681 and 682, the Egg Capsule Center Thing, the Egg Capsule sector special, and several FOFs. Although their appearance can be modified, this tutorial will explain how to create Egg Capsules that looks exactly like the ones found in the official SRB2 levels.

Basic setup

Target sectors and Capsule center

Target sector diagram. Click to enlarge.

For the Egg Capsule, three target sectors must be created inside the map. They determine the point where the Egg Capsule will rise once the boss is defeated. You should change the grid size to 8 for making these sectors, since they are rather small.

  • The outer sector is the main capsule. It is a regular octagon with a linedef length of 72, which equals a diameter of 192 fracunits.
  • The middle sector is meant for the yellow button. It is also a regular octagon with a linedef length of 36 (diameter of 96) that sits in the center of the outer sector. If positioned correctly in the middle, the uppermost vertex will be 48 fracunits below the uppermost vertex of the outer sector.
  • The inner sector is meant for the small metal rod that the button sits upon. It is a square with a linedef length of 16 that sits right in the center of the other two sectors.

Give all of these sectors a different tag and place an Egg Capsule Center Thing in the middle of the capsule.

Control sectors

Control sector diagram. Click to enlarge.

An Egg Capsule requires four groups of control sectors with three adjacent sectors in each group. Make sure that the middle sector of each group has at least two linedefs that aren't connected to another sector. The easiest way to do this is to make the middle sector a square and the other two triangles. The middle sector of each group is the FOF control sector for one component of the Egg Capsule. The two adjacent sectors are used to set the heights of the FOFs after defeating the boss (right) and after pressing the button (left). Apart from these heights, all other properties are set in the middle sectors.

Now you need to set up the middle sectors of those four groups as control sectors for the FOFs. The Egg Capsule consists completely of basic FOFs made with linedef type 100. Most control sectors need to be tagged to two target sectors because the button floats over the other components and overlaps with them in the sector layout. For convenience, the control sector groups will be listed in the order in which they are lined up in the official boss maps (see image to the right). The order is completely arbitrary and can be changed at will.

  • The first sector is for the metal rod that the button sits on. Give one of its linedefs an effect of 100 and tag it to the inner target sector. It should have THZWAL01 as its texture.
  • The second sector is for the button. Give two of its linedefs an effect of 100 and tag one to the inner target sector and the other to the middle target sector. They should have YELWALL as their textures.
  • The third sector is for the top of the capsule's shell. Give two of its linedefs an effect of 100 and tag one to the outer target sector and the other to the middle target sector. They should have EGGTRAP1 as their textures.
  • The fourth sector is for the bottom of the capsule's shell. Give two of its linedefs an effect of 100 and tag one to the outer target sector and the other to the middle target sector. They should have EGGTRAP2 as their textures.

The flats should be YELFLR for floor and ceiling of the first two control sectors, and TRAPFLR for floor and ceiling of the other two control sectors. The light level of the second control sector should be lower than that of the surrounding sectors to make the button cast a shadow. This sector also need the Egg Capsule sector type. This will make the Egg Capsule work correctly after being pressed. Additionally, the four control sectors need to be tagged with the reserved tags 680–682. Tag 680 is for lowering the button and the metal rod, so give it to the first two sectors. Tag 681 is for raising the top of the capsule, so give it to the third sector. Tag 682 is for lowering the bottom of the capsule, so give it to the fourth sector.

Sector heights

The tables below show the floor and ceiling heights of all twelve control sectors. The middle sector of each group sets the heights upon loading the level, the right sector sets the heights after beating the boss, and left sector sets the heights after pressing the button. If the Egg Capsule is placed in a sector that does not have a floor height of 0, add its floor height to all of these heights.

First group

Left sector Middle sector Right sector
Floor height -8 -136 0
Ceiling height 112 -16 120

Second group

Left sector Middle sector Right sector
Floor height 112 -16 120
Ceiling height 120 -8 128

Third group

Left sector Middle sector Right sector
Floor height 88 -80 56
Ceiling height 112 -24 112

Fourth group

Left sector Middle sector Right sector
Floor height 0 -136 0
Ceiling height 24 -80 56

Non-boss Capsules

If you want to put an Egg Capsule in a level that doesn't have a boss, you must modify it slightly so that it automatically spawns at the heights to which it would normally rise after defeating the boss. One of the two adjacent sectors thereby becomes obsolete. Don't create the rightmost control sector and give the one with the control linedef the heights that you would normally give to the rightmost sector. Everything else stays the same. Note that such an Egg Capsule automatically ends the level upon pressing the button. If that behavior is not desired, remove the Egg Capsule Center Thing. This method does not spawn animals however.

Samples

Sample 1

Example WAD: ex_st00144 eggtrapcapsule.wad‎
  • This example WAD can be played in any gametype. It uses MAP01, replacing Greenflower Zone Act 1.
  • This example shows an Egg Capsule working in a boss level.

Sample 2

Example WAD: ex_st00144 eggtrapcapsule noboss.wad‎
  • This example WAD can be played in any gametype. It uses MAP01, replacing Greenflower Zone Act 1.
  • This example shows an Egg Capsule working in a level without a boss.