Rotating Door
By Richard Clark

Figure 1: Rotating Door in Action

The previous polyobject tutorial featured a sliding door. This tutorial explains how to create a door that rotates open. Figure 2 shows the map layout of the sample wad, rotdoor.wad.

Figure 2: Map Layout in WadAuthor

Once the map is created, the actual polyobject must be built in a dummy sector. Remember that polyobjects are translated from their build location the the play location when the map loads. Figure two has the anchor spot in the center of the polyobject because the door will need to rotate about this point. The start spot in the play area, is set in the middle of the hall. When activated the polyobj will rotate about, as in Figure 1, pause for a few seconds then rotate back.

The Startline, anchor point and start spot setup is exactly the same as in the sliding door. (The tags are set using the byte angle field, not the tag drop down; refer to the Sliding Door tutorial for more information.) Notice that the two facing lines of the polyobj are marked with the DoorSwing special. The player will need to activate the door like any other door, but instead of going up into the ceiling, the door will rotate open. In actual game play, this is a bit awkward, but does illustrate that the activation lines can be on the polyobj itself.

Figure 3: Door Swing Special

Figure 3 illustrates the Door Swing special setup in WadAuthor. Both of the facing lines of the polyobj will need to have the special otherwise the player will be trapped in the room when the door rotates back into position.

Polyobj_DoorSwing tag, speed, angle, delay

- tag: This is a unique number that identifies the polyobj.
- speed: How fast the door moves.
- angle: The angle that the door moves through.
- delay: The delay in tics before the door rotates back into position.

The angle parameter will probably have to be set through trial and error since it isn't readily intuitive what the angle should be when you build the door. This special could also be activated through a script as well as the line activation that is illustrated here.

As you can see from the brevity of this tutorial, this door is very easy to build. Yet it adds a unique touch to any map.

Sources

ZDoom reference by Randy Heit.

Back