blob: b5087db134feb654391f8fcfa5a6c2fc26b65900 [file] [log] [blame]
Zesstrad59c3892019-11-28 20:53:39 +01001SYNOPSIS
2 string object_name()
3 string object_name(object ob)
MG Mud User88f12472016-06-24 23:31:02 +02004
Zesstra715ec202025-07-09 22:18:31 +02005DESCRIPTION
6 Get the name of an object <ob> or, if no argument is given, of
7 the current object.
MG Mud User88f12472016-06-24 23:31:02 +02008
Zesstra715ec202025-07-09 22:18:31 +02009 As a special case, if <ob> is 0, the function returns 0.
MG Mud User88f12472016-06-24 23:31:02 +020010
Zesstra715ec202025-07-09 22:18:31 +020011 This name is the name under which the object is stored in the
12 muds object table. It is initialised at the creation of the
13 object such that blueprints are named after the file they are
14 compiled from (without the trailing '.c'), and clones receive
15 the name of their blueprint, extended by '#' followed by
16 a unique non-negative number. These rules also apply to
17 virtual objects - the real name/type of virtual objects
18 is ignored.
MG Mud User88f12472016-06-24 23:31:02 +020019
Zesstra715ec202025-07-09 22:18:31 +020020 The name of an object can be changed with rename_object(), and
21 object_name() will reflect any of these changes.
Zesstrad59c3892019-11-28 20:53:39 +010022
Zesstra715ec202025-07-09 22:18:31 +020023 The returned name always begins with '/' (absolute path),
24 except when the parser runs in COMPAT mode.
Zesstrad59c3892019-11-28 20:53:39 +010025
Zesstra715ec202025-07-09 22:18:31 +020026EXAMPLES
27 find_object(object_name(ob)) == ob
Zesstrad59c3892019-11-28 20:53:39 +010028
Zesstra715ec202025-07-09 22:18:31 +020029 This is guaranteed to be true for all objects ob that are not
30 destructed.
Zesstrad59c3892019-11-28 20:53:39 +010031
Zesstra715ec202025-07-09 22:18:31 +020032HISTORY
33 0 is accepted as argument since 3.2.9.
Zesstrad59c3892019-11-28 20:53:39 +010034
Zesstra715ec202025-07-09 22:18:31 +020035SEE ALSO
Zesstrad59c3892019-11-28 20:53:39 +010036 clone_object(E), load_name(E), load_object(E), find_object(E),
37 object_time(E), program_name(E), rename_object(E)