# ChangeDef

Objects
Status
5.1 OC
bool
id new_def id of the new definition.
Assigns a new definition to an object.
ChangeDef does not affect object local variables. The values of named local variables are transferred to local variables of the same name in the target definition.
Warning: if an object applies ChangeDef to itself, the executed object script will no longer match the object definition after the call. Because of this, following a ChangeDef call you should neither call any local function (use this()->function(...) instead) nor access any local variables (even if a variable of the same name exists in the new definition).
GetCursor
(0)->ChangeDef(Wipf);
Changes the selected clonk of the first player into a wipf.
GetID
Sven2
2001-11