ZDoom Line Specials



Thing_ProjectileGravity — shoots a gravity-affected projectile from a map spot.


Thing_ProjectileGravity (tid, type, angle, speed, vspeed);
Thing_ProjectileGravity (
  tid,       // Map spot(s) to spawn the new thing at
  type,      // The type of thing to spawn
  angle,     // Byte angle for the new thing to face
  speed,     // Speed of the projectile in the x-y plane
  vspeed     // Vertical speed of the projectile (up is positive)


This is the Thing ID of the map spot you want to spawn a new projectile at. If there is more than one map spot with this TID, then a new projectile will spawn at each map spot.
This is the type of projectile to spawn. The numbers used here correspond to a thing's spawn ID and not its editor number. You can get a complete list of spawn IDs by looking at zdefs.acs, or by using the command "dumpspawnables" at the ZDoom console.
The newly spawned projectile(s) will fly in the direction specified by this parameter. The direction the map spot is facing is ignored.
This is the projectile's speed for straight-ahead movement.
This is the projectile's vertical speed. Positive values will send the projectile up, and negative values will send it down.


This special works almost equally well whether you use it in a script or on a line. The only difference is that when used on a line, you cannot specify negative vspeeds, so you will be unable to shoot a projectile down unless you spawn it from inside a script. If you use it in a script, it is strongly recommended that you specify type using the names defined in zdefs.acs instead of by using the corresponding number. This is so that your script will be more readable, although the special will work equally well whether you use the names or not.


Although tid is often the TID of a map spot, it can refer to any thing on the map—not just map spots.

Anything spawned with this special will be subjected to low gravity, even if it is normally subjected to no gravity or normal gravity.

If there is no room for a projectile at the location where it is to spawn, then it will not spawn at all. The only way to detect this is to use ThingCount before and after Thing_ProjectileGravity and compare the two results to see if the count increased. In most cases, you should not actually need to know this.

Although this special is traditionally used to spawn missiles, it can be used to spawn anything that Thing_Spawn is capable of spawning. The box at the back of Heresiarch's Semetary in Hexen (MAP27) uses this special to spawn random items and monsters.


Spawn an imp fire ball at mapspot 1, moving straight east:

Thing_SpawnGravity (1, T_IMPFIREBALL, 0, 64, 0);

Spawn a rocket at mapspot 1, moving north and slightly upward:

Thing_SpawnGravity (1, T_ROCKET, 64, 64, 8);

First Available In


See Also

Thing_Projectile | Thing_Spawn | Thing_SpawnFacing | Thing_SpawnNoFog