SYNOPSIS

void create()

DESCRIPTION

The H_CREATE_SUPER(H), H_CREATE_OB(H), and H_CREATE_CLONE(H) hooks define the function or closure to be called when the driver creates a new object. In older drivers this was hardwired to the lfun create(A), and a lot of hook implementations still follow this tradition.

This function will be called only once on creation of the object (this is when the object will be loaded or cloned). Inside this function all major initialization can be done. The current user and the previous object are defined but the object has no environment.

USAGE

Initialize the global variable to hold the one who created/cloned the object:

object cloner;
void create() {
  cloner=this_player();
}

HISTORY

  • changed (3.2.1) – the mudlib may be programmed to call other lfuns than create(A) on an object’s creation.