name

name <creature|object|room>

The display name of an entity.

Works on a creature, an object, or a room; the result is the name as it would appear in game.

Arguments

Returns

A string — the entity's display name.

Examples

after command (say) {
  do "say My name is [name $self], and I greet [name $actor]."
}

When the owner is the mob Puff and the actor is Puff as well, [name $self] evaluates to Puff, so the mob says "My name is Puff, and I greet Puff."

name also works on objects and rooms — including the room returned by room:

after command (say) {
  oload 1
  do "say I am holding [name [first [inventory $self]]]."
  do "say We are standing in [name [room $self]]."
}

After loading object vnum 1, the first carried object reports as "a jail strongbox", and the owner's room reports as "Limbo".

See also