Egg Capsule tutorial
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 flickies once the button is pressed. The level geometry for the capsule is created out of FOFs which are spawned underground. The flickies are spawned out of an Egg Capsule Center Thing. There are two methods for raising and opening the capsule: One involves the reserved tags 680, 681 and 682, and the Egg Capsule sector special. The second method uses linedef executors and either the reserved tag 65533 or 65534, or tagging directly to the boss. This tutorial explains the first method for Binary, and the second for UDMF. Although their appearance can be modified, this tutorial will explain how to create Egg Capsules that look exactly like the ones found in the official SRB2 levels.
Basic setup
Target sectors and Capsule center
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
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.
Binary only
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.
UDMF Setup
In UDMF the Egg Capsule sector type doesn't exist. So instead we'll be using other linedef actions. In this setup the four control sectors can each be tagged with any number, but each one must still have a separate number. Give matching tags to one line on each of the left tringles, except the one on top for the metal rod. Also give them the trigger action of 300 (Basic), and set to trigger once. You will also need to edit the button's control sector.
In the Effects tab set the trigger tag to match the same number you selected for the 3 trigger lines you set up earlier. In trigger conditions check the box for "Trigger on Ceiling Touch". This will allow the button to trigger the capsule when a player is on it.
- The Left triangle connected to the button should have a line set up with linedef type 400. Set up the action by assigning it the "Target sector tag" of the button's control sector and select "Both" for affected planes.
- The Left triangle connected to the top of the shell should have a line set up with linedef type 400. Set up the action by assigning it the "Target sector tag" of the top of the shell's control sector and select "Floor" for affected planes.
- The Left triangle connected to the bottom of the shell should have a line set up with linedef type 400. Set up the action by assigning it the "Target sector tag" of the bottom of the shell's control sector and select "Ceiling" for affected planes.
Now create a new control sector with a minimum of 3 lines. One line should have the trigger action 300 Basic set to once and be given the same tag number as the 3 lines you set up earlier so the button can trigger it. A second line should be set up with linedef type 464. The Egg Capsule tag needs to match the angle of the Egg Capsule Center Thing you placed earlier, and "End Level?" should be set to Yes.
At this point you're going to want to set up your boss. Each of SRB2's Base Bosses has 3 tags that can be set up on their Arg/Tag/Misc. tab. For this tutorial we'll want to use the "Death trigger tag".
Set your Boss' "Death trigger tag" to an unused number. This number will be used to trigger the capsule rising out of the ground. Before the capsule can do that though we need to finish setting up the control sectors. If you remember, each of the four sets of Capsule control sectors has a triangle on the left and the right. To get the capsule to rise from the ground we want to edit the triangles on the right. One line on each tringle on the Right needs to have the trigger action 300 (Basic). Tag this line to the same number given to your Boss' "Death trigger tag" and also set the "trigger type" to "Once".
The second Line of each Right side Triangle should be given linedef type 400, given the "Target sector tag" to the fof control sector on their left, have "Both" selected for affected planes, and speed set to 8.
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 the 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, either remove the Egg Capsule Center Thing, in which case no flickies will be spawned, or if using the second method that uses linedef type 464 edit the action to select "No" for "End Level?".
Samples
Sample 1 (Binary format)
- Example file: ex_st00144 eggtrapcapsule.wad (MAP01)
- This example shows an Egg Capsule working in a boss level.
How to use |
---|
|
Sample 2 (Binary format)
- Example file: ex_st00144 eggtrapcapsule noboss.wad (MAP01)
- This example shows an Egg Capsule working in a level without a boss.
How to use |
---|
|