Skip to main content

restore_object

Discworld driver help

restore_object

Name

restore_object() - restore values of variables from a file into an object

Synopsis

int restore_object( string name, int flag );

Description

Restore values of variables for current object from file `name'. If the optional argument `flag' is 1, then all of the non-static variables are not zeroed out prior to restore (normally, they are).

In the case of an error, the affected variable will be left untouched and an error given.

If the save file contains a variable that's not present in the object (this can happen if the object's file changes), the function `restore_lost_variable()' is called on the object, with the restored value (mixed) and the name of the variable (string) as arguments, in that order. This can be used to supply backwards compatibility with old savefiles.

See also

save_object()