objects

objects <room|creature|object>

The objects associated with an entity, as an iterable. What "associated" means depends on the argument's type:

Arguments

Returns

An iterable whose elements are objects. Consume it with each, count, first, select, or another iterable consumer. An empty or unresolved argument yields null.

Examples

after command (say) {
  oload 1
  do "say I am carrying [count [objects $self]] item(s)."
}

oload loads object vnum 1 onto the owner; [objects $self] then lists what the owner carries. After the load [count ...] evaluates to 1 and the mob says "I am carrying 1 item(s)."

after command (say) {
  oload 1
  do "say first carried = [name [first [objects $self]]]."
}

[first [objects $self]] is the loaded object, whose name is "a jail strongbox".

after command (say) {
  do "say There are [count [objects [room $self]]] objects on the ground."
}

Passing [room $self] lists the room's contents instead of the owner's inventory. In the bare debug room this evaluates to 0.

See also