A_CustomMissile

From ZDoom Wiki
Jump to: navigation, search

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 c13f155 only)

A customizable projectile attack for monsters.

Parameters

  • missiletype - The missile to fire.
  • spawnheight - Raises the missile spawn point on the actor by this amount in units.
  • spawnofs_horiz - Moves the missile spawn point to the right if positive, left if negative.
  • angle - Adds this much offset to the actor's angle, which is aimed at the target first.
  • aimflags - 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 (use | between flags to combine):

  • 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 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.
  • CMF_ABSOLUTEPITCH - 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. This is the same as adding 16 to the aimflags parameter.
  • CMF_OFFSETPITCH - Use the pitch parameter as an offset to the calculated aim pitch. This is the same as adding 32 to the aimflags parameter.
  • CMF_SAVEPITCH - The pitch used for firing the missile is saved as the missile's own pitch. (Require CMF_AIMDIRECTION, CMF_ABSOLUTEPITCH, or CMF_OFFSETPITCH.) This is the same as adding 64 to the aimflags parameter.
  • CMF_ABSOLUTEANGLE - Use the angle parameter as an absolute value, ignoring the calculated aim angle. The calling actor's angle is still factored in, however. This is the same as adding 128 to the aimflags parameter.
  • pitch - Offsets the projectile's aim vertically by this amount. Positive values aim down, while negative aim up. Only used if at least one of the flags CMF_AIMDIRECTION, CMF_ABSOLUTEPITCH and CMF_OFFSETPITCH are used.
  • target - 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 c13f155 only)

Examples

 Missile:
   POSS E 10 A_FaceTarget
   POSS F 8 A_CustomMissile("NormalBullet",48,0)
   POSS E 8
   goto See