2018-12-30 16:43:04 -08:00
|
|
|
|
---
|
|
|
|
|
|
title: object / create
|
|
|
|
|
|
---
|
2023-11-25 09:50:24 -08:00
|
|
|
|
# create
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
|
|
### NAME
|
|
|
|
|
|
|
2018-12-30 16:59:01 -08:00
|
|
|
|
create - object initialization
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
|
|
### SYNOPSIS
|
|
|
|
|
|
|
2020-03-10 16:38:35 +08:00
|
|
|
|
void create( void | ... );
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
|
|
### DESCRIPTION
|
2018-12-30 16:59:01 -08:00
|
|
|
|
|
2018-12-30 16:43:04 -08:00
|
|
|
|
Every object should have a create function defined within it. Within
|
|
|
|
|
|
that function, all initial object initialization should be done. cre‐
|
|
|
|
|
|
ate() is called on *all* objects. *NOTE* - This behavior is different
|
|
|
|
|
|
than the stock 3.1.2 LPmud driver. In 3.1.2, if an object is created
|
|
|
|
|
|
first by being inherited, then create() wasn't called on it. In MudOS,
|
|
|
|
|
|
this behavior has changed so that it is *always* called when an object
|
|
|
|
|
|
is created. As a result, you may see some odd behavior if you have a
|
|
|
|
|
|
create in a parent object that does a write, you will see two writes,
|
|
|
|
|
|
as if create() had been called twice on the same object. In reality,
|
|
|
|
|
|
create *is* being called twice, but on two *different* objects: the
|
|
|
|
|
|
parent, and the child that is calling parent::create() manually.
|
|
|
|
|
|
|
2020-03-10 16:38:35 +08:00
|
|
|
|
The arguments passed to the function will be the same as those passed to
|
2020-03-11 23:17:48 +08:00
|
|
|
|
new() or clone_object() in addition to the filename, if the object was
|
|
|
|
|
|
loaded using either of those efuns. For example, clone_object(file, 3, "hi")
|
|
|
|
|
|
will cause create(3, "hi") to be called in the object after it is created.
|
2020-03-10 16:38:35 +08:00
|
|
|
|
|
2018-12-30 16:43:04 -08:00
|
|
|
|
### SEE ALSO
|
|
|
|
|
|
|
2018-12-30 16:59:01 -08:00
|
|
|
|
reset(4), __INIT(4)
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
|
|
### AUTHOR
|
|
|
|
|
|
|
2018-12-30 16:59:01 -08:00
|
|
|
|
Wayfarer@Portals
|