<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
  SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
  <func>
    <title>FindObject</title>
    <category>Objects</category>
    <subcat>Search</subcat>
    <version>5.1 OC</version>
    <syntax>
      <rtype>object</rtype>
      <params>
        <param>
          <type>array</type>
          <name>Criteria</name>
          <desc>Search criterion in the form of a Find_* function</desc>
        </param>
        <param>
          <type/>
          <name>...</name>
          <desc>Additional search criteria in the form of Find_* functions</desc>
          <optional />
        </param>
      </params>
    </syntax>
    <desc>Returns an object fulfilling the specified search criteria. Search criteria are composed of special Find_x() values.</desc>
    <remark>An object using FindObjects in local calls will also find itself. This can be avoided through use of <funclink>Find_Exclude</funclink>().</remark>
    <remark>Search criteria are specified as in <funclink>FindObjects</funclink> and <funclink>ObjectCount</funclink>. See <funclink>FindObjects</funclink> for additional samples.</remark>
    <examples>
      <example>
        <code><funclink>if</funclink>(<funclink>FindObject</funclink>(<funclink>Find_Distance</funclink>(10), <funclink>Find_OCF</funclink>(<funclink>OCF_CrewMember</funclink>), <funclink>Find_Hostile</funclink>(<funclink>GetOwner</funclink>()))
  <funclink>Explode</funclink>(20);</code>
        <text>If an enemy clonk gets closer than 10 pixel to the object, it explodes.</text>
      </example>
    </examples>
    <related>
      <funclink>Find_Action</funclink>
      <funclink>Find_ActionTarget</funclink>
      <funclink>Find_Allied</funclink>
      <funclink>Find_And</funclink>
      <funclink>Find_AnyContainer</funclink>
      <funclink>Find_AtPoint</funclink>
      <funclink>Find_Category</funclink>
      <funclink>Find_Container</funclink>
      <funclink>Find_Distance</funclink>
      <funclink>Find_Exclude</funclink>
      <funclink>Find_Func</funclink>
      <funclink>Find_Hostile</funclink>
      <funclink>Find_ID</funclink>
      <funclink>Find_InRect</funclink>
      <funclink>Find_NoContainer</funclink>
      <funclink>Find_Not</funclink>
      <funclink>Find_OCF</funclink>
      <funclink>Find_Or</funclink>
      <funclink>Find_Owner</funclink>
      <funclink>Sort_Random</funclink>
      <funclink>Sort_Reverse</funclink>
      <funclink>Sort_Multiple</funclink>
      <funclink>Sort_Value</funclink>
      <funclink>Sort_Speed</funclink>
      <funclink>Sort_Mass</funclink>
      <funclink>Sort_Distance</funclink>
      <funclink>Sort_Func</funclink>
      <funclink>FindObject</funclink>
      <funclink>FindObjects</funclink>
      <funclink>ObjectCount</funclink>
    </related>
  </func>
  <author>Clonkonaut</author><date>2006-07</date>
</funcs>
