MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | SYNOPSIS |
| 2 | void create() |
| 3 | |
| 4 | DESCRIPTION |
| 5 | The H_CREATE_SUPER/_OB/_CLONE hooks define the function or closure |
| 6 | to be called when the driver creates a new object. In older |
| 7 | drivers this was hardwired to the lfun create(), and a lot of |
| 8 | hook implementations still follow this tradition. |
| 9 | |
| 10 | This function will be called only once on creation of the |
| 11 | object (this is when the object will be loaded or cloned). |
| 12 | Inside this function all major initialization can be done. The |
| 13 | current user and the previous object are defined but the |
| 14 | object has no environment. |
| 15 | |
| 16 | EXAMPLE |
| 17 | object cloner; |
| 18 | void create() { |
| 19 | cloner=this_player(); |
| 20 | } |
| 21 | |
| 22 | Initialize the global variable to hold the one who |
| 23 | created/cloned the object. |
| 24 | |
| 25 | For 3.2.1, the mudlib may be programmed to call other lfuns |
| 26 | than create() on an objects creation. |
| 27 | |
| 28 | SEE ALSO |
| 29 | reset(A), init(A), __INIT(A), initialisation(LPC), hooks(C), native(C) |