MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
| 2 | string load_name() |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 3 | string load_name(object obj) |
| 4 | string load_name(lwobject obj) |
| 5 | string load_name(string obj) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 6 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 7 | DESCRIPTION |
| 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 10 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 11 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 15 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 16 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 19 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 20 | As a special case, if <ob> is 0, the function returns 0. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 21 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 22 | For virtual objects this efun returns the original load_name of the |
| 23 | object created by the virtual compiler. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 24 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 25 | If <obj> is omitted, the name for the current object is returned. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 26 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 27 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 31 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 32 | The returned name starts with a '/', unless the driver is running |
| 33 | in COMPAT mode. |
| 34 | |
| 35 | EXAMPLES |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 36 | object o; |
| 37 | o = clone_object("/std/thing"); |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 38 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 42 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 43 | HISTORY |
| 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 47 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 48 | SEE ALSO |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 49 | clone_object(E), clonep(E), object_name(E), load_object(E), |
| 50 | replace_program(E), program_name(E), present_clone(E) |