Category: Objects / Contents
Since engine version: 1.0 OC


Collects an object. This function performs the same events as they occur if the object is collected in the game through the Collection area (there will be a RejectCollect call, flag collection checks, hit calls, etc.) The only difference is that there will be no comparison of collection position and the collected item is not checked for the OCF_Carryable flag.
Using this function you can for example collect objects directly from a container. If the function fails (e.g. through a RejectCollect or a full target container) the function returns false, otherwise true.


bool Collect(object item, bool ignore_ocf);


Object to be collected.
Ignores the fact that a container must have OCF_Collection for it to collect an object.


protected func ContainedUse(object clonk)
	var obj = Contents();
	if (obj)
		if (!clonk->Collect(obj))
			clonk->Message("Collect not possible.",clonk);
	return true;
With contained use the first inventory object is passed to the selected clonk.
See also: Enter
Sven2, 2002-05