From ZDoom Wiki
Jump to: navigation, search

A_RadiusGive (str item, fixed distance, int flags [, int amount])
A_RadiusGive (str item, fixed distance, int flags [, int amount [, str filter [, str species]]]) (development version 8d7c93d only)


Gives an item to all eligible actors within range.

Note that for very large distances, attempting to give to specific things map-wide may fail. A good range for the entirety of the map would be 16383, but should this fail, simply try reducing the radius by 1000. Experimentation may be required.


  • item is the item to give.
  • distance is the radius of range. A value of 0 or less causes the function to do nothing, and does not imply infinite range.
  • flags determines which actors are eligible of getting the item:
    • RGF_GIVESELF: The calling actor is eligible.
Note: As of (development version b4f05ee only), this always succeed at giving the calling actor the item if specified, and is not subject to filtering, nor types of eligible actors.
  • RGF_PLAYERS: Any player actor is eligible.
  • RGF_MONSTERS: Any monster, be it friend or foe, is eligible.
  • RGF_OBJECTS: Any shootable or vulnerable object is eligible. This does not include players and monsters.
  • RGF_VOODOO: Any voodoo doll is eligible.
  • RGF_CORPSES: Any corpse is eligible.
  • RGF_MISSILES: Missile actors are eligible. However, in order for missiles to properly activate CustomInventory actors, the NOBLOCKMAP flag must be removed from the missile. (development version 165d288 only)
  • RGF_ITEMS: Inventory items are eligible. (development version b4f05ee only)
  • RGF_KILLED: Monsters which are truly dead may receive the item. Killed enemies may not always have the corpse flag, and corpse flagged monster may not always be killed (such as the DONTCORPSE flag). This should be kept in mind when using this flag for things like body removal, as they may not have time to drop their items. (development version b4f05ee only)
Note: At least one of the above flags must be specified for the giving to have any effect.
  • RGF_NOTARGET: The calling actor's target may not get the item.
  • RGF_NOTRACER: The calling actor's tracer may not get the item.
  • RGF_NOMASTER: The calling actor's master may not get the item.
  • RGF_INCLUSIVE: By default, if a same actor occupies more than one of the calling actor's pointer fields, such as target and tracer, specifying either RGF_NOTARGET or RGF_NOTRACER is enough to prevent them from receiving the item. This flag changes the behavior around to be inverse, which would require both RGF_NOTARGET and RGF_NOTRACER to prevent them from getting the item. This flag is only useful with RGF_NO(TARGET/MASTER/TRACER). (development version b4f05ee only)
  • RGF_EXFILTER: Inverts the actor filter from a whitelisted actor to a blacklist; the actor type specified will not receive the item, while everyone else will. (development version b4f05ee only)
  • RGF_EXSPECIES: Inverts the species filter from a whitelisted species to a blacklist; the species specified will not receive the item, while all other species will. (development version b4f05ee only)
  • RGF_CUBE: Use a cube for the range check rather than a circle.
  • RGF_NOSIGHT: The actor is given the item regardless of whether it is in the line of sight of the caller or not. (development version 165d288 only)
  • amount is how much of this item will be given to actors. If item is a health item, the amount of health to be given is the health item's amount multiplied by this parameter. Default is 0 (which is interpreted as 1).
  • filter determines which actors may receive this item. (development version b4f05ee only)
  • species determines which particular species may receive this item. (development version b4f05ee only)


The following example shows a projectile that gives health to any ally players that come near to it. Could be useful in cooperative.

ACTOR HealingPlasma : PlasmaBall
  Damage (0)
  Translation "192:207=168:176", "240:247=177:184" // blue -> red
    PLSS AABB 3 Bright A_RadiusGive("Health", 96, RGF_PLAYERS, 5)