A_CustomMissile

From ZDoom Wiki
Jump to: navigation, search

A_CustomMissile (string missiletype[, float spawnheight[, int spawnofs_horiz[, angle angle[, int aimflags[, angle pitch]]]]])


Spawns a missile attack where missiletype is the type of missile to shoot, spawnheight is how high from the monster's feet to shoot the missile, spawnofs_horiz is how far from the monster's center to shoot the missile, and angle is the direction relative to the monster's facing angle in which to shoot the missile.

The aimflags can be used to determine the aim mode. By default, it is aimed directly at the target. The following flags can be used to change this behavior:

CMF_AIMOFFSET
The missile is aimed parallel to a missile with a spawn height of 32 and an xy-offet of 0. This can be useful if you want to have a monster shoot multiple missiles at once. This is the same as putting 1 into the aimflags parameter.
CMF_AIMDIRECTION
The missile is not aimed at a target. Instead, it is shot in the specified direction with the specified pitch. This is the only mode that uses the pitch parameter. This is the same as putting 2 into the aimflags parameter.
CMF_TRACKOWNER
If a missile is fired by another missile, use this flag to ensure the secondary projectile knows who is its real owner. This behavior would have been the default, but it wasn't in the 2.0.x branch of ZDoom, allowing erroneous behavior which has been used by some mods, so fixing this would break compatibility. This is the same as adding 4 to the aimflags parameter.
CMF_CHECKTARGETDEAD
With this flag, the function will not spawn a missile if the calling actor's current target is dead. This is the same as adding 8 to the aimflags parameter.

Examples

 Missile:
   POSS E 10 A_FaceTarget
   POSS F 8 A_CustomMissile("NormalBullet",48,0)
   POSS E 8
   goto See
Personal tools
Namespaces
Variants
Actions
Navigation
ACS
DECORATE
ZDoom mods
Toolbox