FindObject2

Category: Objects / Search
Since engine version: 4.9.6.0 CR

Description

Returns an object fulfilling the specified search criteria. Search criteria are composed of special Find_x() values.

Syntax

object FindObject2 (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().
Search criteria are specified as in FindObjects and ObjectCount2. See FindObjects for additional samples.

Example

if(FindObject2(Find_Distance(10), Find_OCF(OCF_CrewMember), Find_Hostile(GetOwner()))
  Explode(20);
If an enemy clonk gets closer than 10 pixel to the object, it explodes.
See also: FindObject, FindObjectOwner, 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, ObjectCount2, Sort_
Clonkonaut, Juli 2006