CreateConstruction

Category: Objects / Creation
Since engine version: 4.6.5.0 CP

Description

Should be used instead of CreateObject to create a building or construction site. In local calls the specified position will be an offset to the position of the calling object. If fCheckSite is 1, the site is checked for suitability before creating the object. If the site is not suitable (e.g. rough ground or not enough space), a message is displayed above the calling object and the function returns 0.

Syntax

object CreateConstruction (id id, int iXOffset, int iYOffset, int iOwner, int iCompletion, bool fTerrain, bool fCheckSite);

Parameters

id:
Type of object to be created
iXOffset:
X coordinate
iYOffset:
Y coordinate
iOwner:
Owner of the new object (valid player number or NO_OWNER for no-owner).
iCompletion:
Determines the initial completion of the object in percent (minimum 1).
fTerrain:
Determines whether the landscape at the creation site is to be adjusted.
fCheckSite:
First checks the specified site for suitability

Examples

CreateConstruction( HUT2, 150,100,  0,100,1 );
Creates a compete hut at position 150/100 for player 1 and adjusts the landscape to the building.
CreateConstruction( HUT3, 200,100, NO_OWNER, 30,1 );
Creates a hut construction site at position 200/100 with no owner, also adjusting the landscape.
See also: CreateContents, CreateObject, RemoveObject
springer, April 2002