# SetMass

Objects
Status
5.1 OC
void
int mass New mass of the object
Changes the mass of the object. The mass is initialized with DefCore.txt/[DefCore]/Mass. The actual weight is the deadweight plus the weight of the contained objects.
private func GetOwnMass(object clonk) { var mass=clonk->GetMass(), i, obj; while(obj = clonk->Contents(i++)) mass -= obj->GetMass(); return mass; }

protected func ControlUse(object clonk) { clonk->SetMass(GetOwnMass(clonk) + 100); clonk->Sound("ClonkMunch"); RemoveObject(); return true; }
Script for a cookie: when eating this cookie the mass of the clonk will increase.
GetMass
Sven2
2003-06