ThingCountSector
int ThingCountSector (int type, int tid, int tag)
Usage
Counts the number of actors in a given sector matching the given criteria. Only actors whose health is above 0 are counted.
Parameters
- type: The type of actor to count. Use T_NONE to count actors of any type.
- 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 (T_CACODEMON, 62, 11);
This line counts every actor in sectors with tag 40:
int AllActors = ThingCountSector (T_NONE, 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.