FindConstructionSite
Category: Landscape
Since engine version: 5.1 OC
Description
Searches for a suitable construction site for a building of the specified type, starting at the specified position. If a site is found, the coordinates are returned in the array [x,y]. Otherwise, the function returns nil
.
Syntax
array FindConstructionSite(id definition, int x, int y);
Parameters
- definition:
id of the desired building type.
- x:
Designated x-position of the construction site. Always global coordinates.
- y:
Designated y-position of the construction site. Always global coordinates.
Example
var xy;
if(xy = FindConstructionSite(ToolsWorkshop, GetX(), GetY()))
CreateConstruction(ToolsWorkshop, xy[0], xy[1], GetOwner(), 1, true);
Searches a construction site for a hut, starting at the local position. If a site is found, construction is started.
Sven2, 2001-11