objects
objects <room|creature|object>
The objects associated with an entity, as an iterable. What "associated" means depends on the argument's type:
- a room — the objects lying in that room;
- a creature — the objects the creature is carrying;
- an object — the objects contained inside it.
Arguments
<room|creature|object>— the entity whose objects to list. A value of any other type is a run-time error.
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
inventory— a creature's carried objects only (the creature case ofobjects).contents— a container's or room's contents.equipment,implants,tattoos— worn, implanted, and tattooed slots.creatures— the creatures in a room rather than the objects.each,count,first— consumers for the iterable.- Iterables and iterables · Types