\b;Anweisung \c;radar\n;
With the instruction \c;radar();\n;, you can look for objects like \l;enemies\u object\mother;, bots, buildings or raw materials.

\b;Grundlagen
Schreiben Sie in Klammern den \l;Namen des Objekts\u cbot\category;, das Sie suchen. Geben Sie das Ergebnis in eine Variable vom \l;Typ\u cbot\type; \c;object\n;. Hier ist ein Beispiel, das nach der nächsten Ameise sucht:
\c;
\s;// Am Anfang des Programms:
\s;object  item; // Deklaration der Variable
\s;
\s;// sucht die nächste Ameise
\s;item = radar(AlienAnt);
\n;
\b;Für Spezialisten
Syntax:
\s;\c;radar ( cat, angle, focus, min, max, sens, filter );\n;

Sucht nach einem Objekt gemäss verschiedenen Parametern.

\image radar1 8 8;
Von oben gesehen, entspricht die lila Zone der Zone, wo nach dem Objekt gesucht wird. 

\t;cat: \c;\l;int\u cbot\int;\n;
o \l;Category\u cbot\category; of the objects that should be detected. For example, when you are looking for an ant, write \c;radar(AlienAnt)\n;. 
o \l;Array\u cbot\array; of categories of the objects that should be detected. For example, when you are looking only for grabbers:
\c;\s;int bots[4];
\s;bots[0] = WheeledGrabber;
\s;bots[1] = TrackedGrabber;
\s;bots[2] = WingedGrabber;
\s;bots[3] = LeggedGrabber;
\s;object nearestGrabber = radar(bots);\n;
o Keyword \const;Any\norm; if you are looking for any object (including even plants and so on). Filters may be useful to use with this keyword.

\t;angle: \c;\l;float\u cbot\float;\n; (default value: \c;0\n;)
Richtung, in die das Radar gedreht werden soll, in Grad.
\c;  0\n; -> das Radar schaut geradeaus
\c;-90\n; -> das Radar schaut im rechten Winkel nach rechts
\c; 90\n; -> das Radar schaut im rechten Winkel nach links

\t;focus: \c;\l;float\u cbot\float;\n; (default value: \c;360\n;)
Öffnungswinkel des Radars, in Grad.

\t;min: \c;\l;float\u cbot\float;\n; (default value: \c;0\n;)
Minimale Suchdistanz in Metern. Objekte, die näher als die minimale Distanz sind, werden nicht gefunden.

\t;max: \c;\l;float\u cbot\float;\n; (default value: \c;1000\n;)
Maximale Suchdistanz in Metern. Objekte, die ferner als die maximale Distanz sind, werden nicht gefunden.

\t;sens: \c;\l;float\u cbot\float;\n; (default value: \c;1\n;)
Bestimmt, in welcher Richtung die Objekte gesucht werden sollen. Mit dem Wert \c;1\n; wird das nächste Objekt in der Suchzone zurückgegeben. Mit dem Wert \c;-1\n; wird das am weitesten entfernte Objekt in der Zone zurückgegeben.

\t;filter: \c;\l;int\u cbot\int;\n; (default value: \c;\const;FilterNone\norm;\n;)
Determines which type of objects should be detected. Especially useful in use with an \l;array\u cbot\array; or \const;Any\norm;. The following filters are available:

\c;\const;FilterNone\norm;        \n;Detects everything (default)
\c;\const;FilterOnlyLanding\norm; \n;Detects only objects being on the ground
\c;\const;FilterOnlyFlying\norm;  \n;Detects only objects not being on the ground
\c;\const;FilterFriendly\norm;    \n;Detects only allies (objects in the same team)
\c;\const;FilterEnemy\norm;       \n;Detects only enemies (objects in an other team except neutral)
\c;\const;FilterNeutral\norm;     \n;Detects only neutral objects (e.g. resources)

The last three are mainly useful in \l;code battles\u battles;. You can also pass a team ID to search only for objects from a specific team. Attention: you should use \const;FilterNeutral\norm; instead of \c;0\n; or else it will not work.

Filters and IDs can be mixed using bitwise OR operator \c;|\n;, for example \c;radar(Any, 0, 360, 0, 1000, 1, 2 | FilterOnlyLanding);\n; will only detect an object from team \c;2\n; that is on the ground. Attention: you can specify only one team ID at once, but you can specify several filters at once.

\t;Rückgabe: \c;\l;object\u cbot\object;\n;
Gibt das erste Objekt zurück, das der gewünschten Kategorie in der angegebenen Zone entspricht. Wenn kein Objekt gefunden wurde, wird der Wert \c;\l;null\u cbot\null;\n; zurückgegeben.

\t;Bemerkung
Sie müssen nicht alle Parameter angeben. Hier sind zwei Beispiele, die jeweils gleichwertig sind:
\c;
\s;	radar(Titanium, 0, 360, 0, 1000);
\s;	radar(Titanium);  // gleichwertig

\s;	radar(Titanium, 0, 90, 0, 1000);
\s;	radar(Titanium, 0, 90);  // gleichwertig
\n;
Wenn ein oder mehrere Parameter nicht angegeben werden, wird der oben angegebene Standardwert stattdessen eingesetzt. Nur der erste Parameter ist obligatorisch, z.B. \c;radar(AlienAnt)\n; sucht nach der nächsten Ameise, wo immer sie sein mag.

\t;Siehe auch
\c;\l;radarall\u cbot\radarall;();\n;, \l;programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.

