From ZDoom Wiki
Jump to navigation Jump to search

int A_GiveToChildren (string type [, int count])


Adds count items of type type to the calling actor's children's inventory. This function will not add more items than can be carried.

An actor's children are actors which are spawned by said actor through A_SpawnItemEx with the SXF_SETMASTER flag passed to the function, or by pointer manipulation with functions like A_RearrangePointers or A_TransferPointer.

If type is an item derived from Health, then the amount received is the result of multiplying count by the item's amount, e.g. if type is Medikit and count is 2, then the amount of health received would be 50 points, not 2.


  • type: the item to give. This should be a valid inventory item.
  • count: the number of samples of this item to give. Default is 0, which is interpreted as 1.

Return value

The function returns the total number of actors which successfully received the item.


Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.