ThingCountNameSector

int ThingCountNameSector (str classname, int tid, int tag)

Usage

Counts the number of actors in a given sector matching the given name and TID.

Parameters

  • classname: The class name of the actors to count.
  • tid: The Thing ID of the actor(s) to count. Use 0 to count actors regardless of TID.
  • tag: The tag of the sector(s) to count actors in.

Return value

Returns the number of actors in the given sector(s) matching the given criteria.

Examples

This line counts the number of cacodemons with a tid of 62 in all sectors with a tag of 11:

int CacosPresent = ThingCountSector ("Cacodemon", 62, 11);

This line counts all actors with a class name of "MySuperImp" in sectors with tag 40:

int AllActors = ThingCountSector ("MySuperImp", 0, 40);

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.