# GetComponent

Objects
Components
5.1 OC
int / id
id component Object component of which to determine the count. If not specified, index is used and the id of the component is returned.
int index Index of the component to be returned. This parameter is ignored if component is specified. Returns the id of the indicated component which can then be used to determine the count in a subsequent call to GetComponent.
object obj Object of which to determine components. Can be `nil` in local calls. If definition is specified, this parameter is ignored.
id definition Definition of which to determine components. If `nil`, the specified object is checked instead.
Used to determine object components.
var i,cid,num; while (id = GetComponent(nil, i++, nil, GetID())) if ((num = GetComponent(id) - GetComponent(id, 0, nil, GetID())) > 0) while (num--) CreateObject(id);
Creates all components which are still missing in the calling object (e.g. in a construction site) in front of the object.
SetComponent
Split2Components
Cucaracha
2002-05