blob: 365fca2d7dcd171aaaf5fc28b419ac9edfa025a1 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 string load_name()
Zesstra715ec202025-07-09 22:18:31 +02003 string load_name(object obj)
4 string load_name(lwobject obj)
5 string load_name(string obj)
MG Mud User88f12472016-06-24 23:31:02 +02006
Zesstra715ec202025-07-09 22:18:31 +02007DESCRIPTION
8 Return the load name for the object <obj> which may be a regular
9 or lightweight object or the name of an object.
MG Mud User88f12472016-06-24 23:31:02 +020010
Zesstra715ec202025-07-09 22:18:31 +020011 If <obj> is a clone or a lightweight object, return the
12 load_name() of <obj>'s blueprint.
13 If <obj> is a blueprint, return the filename from which the
14 blueprint was compiled.
MG Mud User88f12472016-06-24 23:31:02 +020015
Zesstra715ec202025-07-09 22:18:31 +020016 If <obj> is given by name but not/no longer existing, the
17 function synthesizes the load name as it should be and returns
18 that. If the given name is illegal, the function returns 0.
MG Mud User88f12472016-06-24 23:31:02 +020019
Zesstra715ec202025-07-09 22:18:31 +020020 As a special case, if <ob> is 0, the function returns 0.
MG Mud User88f12472016-06-24 23:31:02 +020021
Zesstra715ec202025-07-09 22:18:31 +020022 For virtual objects this efun returns the original load_name of the
23 object created by the virtual compiler.
MG Mud User88f12472016-06-24 23:31:02 +020024
Zesstra715ec202025-07-09 22:18:31 +020025 If <obj> is omitted, the name for the current object is returned.
MG Mud User88f12472016-06-24 23:31:02 +020026
Zesstra715ec202025-07-09 22:18:31 +020027 In contrast to the object_name(), the load name can not be changed
28 by with rename_object() or a VC. However, if an object uses
29 replace_program() the load name no longer reflects the actual
30 behaviour of an object.
MG Mud User88f12472016-06-24 23:31:02 +020031
Zesstra715ec202025-07-09 22:18:31 +020032 The returned name starts with a '/', unless the driver is running
33 in COMPAT mode.
34
35EXAMPLES
MG Mud User88f12472016-06-24 23:31:02 +020036 object o;
37 o = clone_object("/std/thing");
Zesstra715ec202025-07-09 22:18:31 +020038 write(load_name(o)); --> writes "/std/thing" in !compat mode
39 and "std/thing" in compat mode
40 write(load_name("/std/thing")); --> same as above
41 write(load_name("/std/thing#4n5")); --> writes 0
MG Mud User88f12472016-06-24 23:31:02 +020042
Zesstra715ec202025-07-09 22:18:31 +020043HISTORY
44 Introduced in LDMud 3.2.6.
45 Strings are accepted as arguments since 3.2.8.
46 0 is accepted as argument since 3.2.9.
MG Mud User88f12472016-06-24 23:31:02 +020047
Zesstra715ec202025-07-09 22:18:31 +020048SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020049 clone_object(E), clonep(E), object_name(E), load_object(E),
50 replace_program(E), program_name(E), present_clone(E)