Thing_Projectile — shoots a projectile from a map spot.
Thing_Projectile (tid, type, angle, speed, vspeed);
Thing_Projectile ( 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 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 not be subject to gravity, even if it normally is.
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_Projectile 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 the Thing_ProjectileGravity special to spawn random items and monsters.
Spawn an imp fire ball at mapspot 1, moving straight east:
Thing_Spawn (1, T_IMPFIREBALL, 0, 64, 0);
Spawn a rocket at mapspot 1, moving north and slightly upward:
Thing_Spawn (1, T_ROCKET, 64, 64, 8);