2018-12-30 16:43:04 -08:00
|
|
|
---
|
|
|
|
|
title: objects / clone_object
|
|
|
|
|
---
|
2023-11-25 09:50:24 -08:00
|
|
|
# clone_object
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
### NAME
|
|
|
|
|
|
2018-12-30 16:59:01 -08:00
|
|
|
clone_object() - load a copy of an object
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
### SYNOPSIS
|
|
|
|
|
|
2021-04-17 20:57:47 -05:00
|
|
|
object clone_object( string name, ... );
|
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
|
|
|
Load a new object from definition <name>, and give it a new unique
|
|
|
|
|
name. Returns the new object. An object with a nonzero environment()
|
2021-04-17 20:57:47 -05:00
|
|
|
cannot be cloned. Optionally, additional arguments may be passed to
|
|
|
|
|
clone_object() which will be passed to 'create()' in the new object.
|
2018-12-30 16:43:04 -08:00
|
|
|
|
2021-04-17 23:46:48 -04:00
|
|
|
### EXAMPLE
|
|
|
|
|
|
|
|
|
|
object ob = clone_object("/obj/torch") ; // clone a torch object
|
|
|
|
|
object money = clone_object("/obj/money", 10, "dollars" ) ; // clone a money object and set initial values
|
|
|
|
|
|
2018-12-30 16:43:04 -08:00
|
|
|
### SEE ALSO
|
|
|
|
|
|
2018-12-30 16:59:01 -08:00
|
|
|
destruct(3), move_object(3), new(3)
|
2019-10-19 01:03:49 -07:00
|
|
|
|