ObjectCount2

Category: Objects / Search
Since engine version: 4.9.6.0 CR

Description

Returns the number of objects fulfilling the specified search criteria. Search criteria are composed of Find_x() function values.

Syntax

int ObjectCount2 (array Criteria,  ...);

Parameters

Criteria:
Search criterion in the form of a Find_* function
...:
[opt] Additional search criteria in the form of Find_* functions

Remark

Search criteria are specified as in FindObjects and FindObject2. See FindObjects for additional samples.

Example

Message( "Noch %d feindliche Clonks!", ObjectCount2(Find_OCF(OCF_CrewMember), Find_Hostile(GetOwner()) );
Prints info about the strength of the enemy.
See also: FindObject2, FindObjects, Find_Action, Find_ActionTarget, Find_Allied, Find_And, Find_AnyContainer, Find_AtPoint, Find_Category, Find_Container, Find_Distance, Find_Exclude, Find_Func, Find_Hostile, Find_ID, Find_InRect, Find_NoContainer, Find_Not, Find_OCF, Find_Or, Find_Owner, ObjectCount
Clonkonaut, Juli 2006