A_CustomMissile

From ZDoom Wiki

Jump to: navigation, search

A_CustomMissile (string missiletype, float spawnheight, int spawnofs_xy, angle angle [, int aimmode [, 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_xy 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. aimmode specifies whether the missile is aimed directly at the target (0) or it is aimed parallel to a missile with a spawn height of 32 units and an xy-offset of 0 (1). This can be useful if you want to have a monster shoot multiple missiles at once. As of 2.0.99 there is a new mode (2). In this mode the missile isn't 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.

Please note that A_CustomMissile had a bug in ZDoom versions 2.0.x which resulted in improper ownership for the spawned missiles if they were spawned by other missiles. This bug can not be fixed without breaking existing definitions. To allow proper ownership a flag has been added to the aimmode parameter. If 4 is added the missiles owner will be assigned properly.

If 8 is added to the aimmode parameter, the function will not spawn a missile if the calling actor's current target is dead.

Examples

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