room

room <creature|object|room|int>

The room an entity is in — or, given an integer, the room with that vnum.

For a creature it is the room they occupy; for an object, the room it lies in (or null if it is carried or contained rather than on the ground). A room argument returns itself, and an int argument resolves a room by its vnum.

Arguments

Returns

A room, or null when an object is not lying in a room.

Examples

after command (say) {
  do "say We are in [name [room $actor]]."
}

[room $actor] is the actor's current room; here that is Limbo, so the mob says "We are in Limbo." Chaining name turns the room into its display name.

Resolve a room directly from its vnum:

after command (say) {
  do "say Room 1 is called [name [room 1]]."
}

[room 1] looks up the room with vnum 1 — Limbo — without needing any entity to be standing in it.

See also