A_ThrowGrenade

From ZDoom Wiki
Jump to: navigation, search

A_ThrowGrenade (string spawntype [float spawnheight [, float throwspeed_horz [, float throwspeed_vert [, bool useammo]]]])

Spawns a projectile and throws it like a grenade. This function can be used for monsters, inventory items and weapons. useammo only has an effect when used with a weapon.

The parameters are:

  • spawntype: Type of the projectile to be spawned.
  • spawnheight: Height at which the projectile is spawned. The function adds 35 to this, so that passing 0 means at the center of the throwing actor.
  • throwspeed_horz, throwspeed_vert: Speed with which the object is thrown.

Examples

This is a grenade-throwing zombie. The attack sound was changed so that it would not use the default pistol firing sound for throwing a grenade.

ACTOR GrenadierZombie : ZombieMan
{
  AttackSound ""
  States
  {
  Missile:
    POSS E 10 A_FaceTarget
    POSS F 8 A_ThrowGrenade("Grenade", 20, 8, 4)
    POSS E 8
    Goto See
  }
}
Personal tools
Namespaces

Variants
Actions
Navigation
ACS
DECORATE
ZDoom mods
Toolbox