fluffos/docs/efun/objects/clone_object.md

30 lines
736 B
Markdown
Raw Permalink Normal View History

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
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()
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
### 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)