object
object <vnum>
Look up an object prototype by its vnum.
A prototype is the template an object is built from, not a live item in
the world. Use object to read facts about a kind of item — its name,
its level — without needing an instance of it loaded. To act on the
actual objects in a room or inventory, use the live-entity producers
objects, contents, or
inventory instead.
Arguments
<vnum>— an int, the object's vnum.
Returns
An obj_proto (Types), or null if no object prototype
has that vnum. Test the result with isnull or
exists before using it.
Examples
after command (say) {
do "say That box is called [name [object 1]]."
}
Object vnum 1 exists, so [object 1] is non-null and
name reads the prototype's display name: the mob says
"That box is called a jail strongbox."
Guard against a missing vnum:
after command (say) {
if [isnull [object 99999]] {
do "say There is no such object."
}
}
No prototype has vnum 99999, so [object 99999] is null and the
isnull branch runs.