Defines a trigger area, using a sequence of points.
The points describe the path for the area outline. Their order is crucial.
The image below shows several paths, and the order in which they are passed to the command. The polygon is automatically closed by connecting the last point with the first one (for instance, point 6 is the last one defined, so the engine connects it with point 1).
The points can be defined either as absolute coordinates (the map position), or relative to the triggers location. For absolute coordinates, the trigger position is moved to the center of the polygon; for relative coordinates, then the trigger position stays the same (if the trigger is rotated already, then that angle is ignored when calculating the relative position). Once the trigger is defined (with either method), it can be moved using setPos, and it keeps its shape. Polygons cannot be rotated manually, but if they are attached to an object, they rotate to keep their original alignment with the parent object.
Be aware that the representation of polygon triggers in the editor is not accurate: it is normally a rectangle that represents the maximum dimensions of the polygon, but it never actually displays the polygon itself. To display a polygon on the map, see drawPolygon.
|Syntax:||trigger setTriggerAreaPolygonal [points, absolute]|
Create a triangular trigger zone, using absolute coordinates:
The green markers (1-14) indicate the polygon points used, and the red markers (created in a different script) indicate the covered area (see Polygon_Triggers.zip).
|See also:||triggerAreaPolygonal, setTriggerArea|