Category: Objects / Creation
Since engine version: 1.0 OC
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 check_site 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
object CreateConstruction(id object_id, int xoffset, int yoffset, int owner, int completion, bool adjust_terrain, bool check_site);
- Type of object to be created.
- X coordinate
- Y coordinate
- Owner of the new object (valid player number or NO_OWNER for no-owner).
- Determines the initial completion of the object in percent (minimum 1).
- Determines whether the landscape at the creation site has to be adjusted to the objects basement.
- First checks the specified site for suitability.
CreateConstruction(WindGenerator, 150,100, 0,100,1 );
Creates a complete wind generator at position 150/100 for player 1 and adjusts the landscape to the building.
CreateConstruction(SteamEngine, 200,100, NO_OWNER, 30,1 );
Creates a steam engine construction finished by 30% site at position 200/100 with no owner, also adjusting the landscape.