Using the Monster Special

By Richard Clark

Monster Special in Action
Figure 1: Monster Special in Action

A feature that really sets off ZDoom from the other Doom ports is the Monster Special. When a monster is killed, a script or action can be executed. This can add a whole new dimension to map editing. In the example wad, monspec.wad, when the player kills the sergeant, a script is executed that performs several actions simultaneously.

Map Layout In WadAuthor
Figure 2: Map Layout In WadAuthor

Figure 2 shows the map layout. Sectors #1 and #2 are tagged, as is the door. The door will be opened by the script so the door has normal linedefs associated with it. The spawn sector is where a Soulsphere will spawn and it contains a Map Spot for the Thing_Spawn special.

Enemy Setup
Figure 3: Enemy Setup

Figure 3 illustrates the enemy setup. The special is assigned to script number 1. When the monster is killed the following will happen:

The door and sectors are tagged in the usual manner. The Map Spot must be tagged as well as is illustrated in Figure 4.

Map Spot Setup
Figure 4: Map Spot Setup

I put the map spot in its own sector, but it isn't necessary. Since one command is acting on a map spot and one command is acting on a sector, there is no conflict (this is corrected information from Randy).

Side note from Randy:

A similar note also applies to teleport destinations: They are identified by their thing IDs, not their containing sectors. So you can have multiple destinations in a single sector, and as long as they have different tid's, you can use them all independently.

Script Editor
Figure 5: Script Editor

The last piece of work is to code the script itself. The script is fairly simple. The monster special is tagged to script 1. When the monster dies, the commands in script will be executed, one after another without any delay. In other words, all these actions occur simultaneously. The effect is quite nice as you can see by playing the demo wad. The const is not required, but will speed up the script by a miniscule amount (Randy). You can also use named constants if you use the #include "zcommon.acs" directive. In the case of the Thing_Spawn, the 25 becomes T_SOULSPHERE. This makes the script much more readable.

The following lists all the commands and their arguments:

Door_Open tag speed

Light_Fade tag target speed

Thing_Spawn tag item angle

In addition to monsters, things can have a special assigned to them as well. So, when your player picks up the rocket launcher, you can have a surprise waiting.

Sources

ZDoom reference by Randy Heit. Thanks to Randy for the corrections.

Back