A_CustomMissile (string missiletype [, float spawnheight [, int spawnofs_horiz [, angle angle [, int aimflags [, angle pitch]]]]])
A_CustomMissile (string missiletype [, float spawnheight [, int spawnofs_horiz [, angle angle [, int aimflags [, angle pitch [, int target]]]]]]) (development version only)
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 pitch parameter is only used if at least one of the flags CMF_AIMDIRECTION, CMF_ABSOLUTEPITCH and CMF_OFFSETPITCH are used. target is the actor to fire the missile at. This takes an actor pointer. By default, the calling actor fires at its target (AAPTR_TARGET). (development version only)
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:
- 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.
- The missile is not aimed at a target. Instead, it is shot in the specified direction with the specified pitch. This is the same as putting 2 into the aimflags parameter.
- 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.
- 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.
- Use the pitch parameter as an absolute value, ignoring the calculated aim pitch. Implied CMF_AIMDIRECTION. The main difference here is that a target is required, where CMF_AIMDIRECTION does not require a target.
- Use the pitch parameter as an offset to the calculated aim pitch.
- The pitch used for firing the missile is saved as the missile's own pitch. (Require CMF_AIMDIRECTION, CMF_ABSOLUTEPITCH, or CMF_OFFSETPITCH.)
- Use the angle parameter as an absolute value, ignoring the calculated aim angle. The calling actor's angle is still factored in, however.
Missile: POSS E 10 A_FaceTarget POSS F 8 A_CustomMissile("NormalBullet",48,0) POSS E 8 goto See