DoCon

Category: Objects / Status
Since engine version: 6.0 OC

Description

Adjusts the completion value of an object. This affects the completion of construction sites or the growth of trees and living beings. If completion drops below 0, the object is removed.

Syntax

void DoCon(int change, int precision, bool grow_from_center);

Parameters

change:
Change of completion in percentage point (positive or negative).
precision:
If specified, the con value will be divided by this value. No value or 0 uses the default precision of 100.
grow_from_center:
If specified, this parameter determines whether the object should grow from the bottommost vertex or from its center. The default value is false, which makes the object grow from the bottommost vertex.

Examples

var obj;
for(var obj inFindObjects(Find_OCF(OCF_Construct),Find_NoContainer(),Find_Not(Find_OCF(OCF_Fullcon)))) obj->DoCon(100);
Completes all construction sites.
GetCursor(plr)->DoCon(-50);
Robs the selected crewmember half of its normal size, if the object was fully grown, its half-grown afterwards, if it was half-grown, it vanishes.
See also: GetCon, SetCon
Sven2, 2001-11
Marky, 2015-01