CreateObject

Category: Objects / Creation
Since engine version: 1.0 OC

Description

Creates an object of the specified type at the specified position. The position will be the center of the new object, so that the object is exactly at the specified coordinates if it is created in global context. xoffset and yoffset are relative to the calling object in local calls, otherwise global.

Syntax

object CreateObject(id id, int xoffset, int yoffset, int owner);

Parameters

id:
Type of object to be created.
xoffset:
X coordinate
yoffset:
Y coordinate
owner:
[opt] Owner of the new object. Either a valid player number or NO_OWNER for no owner. If not specified the owner is the controller (see GetController) of the calling object or NO_OWNER if the call is made without object context.

Remark

The function behaviour has changed since version 6.0 OC: The offset of the object is now created at the specified position, not the bottom center. The old behaviour is used in CreateObjectAbove.

Example

CreateObject(Wipf, 100,100, NO_OWNER);
Creates a wipf at coordinates 100/100 with no owner.
See also: CreateConstruction, CreateContents, CreateObjectAbove, RemoveObject
springer, 2002-04
Marky, 2015-01