A_CustomMissile

From ZDoom Wiki
Jump to: navigation, search

A_CustomMissile (string missiletype [, float spawnheight [, int spawnofs_xy [, double angle [, int flags [, angle pitch]]]]])
A_CustomMissile (string missiletype [, float spawnheight [, int spawnofs_xy [, double angle [, int flags [, angle pitch [, int ptr]]]]]]) (New from 2.8.1)
A_CustomMissile (string missiletype [, float spawnheight [, float spawnofs_xy [, double angle [, int flags [, angle pitch [, int ptr]]]]]]) (development version 1a5a00a 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. Default is 32.0.
  • spawnofs_xy - Moves the missile spawn point to the right if positive, left if negative. Default is 0.
  • angle - Adds this much offset to the actor's angle, which is aimed at the target first. Default is 0.
  • flags - 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 flags 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 flags 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 flags 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 flags 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 flags parameter.
  • CMF_OFFSETPITCH - Use the pitch parameter as an offset to the calculated aim pitch. This is the same as adding 32 to the flags 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 flags 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 flags 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. Default is 0.
  • ptr - The actor to fire the missile at. This takes an actor pointer. By default, the calling actor fires at its target (AAPTR_TARGET). (New from 2.8.1)

Examples

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