Using the Particle System

By Richard Clark

Particles
Figure 1: Particles in Action

Randy has implemented another fun feature in ZDoom and that is the Particle System. This adds another level of ambience to maps for the level designer to enhance the atmosphere of a level. The example wad, partc.wad illustrates the concepts in this tutorial.

Particles fountains are easy to use. They are simply things that you add to your map. When the maps start, the fountains will spew particles. There are several colors of fountains that you can use in your maps.

Sparks are only slightly more complicated. You must use the Thing_Activate command in order to activate the sparks. Particle fountains are continuous, where sparks only emit particles when they are activated. In order to periodically have an object emit sparks, place the spark activation in a script. For example, the following script is used in the demo wad to have the light periodically emit sparks.

#include "zcommon.acs"

script 1 OPEN
{
	Thing_Activate (const: 3);
	delay(const:70);
	restart;
}

This script activates the sparks thing which has a tag of 3. The delay (in tics) is important here since we want this script to run continuously with the restart command. Restart does just what it sounds like: it restarts the script. If we don't have the delay, you will get a Runaway Script error and the script will be shut down. This is an OPEN script which means it will start when the map loads. That's all there is to getting sparks going in your level. In addition to particles, the spark thing also makes a nice sparky sound. Set the Z parameter on the sparks thing to set the height of the sparks.

You can also deactivate these objects as well as activate them. The switch in the demo wad does just that to the particle fountain.

Deactivating Fountain
Figure 3: Deactivating Fountain

In Figure 3, the line special Thing_Deactivate is assigned to the switch. This special only has one parameter, the tag of the thing. The line is marked as Player Uses and is not repeatable.

The particle system is simple to use and will add a bit of atmosphere to your map.

Sources

ZDoom reference by Randy Heit.

Back