ThingCount: Difference between revisions

From Eternity Wiki
Jump to navigationJump to search
(Created page with "{{ACSFunction|description=Counts the number of things of given spawn ID. |usage=''int'' '''ThingCount'''(''int type'', ''int tid'') |parameters= *''type'': ACS spawn ID of things to count *''tid'': optional TID to filter by, if nonzero |return=The number of things by that criteria. |id=ACC internal }}")
 
No edit summary
 
Line 2: Line 2:
|usage=''int'' '''ThingCount'''(''int type'', ''int tid'')
|usage=''int'' '''ThingCount'''(''int type'', ''int tid'')
|parameters=
|parameters=
*''type'': [[ACS spawn ID]] of things to count
*''type'': [[ACS spawn ID]] of things to count. If '''T_NONE''' (0), it will count all things, which may be filtered by ''tid''.
*''tid'': optional [[TID]] to filter by, if nonzero
*''tid'': optional [[TID]] to filter by, if nonzero.
|return=The number of things by that criteria.
|return=The number of things by that criteria.
|id=ACC internal
|id=ACC internal
|notes=In case of monsters with the '''COUNTKILL''' or '''KILLABLE''' flag, it will only count them if they are alive. Dead monsters will not be counted; they don't have to be completely removed from the map, corpses won't be counted.
}}
}}

Latest revision as of 05:37, 4 October 2026

Description[edit]

This is an ACS built-in function.

Counts the number of things of given spawn ID.

Usage[edit]

int ThingCount(int type, int tid)

Parameters[edit]

  • type: ACS spawn ID of things to count. If T_NONE (0), it will count all things, which may be filtered by tid.
  • tid: optional TID to filter by, if nonzero.

Return value[edit]

The number of things by that criteria.

Examples[edit]

No examples given.

Notes[edit]

In case of monsters with the COUNTKILL or KILLABLE flag, it will only count them if they are alive. Dead monsters will not be counted; they don't have to be completely removed from the map, corpses won't be counted.

This function's identification in zspecial.acs is: ACC internal.

See also[edit]