From ZDoom Wiki
Jump to: navigation, search

int A_RadiusGive (str item, float distance, int flags [, int amount])
int A_RadiusGive (str item, float distance, int flags [, int amount [, str filter [, str species [, float mindist]]]]) (New from 2.8.1)
int A_RadiusGive (str item, float distance, int flags [, int amount [, str filter [, str species [, float mindist [, int limit]]]]]) (development version 1b1195d only)


Gives an item to all eligible actors within range. Note that the receiving actor's center point must be whithin the radius specified by the distance parameter, otherwise it won't receive the item.

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: (New from 2.8.1) 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.
  • RGF_ITEMS: Inventory items are eligible. (New from 2.8.1)
  • 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 or execute specials. This may prevent maps like Doom II's MAP07 from working their specials, so caution is advised. (New from 2.8.1)
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). (New from 2.8.1)
  • 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. (New from 2.8.1)
  • 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. (New from 2.8.1)
  • 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. (New from 2.8.1)
  • 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. (New from 2.8.1)
  • species determines which particular species may receive this item. (New from 2.8.1)
  • mindist actor must be this far away to receive the item. This must be less than distance. Default is 0. (New from 2.8.1)
  • limit will stop the function from performing after successfully delivering the item this amount of times to actors within range. The actors which receive the items are random -- they are not found closest or furthest away from the calling actor. (development version 1b1195d 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)