FindObjects

Category: Objects / Search
Since engine version: 4.9.6.0 CR

Description

Creates a list of objects which fulfill the specified search criteria. Search criteria are composed of Find_x() values.

Syntax

array FindObjects (array Criteria,  ...);

Parameters

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

Remarks

As opposed to FindObject, an object using FindObjects in local calls will also find itself. This can be avoided through use of Find_Exclude().
Criteria are specified in the same way as with FindObject2 and ObjectCount2.

Examples

for(var pVehicle in FindObjects (Find_Owner(1), Find_Category(C4D_Vehicle)))
  RemoveObject (pVehicle);
Removes all vehicles of player 2.
protected func Hit()
{
  for(var pStructure in FindObjects(Find_AtPoint(), Find_Category(C4D_Structure), Find_OCF(OCF_Inflammable)))
    Incinerate(pStructure);
  RemoveObject();
}
Arsonist flint: incinerates all buildings at the point of impact.
for(var pObj in FindObjects( Find_Not(Find_Owner(NO_OWNER)) ))
  pObj->SetOwner(NO_OWNER);
Anarchy! No object is owned by any player anymore.
See also: FindObject, FindObject2, FindObjectOwner, 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_Layer, Find_NoContainer, Find_Not, Find_OCF, Find_Or, Find_Owner, ObjectCount2, Sort_
Clonkonaut, Juli 2006