ComposeContents

Category: Objects / Creation
Since engine version: 4.6.5.0 CP

Description

Creates an object of the specified type in the contents of pObj. The object is composed from components which must be available in pObj. Otherwise, a message is displayed listing missing components. This function, too, causes the callbacl BuildNeedsMaterial which can be used to intercept the message and perform custom actions for acquiring the necessary material.

Syntax

object ComposeContents (id id, object pObj);

Parameters

id:
Type of object to be created
pObj:
Object which contains the required components

Example

ComposeContents( STMG, FindObject(HUT1) );
Composes a steam engine in the closts hut if the necessary material is available.
springer, April 2002