ldmud-3.4.1/doc/
ldmud-3.4.1/doc/efun.de/
ldmud-3.4.1/doc/efun/
ldmud-3.4.1/doc/man/
ldmud-3.4.1/doc/other/
ldmud-3.4.1/mud/
ldmud-3.4.1/mud/heaven7/
ldmud-3.4.1/mud/lp-245/
ldmud-3.4.1/mud/lp-245/banish/
ldmud-3.4.1/mud/lp-245/doc/
ldmud-3.4.1/mud/lp-245/doc/examples/
ldmud-3.4.1/mud/lp-245/doc/sefun/
ldmud-3.4.1/mud/lp-245/log/
ldmud-3.4.1/mud/lp-245/obj/Go/
ldmud-3.4.1/mud/lp-245/players/lars/
ldmud-3.4.1/mud/lp-245/room/death/
ldmud-3.4.1/mud/lp-245/room/maze1/
ldmud-3.4.1/mud/lp-245/room/sub/
ldmud-3.4.1/mud/lp-245/secure/
ldmud-3.4.1/mud/morgengrauen/
ldmud-3.4.1/mud/morgengrauen/lib/
ldmud-3.4.1/mud/sticklib/
ldmud-3.4.1/mud/sticklib/src/
ldmud-3.4.1/mudlib/uni-crasher/
ldmud-3.4.1/pkg/
ldmud-3.4.1/pkg/debugger/
ldmud-3.4.1/pkg/diff/
ldmud-3.4.1/pkg/misc/
ldmud-3.4.1/src/autoconf/
ldmud-3.4.1/src/hosts/
ldmud-3.4.1/src/hosts/GnuWin32/
ldmud-3.4.1/src/hosts/amiga/
ldmud-3.4.1/src/hosts/win32/
ldmud-3.4.1/src/ptmalloc/
ldmud-3.4.1/src/util/
ldmud-3.4.1/src/util/erq/
ldmud-3.4.1/src/util/indent/hosts/next/
ldmud-3.4.1/src/util/xerq/
ldmud-3.4.1/src/util/xerq/lpc/
ldmud-3.4.1/src/util/xerq/lpc/www/
ldmud-3.4.1/test/t-030925/
ldmud-3.4.1/test/t-040413/
ldmud-3.4.1/test/t-041124/
SYNOPSIS
        object clone_object(string name)
        object clone_object(object template)

DESCRIPTION
        Clone a new object from definition <name>, or alternatively from
        the object <template>. In both cases, the new object is given
        an unique name and returned.

        The original, called blueprint, used for cloning, should not be
        used in the system, just for cloning. The cloned objects
        contain only the data but the blueprint also the function code.
        The blueprint is the one without a unique number at the end of
        the object's name. The clone_object() function never
        returns a blue print.

        If the blueprint exists and has a heart_beat(), clone_object()
        turns it off.

        Note that the pathname must be complete, which means there are no
        relative paths allowed.

        If strict euids are enforced, the cloning object must have
        a non-zero euid.


        -- Variable Initialization --

        In general, variables are initialized for blueprints and clones alike
        with a call to the internal lfun __INIT(). However, if #pragma
        share_variables is in effect (either explicitely given in the source
        or implicitely as runtime option), the values for a clone's variables
        are taken from the _current_ variables of the object's blueprint.

        Variables without explicit initializers are always initialized to 0.

EXAMPLE
        // Clone a torch (filename in non-compat format)
        object torch;
        torch = clone_object("/obj/torch");

        // Clone two keys (filename in compat format)
        object key1, key2;
        key1 = clone_object(load_object("obj/key"));
        key2 = clone_object(key1);

        // Create a specialized weapons blueprint.
        --- std/weapon.c: --- 
        #pragma share_variables
        int weapon_class = 1;

        --- broadsword.c: ---
        inherit "/std/weapon";

        int create() {
            weapon_class = 2;
            replace_program("/std/weapon");
        }


HISTORY
        Modified in LDMud 3.2.6 to take an object as argument.
        LDMud 3.3.378 consolidated the variable initialization with the
        share_variables pragma.

SEE ALSO
        blueprint(E), clonep(E), destruct(E), clones(E), load_name(E),
        load_object(E), move_object(E), uids(C), program_name(E), pragma(LPC)