# SetMass

Objects
Status
4.9.1.0 GWE
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(clonk) { var mass=clonk->GetMass(), i, obj; while(obj = clonk->Contents(i++)) mass -= obj->GetMass(); return(mass); }

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