PlaceInMaterial

Category: Objects / Creation
Since engine version: 4.9.1.0 GWE

Description

Creates an object of the specified type somewhere in the landscape and returns a pointer to the created object.

Syntax

object PlaceInMaterial (id idDef, int iMaterial, int iRetries);

Parameters

idDef:
Object type
iMaterial:
Material
iRetries:
[opt] Number of retries

Examples

PlaceInMaterial(FLNT, Material("Earth"));
Attempts to create a flintstone in earth
var obj = PlaceInMaterial(FLAG, Material("Gold"));
if (obj)  SetOwner(0, obj);
if (!obj) Log("Konnte keine Flagge in Gold erzeugen!");
				
Attempts to create a flag in a gold vein and make player 0 its owner. If the creation fails, an error message is logged
See also: CreateObject, PlaceObjects
flgr, Januar 2002