vnum

vnum <npc|object|room>

The numeric vnum of an NPC, object, or room.

A vnum is the prototype number a builder assigns in the world files. For a room it is the room number.

Arguments

Returns

An int — the entity's vnum (the room number for a room).

Examples

after command (say) {
  do "say My prototype vnum is [vnum $self]."
}

The owner Puff is mob vnum 1, so this says "My prototype vnum is 1."

Guard against players before asking for a vnum:

after command (say) {
  if [ismob $actor] {
    do "say You are mob [vnum $actor]."
  }
}

This only reports a vnum for NPC actors, avoiding the player error.

Returns for objects and rooms

after command (say) {
  oload 1
  do "say I loaded object [vnum [first [inventory $self]]]."
  do "say This room is number [vnum [room $self]]."
}

The loaded object reports vnum 1, and room Limbo reports number 1.

See also